android-toolbar

How to make the overflow popup menu avoid obstructing the action bar?

丶灬走出姿态 提交于 2019-12-03 12:34:46
Background On my app , when I've updated to the new support library and also tried on Lollipop, I've noticed a weird issue: when clicking on the overflow button of the action bar (or even the new Toolbar class) will show the popup menu on top of the action bar, hiding other action items, as such: Here, the action items that got hidden are uninstallation and sharing. The problem I've tried to avoid this issue, by ovverriding the style of the overflow menu, but nothing has helped. Not only that, but it seems this is an intentional behavior , yet in many Google apps that were updated to have

Contextual action bar does not overlay my toolbar

时光毁灭记忆、已成空白 提交于 2019-12-03 11:41:37
I have created an activity and set toolbar as the actionbar which i have positioned at the bottom. Inside that activity, I have a listview that contain some data. Problem is, when I long press a list item, contextual action bar appears at the top instead of overlaying my toolbar which is positioned at the bottom. my activity theme <?xml version="1.0" encoding="utf-8"?> <resources> <!-- Base application theme. --> <style name="myActivityTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="windowActionBar">false</item> <item name="android:windowActionModeOverlay">true</item> </style>

Styling android search view and drop down list in actionbar

微笑、不失礼 提交于 2019-12-03 11:40:32
问题 In my app, I have a searchview that displays search suggestions. I want the dropdown/spinner and text to be a particular color. Currently the only change I've been able to make is the text color of the inputted text via the following: <style name="MyApp.AutoCompleteTextView" parent="Widget.AppCompat.Light.AutoCompleteTextView"> <item name="android:textColor">@color/white</item> <item name="android:textCursorDrawable">@null</item> <item name="android:background">@color/myBackgroundColor</item>

CollapsingToolbarLayout crash on 4.4 devices (java.lang.IllegalArgumentException: radius must be > 0)

﹥>﹥吖頭↗ 提交于 2019-12-03 11:39:50
问题 I have implemented the new style Collapsible Toolbar. I am using the same code as the example (Cheesesquare) demo app - which of course works fine on all devices. I need help figuring out what I am doing different then the sample (so my app won't crash). My app runs great on 5.0+ devices, but crashes on older devices (OS 4.4.4) with an error that I can't isolate to my code (no references to my project's classes in the stack). Seems so strange to me that this is device specific (if this was a

How do you remove an inflated menu/items from the new Lollipop Toolbar?

本小妞迷上赌 提交于 2019-12-03 10:29:22
问题 I include a v7 Toolbar in my layout. <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color/white" /> I'm inflating a menu into it with the following: mToolbar.inflateMenu(R.menu.options_add_contact); Now how do I know remove/reset it? I've tried a couple shots in the dark: inflating an empty menu mToolbar.inflateMenu(0) moolbar.setMenu(null, null) toolbar.setMenu(null, null) 回答1:

Calling Toolbar on each Activity

我们两清 提交于 2019-12-03 10:16:42
问题 My app has a toolbar that should be present on every view. Currently, I do the following in my onCreate() method for each Activity I have: Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); Does this need to be done in every onCreate() method in every Activity or is there a simpler way? Also, as a side question, how can I implement a "back" feature in the toolbar that takes the user back one action if they click it? 回答1: Create a Base class for Activity

This Activity already has an action bar supplied by the window decor (FEATURE_ACTION_BAR)

陌路散爱 提交于 2019-12-03 09:59:01
This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead This is the error I got, I searched for solutions but I didn't find how to solve it. This is my code: styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/myPrimaryColor</item> <item name="colorPrimaryDark">@color/myPrimaryDarkColor</item> <item name="colorAccent">@color/myAccentColor</item> <item name="android

How to specify dark action mode with my theme

老子叫甜甜 提交于 2019-12-03 09:41:15
问题 I know there are a couple of questions about styling the contextual action bar (ActionMode) piece of the action bar, but they don't quite seem to address what I'm after. I'm using the Toolbar with a light theme and dark action bar. The Toolbar looks like I want it, but the action mode looks like the regular dark theme. What do I need to change in my style to get the dark themed action mode (not just action bar)? It seems I should be able to do this quickly by tapping into Theme.AppCompat

How to customize the Action Bar subtitle Font?

China☆狼群 提交于 2019-12-03 09:06:53
问题 I have created an ActionBar ( android.support.v7.widget.Toolbar ) as below. <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/myToolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize"> </android.support.v7.widget.Toolbar> In my ActionBar, other than the title, I also have Subtitle. However I would like to customize the Subtitle. In customize, I mean the font size,

Toolbar : overflow menu button always showing

霸气de小男生 提交于 2019-12-03 08:56:45
Problem : after updating the support library and using Toolbars, the overflow menu button is always showing on devices with and without hardware menu button What I Need : I want the overflow menu button to show only when the device has no hardware menu button menu.xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" > <item android:id="@+id/action_settings" app:showAsAction="never" android:title="@string/action_settings"/> <item android:id="@+id/import_data" app:showAsAction="never" android:title="@string/import_data"/> in the