android-actionbar

Update ActionBar title after leaving fragment

牧云@^-^@ 提交于 2019-12-10 11:19:19
问题 When my MainActivity is launched my ActionBar shows the app title. Once you navigate to a fragment through the nav drawer, the title is changed to match the fragment... however, once you navigate back using the back button, the title is left untouched and still has the title of the fragment. I am looking to change it back to the application Title. I have tried to use the onResume() method in the MainActivity.java but it appears that does not get called once you leave a fragment. @Override

Changing Actionbar Tab Text Size in AppCompact Theme

妖精的绣舞 提交于 2019-12-10 10:56:13
问题 I've search around and tried several ways to change the Actionbar Tab text style. I would like the bigger text size for that "NOW SHOWING" text. Here's my Theme. <style name="Theme.Tabtheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="actionBarItemBackground">@drawable/selectable_background_tabtheme</item> <item name="popupMenuStyle">@style/PopupMenu.Tabtheme</item> <item name="dropDownListViewStyle">@style/DropDownListView.Tabtheme</item> <item name="actionBarTabStyle">

How to add subtitle to spinner in the action bar

你说的曾经没有我的故事 提交于 2019-12-10 10:49:17
问题 I have the following I am using action bar and spinner but what I want to do to add a subtitle to be like City subtitles => All , City 1 , City 2 like this image I have the following menu xml file <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/filter1" android:showAsAction="ifRoom" android:orderInCategory="1" android:actionViewClass="android.widget.Spinner" /> <item android:id="@+id/filter2" android:showAsAction=

How to handle drag-to-select of sub-menu items on Kitkat?

…衆ロ難τιáo~ 提交于 2019-12-10 10:44:16
问题 Background I have an app which has sub menus in the action bar, for selecting the sorting type. It works really well if you just tap the action items. Here's how a submenu looks like on the actionBar: The code To make it easy to understand what I did, here's a short, simple version of just the sub menu part: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context="com

Use AppCompat Library for ActionBar support

落爺英雄遲暮 提交于 2019-12-10 10:10:22
问题 I need to implement the actionbar in Android 2.x I've tried with this post and setup the support library as mentioned in thisofficial article. Here are the steps that I've followed for implement the ActionBar using the appcompat support library: First, I create the project with the following configuration (I don't create an icon and a default activity): Minimum Required SDK: API 10: Android 2.3.3 (Gingerbread) Target SDK: API 19: Android 4.4 Compile with: API 10: Android 2.3.3 (Gingerbread)

Change Android ShareActionProvider background color when pressed

≡放荡痞女 提交于 2019-12-10 10:05:03
问题 My app's primary color is some kind of yellow. The ShareActionProvider in the action bar has a kind of spinner that when pressed shows the default holo blue color. To make the action bar style coherent, I need to have the share button background go yellow when pressed. How to achieve that? I am using the standard action bar (no compatibility or sherlock) That one does not work: shareMenuItem.getActionView().setBackgroundResource(R.drawable.spinner_background_ab_webcamhd_custom_ab); And none

ActionBarSherlock - Share Content icon issue

前提是你 提交于 2019-12-10 09:59:00
问题 I am using ActionBarSherlock and have implemented ShareActionProvider . When a user selects an app to share content with, eg Twitter , the actionbar displays a Twitter icon next to the Share button icon. This stays there forever. Does anybody know how to disable the application icon from appearing next to the Share button? 回答1: Found the answer: Implement OnShareTargetSelectedListener and set it on the ShareActionProvider public void onCreateOptionsMenu(Menu menu){ .... actionProvider

How to set a custom color for the popup of action items, including of the overflow menu?

∥☆過路亽.° 提交于 2019-12-10 09:58:59
问题 Background I'm working on adding some material design style for an app, so I've chosen a different color for the action bar and status bar. The problem For this, the theme of the app is of "Theme.AppCompat.Light.DarkActionBar", and added this to hide the action bar as I need to handle it as a toolbar: theme I've used: <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar"> <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> <item name=

Reusing Action Bar in all activities of application

十年热恋 提交于 2019-12-10 09:42:47
问题 I have created a MenuActivity which is having an Action Bar and an Split Action Bar. I want to use this actionbar and splitactionbar view for all activities in my application. I am a newbie to android so can somebody guide me stepwise about this. Also I am trying to put the search icon on actionbar which is right now appearing on SplitActionBar. I have four icons on SplitActionBar and i want to show search icon on the actionbar not on the SplitActionBar. The search icon is a SearchView item

Fragment disappears from backstack

狂风中的少年 提交于 2019-12-10 09:33:54
问题 Why does FragmentTwo disappear from the backstack in the following situation: My app has a Fragment called FragmentOne in an Activity . FragmentOne holds a Button . When clicked, it launches FragmentTwo , which is added to the Fragment backstack. FragmentTwo has a Button , which when clicked adds two tabs to the ActionBar linked to two Fragments , FragmentThree and FragmentFour . FragmentThree is visible. If I now click the back button, I expected to see FragmentTwo . Instead, I see