How to hide the share action (which use most) icon near the share action provider?

If you wish to keep all the share history data model, but just don’t want the extra “default share activity” icom. The answer at How do you turn off share history when using ShareActionProvider? is not good enough. What you should do is: Copy these classes from the ActionBarSherlock to your project code ShareActionProvider.java ActivityChooserView.java … Read more

How to change ActionMode background color in Android

In my case i resolved with this. First i created a style to define the actionModeBackground: <style name=”MyTheme.ActionMode” parent=”@android:style/Theme.Holo.Light”> <item name=”android:actionModeBackground”>#FFFFFF</item> </style> Then i add the style into my base application theme: <style name=”AppTheme” parent=”AppBaseTheme”> <item name=”android:actionModeStyle”>@style/MyTheme.ActionMode</item> </style> Hope it helps!!!

Is it possible to change actionbar tab indicator programmatically

I have succeeded to implement what i wanted by using @Padma’s answer to generate my tab indicator backgrounds : i needed 5 selectors : green, yellow, blue, orange and red. So i created 5 xml drawables (tabs_selector_red.xml, tabs_selector_blue.xml, etc…) : tabs_selector_green.xml : <!– Non focused states –> <item android:drawable=”@android:color/transparent” android:state_focused=”false” android:state_pressed=”false” android:state_selected=”false”/> <item android:drawable=”@drawable/layer_bg_selected_tabs_green” android:state_focused=”false” … Read more

Problems importing project into Android Studio regarding ActionBarSherlock

Seems there’s a lot of general issues on importing modules to Android Studio, not just ActionBarSherlock, this answer might also address those. (However the last steps relating to junit are particular to abs) The steps below allowed me to get ActionBarSherlock running with no issues. 1) Download latest ABS here: http://actionbarsherlock.com/ 2) Extract ABS you … Read more

How can you implement multi-selection and Contextual ActionMode in ActionBarSherlock?

So here’s what I did. Edit: Over a year passed since I found out the previous answer had alot of useless code (woops) and the CAB thing can be achieved with much less effort and a cleaner code, so I took some time and updated it The LibraryFragment ListView should be defined with choice mode … Read more

Spinner : onItemSelected not called when selected item remains the same

Ok, I finally found a solution, by creating my own class extending Spinner : public class MySpinner extends Spinner { OnItemSelectedListener listener; public MySpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Override public void setSelection(int position) { super.setSelection(position); if (listener != null) listener.onItemSelected(null, null, position, 0); } public void setOnItemSelectedEvenIfUnchangedListener( OnItemSelectedListener listener) { this.listener = … Read more

Put a progressBar on ActionBar

NOTE: The functionality below is now deprecated in the Support Library. You need to call requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS) in your onCreate() before setting the activity’s layout: e.g. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); … // set layout etc If you are using the support library replace requestWindowFeature with supportRequestWindowFeature And then call setProgressBarIndeterminateVisibility(true); on your … Read more

Using ActionBarSherlock With the New SupportMapFragment

It all works like a charm, mainly thanks to Jake’s great work on ActionBarSherlock Here are the steps I followed: Create a SherlockMapFragment class in your actiobarsherlock library project. I simply made a copy of SherlockFragment because I also needed support for setHasOptionsMenu(true) The activity extends SherlockFragmentActivity (as usual) The fragment extends the newly created … Read more