Tag: android-actionbar

What is the duration of native actionbar.show() and hide() animation

I want to do some animation when the actionbar is animating. However, I don’t know the duration of actionbar animation.

ActionBar Menu Items disappear in NestedFragments

Since android 4.2 now support NestedFragment , and added it to support v13. I use this NestedFragment on a classic situation : Create fragmentA that can swipe left and right and consume a majority of the screen space, and insert fragmentB and fragmentC into each fragment page. My Problem is the MenuItem I create in […]

Android align menu items to left in action bar

i have action bar in my application that displays menu items defined in my res/menu/activity_main.xml My menu items are aligned to right on action bar. I want them to be aligned to left. Only solutions i found for this used custom action bar, like this one: Positioning menu items to the left of the ActionBar […]

searchview not closing correctly on FIRST back press (it's only loosing focus)

I have to press the backbutton twice, to close the SearchView. Why? On the first press, the SearchViewonly looses focus… Setting setOnKeyListener on SearchView does not work either… Btw, I’m using the ABS implementation… My code is simple and looks like the following: mMenuItemSearch = menu.findItem(R.id.search); mSearchView = new SearchView(getSupportActionBar().getThemedContext()); mMenuItemSearch.setActionView(mSearchView); mSearchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { public […]

How do I programmatically change ActionBar menuitem text colour?

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. }

How to change background color of action bar without increasing min sdk?

As we know, a colored background of action bar permitted in sdk level 11, watch this. But there are some applications with colored action bar that have min sdk lower than 11. For example Whatsapp has green action bar but has min sdk:7 WhatsApp FAQ, or the Telegram application has min sdk:8 Telegram FAQ, but […]

How to add actions to the top part of a split ActionBar

If an Android ActionBar is split into a top and a bottom portion using android:uiOptions=”splitActionBarWhenNarrow” in the Manifext.xml, is there a way to force some of the actions to be displayed in the top portion instead of having them all at the bottom?

Android create custom overflow menu item

I want to create a custom overflow menu item in my ActionBar in addition at the Setting item like described in the image below: But if there is few space in the ActionBar I don’t want that the Item1 and Item2 go into the Setting item as overflow, but into “my overflow item”. this is […]

Android Action Bar Tab with scrollview made duplicate view after orientation change

I have a very simple code where I use Action Bar with tab fragments. It works fine after load, but after orientation change it goes crazy. The old fragment also visible (why?). Sorry for Hungarian texts on the image, but I hope it doesn’t matter. I attach the code, maybe it helps to solve this […]

Make fragments full screen programmatically

I have a ViewPager and FragmentPagerAdapter set up in one activity with 3 fragments. All fragments are loaded simultaneously and are kept in memory using mPager.setOffscreenPageLimit(2); One of these fragments hosts a camera preview that I would like to make full screen, with no status bar or action bar. The other fragments require that the […]

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