android-toolbar

How to change AppCompat v21 toolbar theme programmatically?

*爱你&永不变心* 提交于 2019-12-18 12:15:01
问题 This is my toolbar xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" app:contentInsetEnd="0dp" app:contentInsetStart="0dp" android:layout_height="@dimen/toolbar_height" app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" app:popupTheme="@style/ThemeOverlay.AppCompat.Light" android

Scrolling with Collapsing Toolbar and Tabs

人盡茶涼 提交于 2019-12-18 11:56:57
问题 I'm trying to make a layout with a CollapsingToolbarLayout which has scroll|exitUntilCollapsed flag, and a TabLayout which has scroll|enterAlways scrollFlag property. Basically I want my toolbar to be pinned and show and hide the tabs while scrolling. I've modified the cheesesquare app from https://github.com/chrisbanes/cheesesquare. Here is my layout xml; <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res

How to add Search bar with edit text in toolbar

三世轮回 提交于 2019-12-18 11:54:08
问题 I want to add search bar with edit text in toolbar like below image My toolbar.xml:- <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" android:background="?attr/colorPrimary" local:theme="@style/ThemeOverlay.AppCompat

How can I place a ProgressBar at the right of the Toolbar?

…衆ロ難τιáo~ 提交于 2019-12-18 10:52:50
问题 With the new Lollipop API, we have to use a Toolbar if we want to personalize the action bar aspect. Adding a ProgressBar to the Toolbar is as simple as adding it to the Toolbar ViewGroup, as Chris Banes said. <android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/material_green

How can I style the SearchView when using a Toolbar as an Action Bar?

社会主义新天地 提交于 2019-12-18 10:22:31
问题 I'm using a Toolbar as an Action Bar in my app using the AppCompat v21 library, as described in this post on the Android Developers Blog. I've styled the action bar using the ThemeOverlay.AppCompat.Dark.ActionBar theme so that the text is light. However, I'd like to make the Action Bar SearchView 's search suggestion popup display dark text on a light background, and I've been unable to achieve this effect. Here's the XML for my Action Bar Toolbar : <android.support.v7.widget.Toolbar xmlns

Outer Recyclerview not receiving scroll events of inner Recyclerview

杀马特。学长 韩版系。学妹 提交于 2019-12-18 04:07:16
问题 I followed this tutorial to implement the behaviors for both hiding the toolbar and the FAB when scrolled: https://mzgreen.github.io/2015/06/23/How-to-hideshow-Toolbar-when-list-is-scrolling(part3)/ I have pasted a demo of what the behavior looks like below. Now instead of those individual items within the recyclerview in the tabs holding just a textView, I have coded it so that they hold a picture (ImageView) and below it, a recyclerview showing a list of items. Hence, there is an outer

Android Design Support TabLayout overlapping content

我们两清 提交于 2019-12-18 03:56:35
问题 I am using the new TabLayout introduced in the design support library. I have the code like this: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <android.support.design.widget.CoordinatorLayout android:id="@+id/lines_coordinator" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android

android:layout_height=“?attr/actionBarSize” is not working with support:design:23.0.0' library

爱⌒轻易说出口 提交于 2019-12-18 03:11:57
问题 If I set android:layout_height="56dp" , I can see the toolbar in graphical layout. But when I set like the below, <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/purple" android:gravity="center_vertical" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </android.support.v7.widget.Toolbar

android:layout_height=“?attr/actionBarSize” is not working with support:design:23.0.0' library

喜你入骨 提交于 2019-12-18 03:11:19
问题 If I set android:layout_height="56dp" , I can see the toolbar in graphical layout. But when I set like the below, <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/purple" android:gravity="center_vertical" android:minHeight="?attr/actionBarSize" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"> </android.support.v7.widget.Toolbar

How I can place overflow menu below toolbar instead of overflow menu to overlaps the app bar

陌路散爱 提交于 2019-12-18 02:57:26
问题 I know that it is per material guideline, but i don't like it and i want it to below toolbar. please provide some info to adjust position of overflow menu. 回答1: In your main style use <item name="actionOverflowMenuStyle">@style/OverflowMenu</item> , where <style name="OverflowMenu" parent="Widget.AppCompat.PopupMenu.Overflow"> <!-- Required for pre-Lollipop. --> <item name="overlapAnchor">false</item> <item name="android:dropDownVerticalOffset">-4.0dip</item> <!-- Required for Lollipop. -->