actionbarsherlock
Fragment is transparent and shows Activity below
IMHO I do not agree with this answer. You may want to replace your fragment or you may want to add it. For example let’s say that you are in a fragment that is a list retrieved by a network request, if you replace the fragment with let’s say the detailFragment and you add it …
Change Action Bar Title color
i have changed title color like this actionBar.setTitle(Html.fromHtml(“<font color=”#ff0000″>ActionBarTitle </font>”));
Setting ActionBarSherlock Theme for Android app
Usually, you set your theme in the manifest, as shown in the Android developer documentation (and linked to from the ActionBarSherlock theming page). If you want to use ActionBarSherlock everywhere within your app, this works: <application android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/Theme.Sherlock”>
How to get text on an ActionBar Icon?
Here is some example code that worked for me. 1: Create a layout for your badge menu item. <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”48dp” android:layout_height=”fill_parent” android:layout_gravity=”right” > <!– Menu Item Image –> <ImageView android:layout_width=”48dp” android:layout_height=”fill_parent” android:clickable=”true” android:src=”https://stackoverflow.com/questions/13288989/@drawable/bkg_actionbar_notify_off” /> <!– Badge Count –> <TextView android:id=”@+id/actionbar_notifcation_textview” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_alignParentRight=”true” android:padding=”@dimen/padding_small” android:text=”99″ android:textColor=”@color/holo_orange_dark” /> </RelativeLayout> 2: Create a menu item in …
Android ActionBar Customize Search View
I did a class SearchViewFormatter to format easily the native SearchView android widget. An example: new SearchViewFormatter() .setSearchBackGroundResource(R.drawable.my_bg) .setSearchIconResource(R.drawable.my_ic, true, false) //true to icon inside edittext, false to outside .setSearchVoiceIconResource(R.drawable.my_ic) .setSearchTextColorResource(R.color.my_color) .setSearchHintColorResource(R.color.my_color) .setSearchCloseIconResource(R.drawable.my_ic) .setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) .format(mSearchView);
ActionBarSherlock – The type android.support.v4.app.Fragment cannot be resolved. It is indirectly referenced from required .class files
I had the same problem as you since I had updated the SDK. I have solved my problem by doing this (on eclipse) : Right click on the action bar sherlock library => Properties => Java Build Path => Order and Export tab => check android support v4 or Android Private Libraries and select Ok …
showAsAction=”ifRoom” doesn’t show the item even when there is plenty of room
It is really not a big fat lie but a small oversight. The showAsAction attribute must be defined using a different namespace “http://schemas.android.com/apk/res-auto” You should therefore in your top menu tag define a namespace as follows xmlns:app=”http://schemas.android.com/apk/res-auto” and then use that to define your showAsAction attribute like so app:showAsAction=”ifRoom” That should fix it
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 …