android-toolbar

Toolbar : overflow menu button always showing

对着背影说爱祢 提交于 2019-12-04 12:51:06
问题 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"/>

toolbar not appearing in pre lollipop devices

房东的猫 提交于 2019-12-04 10:24:58
Toolbar is not appearing on pre lollipop devices. I'm using drawer layout with toolbar. The same toolbar works on other activities but not when used along with drawer layout. Activity with drawer layout and toolbar @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_home_screen); { /*supportChatImageButton = (ImageButton) findViewById(R.id.homeSupportChatImageButton); orderImageButton = (ImageButton) findViewById(R.id.homeOrderImageButton);*/ headerTextView = (TextView) findViewById(R.id.homeHeaderTextView);

CollapsingToolBarLayout - status bar scrim color doesn't change

北城余情 提交于 2019-12-04 09:57:58
问题 I updated my android studio few days ago and started working with the CoordinatorLayout and CollapsingToolbarLayout just trying stuff. It seems that the Toolbar scrim colour override the status bar initial colour and the status bar scrim colour (tried both from xml and code) initial state: started scrolling: scrolled until collapsing: So the questions are: How can I prevent the toolbar to override the status bar when collapsing (not even letting the image I'm collapsing to go above it). How

Change Custom Toolbar Text

淺唱寂寞╮ 提交于 2019-12-04 08:45:27
Unable to get the text on my toolbar to change. I have done a tone of searching but I am seeing no results. I have tried so many combinations of things but maybe something will pop out. Here is the code for the last thing I have tried for my activity. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbarCustom); TextView textView = (TextView) toolbar.findViewById(R.id.toolbarTextView); textView.setText("String"); Here is my XML Code <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"

How to animate toolbar overflow menu icon

被刻印的时光 ゝ 提交于 2019-12-04 08:23:45
Is there a way to animate the default 3-vertical-dotted menu icon on toolbar? I use toolbar as actionbar with the standard code: Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); and I also use the onCreateOptionsMenu method inside activity where I inflate my menu.xml file but I don't know how to gain more control over the overflow icon which is created automatically. What I'm most interested in is how to reference the menu icon So I can animate it. I don't care about the animation type. It can be a simple rotation animation Well, you play with the View

Set Title inToolBar from Fragment in Android

五迷三道 提交于 2019-12-04 08:19:17
问题 I have been using the latest Toolbar from AppCompatv7 lib.I have placed a textview in the ToolBar ViewGroup And I want to set a title into this Textview from the fragment in my activity.In case of a custom action bar ((ActionBarActivity)getActivity).setcustomView(..) would have done the job.But due to use of this ToolBar I am not able to use that.Also I have implemented a method in my BaseActivity that is inherited by all Activities.This BaseActivity contains my method to initialize a sliding

How to create Toolbar Tabs with ViewPager in material design

ぐ巨炮叔叔 提交于 2019-12-04 08:04:01
Anyone know anything about how tabs are done in API 21/AppCompat Toolbar? A lot of materials and articles what I found were old. They used old methods with ActionBar which don`t work now. At this moment I just created toolbar and have no ideas about toolbar tabs. So can anyone give examples or articles about how to make toolbar tabs with viewpager? Anyone know anything about how tabs are done in API 21/AppCompat Toolbar? There are no Toolbar tabs. The pattern of having tabs in the action bar was deprecated by Material Design, and when they created Toolbar , they dropped tabs. So can anyone

How to add badges on Toolbar MenuItem Icons

点点圈 提交于 2019-12-04 07:49:10
问题 I tried to find an answer for myself but couldn't find it. I need make badge on the MenuItem icon in the Toolbar, like this: How can I make this? 回答1: Here is step by step functionality: add menu.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/actionNotifications" android:icon="@drawable/ic_info_outline_white_24dp" android:menuCategory="secondary" android

FrameLayout Shown Above AppBarLayout

断了今生、忘了曾经 提交于 2019-12-04 07:30:01
I have a simple CoordinatorLayout with a AppBarLayout and FrameLayout , but the FrameLayout contents are being displayed over the AppBarLayout regardless of the layout_behavior attribute on the FrameLayout . I've tried adding that attribute elsewhere (like on my RecyclerView ), but it's the same behavior. Here's a picture to show what I mean. Activitiy Layout: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"

Push icons away when expandig searchview in android toolbar

 ̄綄美尐妖づ 提交于 2019-12-04 07:27:36
I'm facing this particular behaviour and I don't know how to fix it.. In my activity I have this toolbar: And when you click on the search icon it expands and pushes the other icon to out of the view. I want to know how could I keep the icon on the right and reduce the search view space. This is my menu layout: <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_search" android:title="@string/buscar" app:actionViewClass="android.support.v7.widget.SearchView" app:showAsAction="always" /> <item