android-actionbar

Android ActionBar backbutton and tabs

↘锁芯ラ 提交于 2019-12-04 03:05:13
I want to create an ActionBar and a tabbed navigation like the google+ app. I used this example as a starting point and now I have a great actionbar: http://developer.android.com/resources/samples/ActionBarCompat/index.html I've also included a ViewPager and a TabHost to have tabs and scrolling left/right Fragments. What i need is to show the back arrow in version prior to honeycomb. If I set getActionBar().setDisplayHomeAsUpEnabled(true) , the arrow is automatically show in version >= honeycomb. How can I do that in version prior to honey? What I also want to have is Tabs like the google+ app

Android ActionBar: show/hide tabs dynamically?

半世苍凉 提交于 2019-12-04 02:36:39
Is it possible to remove/restore the tab bar from the action bar dynamically? Up to now I did this by changing the navigation mode of the action bar. I used following code to remove and restore the tab bar: @Override public void restoreTabs() { getSupportActionBar() .setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); this.supportInvalidateOptionsMenu(); } @Override public void removeTabs() { getSupportActionBar() .setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD); this.supportInvalidateOptionsMenu(); } That works, but there is a big problem: Everytime I call setNavigationMode ,

SearchView on ActionBar: How to perform SQLite search on a custom Listview with custom adapter?

泪湿孤枕 提交于 2019-12-04 02:25:43
问题 I have a custom ListView with multiple EditText s and I would like to make the searching function work with only one of the EditText s. I was able to implement the SearchView on the ActionBar so far, but I have no idea how to search within my SQLite database using the onQueryTextChange/Submit methods. I looked ALL over the youtube and google and could not find absolutely nothing explicitly helpful on working with a custom listview. I was able to find some nice examples on working with a

Hide ActionBar title just for one activity

自古美人都是妖i 提交于 2019-12-04 02:09:40
问题 If I apply theme for whole application it hides ActionBar title successfully: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> <style name="ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid"> <item name="android:displayOptions">showHome|useLogo</item> </style> </resources> assign in manifest : <application android:name="myapp"

Custom drop-down from action item (actionbarsherlock)

ぃ、小莉子 提交于 2019-12-04 01:54:52
问题 I need a custom drop-down menu attached to an action item. I managed to do the same thing for the home icon, but it seems that it's done totally different with other action items. I know this question and answer: How to add a Dropdown item on the action bar My problem is that I want to fully customize it (I use custom fonts, will also need icons), so a submenu wouldn't suffice, I suppose. And attaching a custom Spinner as an actionLayout looks nothing like drop down. For the home icon it

How do I programmatically change ActionBar menuitem text colour?

▼魔方 西西 提交于 2019-12-04 01:17:30
I have an actionBar with multiple items, I would like to change the colour of the text when the item is clicked. Is there anyway to do this programmatically? Please provide and example or any resources. Thanks public void catalogClick(MenuItem item){ //highlight menuitem etc. } Follow this link which explains how to change menuitem text programmatically. http://developer.android.com/guide/topics/ui/actionbar.html#Style Check for android:actionMenuTextColor for defining a style resource for text. Firewall_Sudhan To change without defining a style resource, we can use SpannableString. @Override

Removing bottom shadow on ActionBar - Android

前提是你 提交于 2019-12-04 00:46:31
问题 I want to disable ActionBar shadow but only in one Activity . If I use this code it will be change in whole aplication. <style name="MyAppTheme" parent="android:Theme.Holo.Light"> <item name="android:windowContentOverlay">@null</item> </style> I tried this code, but it is not working getSupportActionBar().setElevation(0); Any suggestion...? 回答1: You can set your own style for Activity for this: <!-- Your main theme with ActionBar shadow. --> <style name="MyAppTheme" parent="android:Theme.Holo

onCreateOptionsMenu called after onResume on JB 4.2

谁说我不能喝 提交于 2019-12-03 23:50:47
I have the following fragment in my application: public class MyFragment extends SherlockListFragment implements LoaderManager.LoaderCallbacks<Cursor> { private MenuItem refresh = null; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); setHasOptionsMenu(true); //..... // NPE here refresh.setActionView(R.layout.indeterminate_progress_action); getActivity().getSupportLoaderManager().initLoader(0, null, this); } @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.refresh_menu, menu);

Remove App Icon from Navigation Drawer ActionBar Does not work

狂风中的少年 提交于 2019-12-03 23:07:01
问题 I am working on an App which has design requirement to be built as it should only have the Title on the ActionBar and not the App Icon. i tried various solutions found from StackOverflow like getActionBar().setDisplayUseLogoEnabled(false); getActionBar().setDisplayShowHomeEnabled(false); getActionBar().setIcon(null); however none of these worked so far, even i tried to make a hack/fix by making a transparent ic_launcher icon and put it into manifest.xml but it causes the App installation icon

Showing indeterminate progress in Sherlock Action Bar

对着背影说爱祢 提交于 2019-12-03 22:30:03
i`m trying to show indeterminate progress bar in ABS v. 4.0.2 by following code @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.main); getSherlock().setProgressBarIndeterminateVisibility(true); } on ICS virtual device it works fine, but progress do not shows in device with Android 2.1. what i`m doing wrong? Make sure you import com.actionbarsherlock.view.Window , not android.view.Window . Try setSupportProgressBarIndeterminateVisibility(boolean) to get backward