Tag: android-actionbar

Change background color of ActionBarSherlock programmatically

I have an ActionBarSherlock on my form. I’m reading style information at runtime. One of the pieces of style is the background color of the ActionBar. How can I change this at runtime? The color can be any RGB value.

Customize ActionBar TabBar (ActionBarSherlock)

I have been stuck on this issue for some days now. Can anyone help me customize the Tabs displayed below the ActionBar (NavigationMode is NAVIGATION_MODE_TABS) ? I basically want to change the background color of the tabs and the underline color of the currently selected Tab. So far this is what I have done, yet […]

Android: Change color of line below ActionBar

I want to change the color of the orange line below the ActionBar. I’ve tried a few things but nothing has helped so far. The current theme on my Galaxy S2 is an orange theme. So changing the theme, also changes the line. But I donĀ“t know how to get access to that line, in […]

Android Tabs + Sliding, how do I implement ActionBarSherlock?

I’m using Google’s new tools to start an application that has the ability to switch between three tabs. This is great, but lacks support for older devices. 1. I added ABS with the support library to the application. 2. I changed public class MainActivity extends FragmentActivity implements ActionBar.TabListener { to public class MainActivity extends SherlockFragmentActivity […]

ActionBar Lag in hiding title

I’m using the ActionBarSherlock for my application and this is the code I use to hide the Title of ActionBar : @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar actionBar = getSupportActionBar(); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayUseLogoEnabled(true); setContentView(R.layout.main_fragment); } The problem with this is that when the application starts there is a short amount of time when the […]

Change ActionBar Menu Icons depending on Style

I want to use different ActionBar Icons depending on which style I use (Dark or Light). I couldn’t figure it out how, heres what I tried: <style name=”AppThemeDark” parent=”Theme.Sherlock.ForceOverflow”> <item name=”android:actionButtonStyle”>@style/customActionButtonStyleDark</item> <item name=”actionButtonStyle”>@style/customActionButtonStyleDark</item> </style> <style name=”AppThemeLight” parent=”Theme.Sherlock.Light.ForceOverflow”> <item name=”android:actionButtonStyle”>@style/customActionButtonStyleLight</item> <item name=”actionButtonStyle”>@style/customActionButtonStyleLight</item> </style> <style name=”customActionButtonStyleDark” > <item name=”@drawable/action_search”>@drawable/action_search</item> </style> <style name=”customActionButtonStyleLight” > <item name=”@drawable/action_search”>@drawable/action_search_light</item> </style> I […]

How to hide ActionBar while scrolling ListView in android?

I need to create a GUI with a ListView and an ActionBar which will hide when scrolling down and when scrolling up it must reappear. The following guides didn’t help me: https://mzgreen.github.io/2015/06/23/How-to-hideshow-Toolbar-when-list-is-scrolling%28part3%29/ https://github.com/ksoichiro/Android-ObservableScrollView I need something like this:

How to distinguish two menu item clicks in ActionBarSherlock?

I have been working with ActionBarSherlock recently, and follwing various tutorials, I wrote this code to add items to Action bar @Override public boolean onCreateOptionsMenu(Menu menu) { menu.add(“Refresh”) .setIcon(R.drawable.ic_action_refresh) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); menu.add(“Search”)// Search .setIcon(R.drawable.ic_action_search) .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS); return true; } However, I dont know how to distinguish the two clicks. Although I did find out that you have […]

android: disable action bar home button

we have a file manager-like application where we use the action bar home button as a “go up in the folder structure” action. if the user is at the top of the folder structure, the button should be disabled. we set the home button as up when the user is within a sub folder. when […]

Unable to Add custom view to Android Action bar,why?

I am trying to add my custom view into Action bar. final View addView=getLayoutInflater().inflate(R.layout.home_actionbar_buttons, null); getActionBar().setCustomView(addView); my XML, <LinearLayout android:id=”@+id/linearLayout1″ xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_height=”wrap_content” android:layout_width=”match_parent”> <Button android:text=”Refresh” android:layout_height=”wrap_content” android:id=”@+id/btn_refresh” android:layout_width=”wrap_content”></Button> </LinearLayout but i get nullpointer exception. when i debug,addView object gets populated and its not null. is ViewGroupRoot mandatory while inflating? EDIT 1: Logcat 09-30 12:50:11.625: DEBUG/PackageManager(74): […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.