android-toolbar

Create Linear gradient from top to bottom to status bar and toolbar in android

杀马特。学长 韩版系。学妹 提交于 2021-02-19 05:32:18
问题 I want to add a Linear gradient color to Status Bar and Toolbar. I am able to add gradient to status bar and toolbar with angle of 0 degree which shows left to right gradient color (pink on left and purple on right) . But I want the gradient flow with angle of 90 degree which is top to bottom or bottom to top (eg: top pink and bottom purple) .I tried but I ended up with this and this.Here status bar and toolbar is being separated, I want both status bar and toolbar to have same gradient color

How to change toolbar back button icon in android material components

坚强是说给别人听的谎言 提交于 2021-02-19 05:11:51
问题 I would like to change the default navigate up icon (back button icon) to my custom icon. I not using a drawer, just a simple toolbar and material components Is this possible? 回答1: If you are using a Toolbar to change the icon just use: Toolbar toolbar = findViewById(R.id.xxx); toolbar.setNavigationIcon(R.drawable.xxxx4); setSupportActionBar(toolbar); If you are using the ActionBar you can use: getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator(R

How to change toolbar back button icon in android material components

被刻印的时光 ゝ 提交于 2021-02-19 05:10:07
问题 I would like to change the default navigate up icon (back button icon) to my custom icon. I not using a drawer, just a simple toolbar and material components Is this possible? 回答1: If you are using a Toolbar to change the icon just use: Toolbar toolbar = findViewById(R.id.xxx); toolbar.setNavigationIcon(R.drawable.xxxx4); setSupportActionBar(toolbar); If you are using the ActionBar you can use: getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeAsUpIndicator(R

Android toolbar elevation when scrolling

泪湿孤枕 提交于 2021-02-17 08:44:56
问题 I try to implement a search bar like in google maps android app: When the recycler view is in its initial state, the toolbar has no elevation. Only when the users starts scrolling the elevation becomes visible. And the search bar (toolbar) never collapses. Here is what I tried to replicate this: <android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.v7.widget.RecyclerView

colorControlNormal not setting toolbar back arrow color

℡╲_俬逩灬. 提交于 2021-02-11 12:50:15
问题 I'm trying to change the color of my toolbar's back arrow to purple, but the color I set for the colorControlNormal attribute of my custom toolbar theme isn't working. The toolbar should be purple but it remains white. I've checked all over my layout's xml and the app Manifest to see if my toolbar theme is being overidden somewhere but i don't see this. What's the problem? styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!--

Android ActionBar vs ToolBar

百般思念 提交于 2021-02-11 00:51:01
问题 Can you make Android new Toolbar to be shown with shadow like you could do with the old ActionBar? Please refer to the image: Left is ActionBar and you can see it looks "floating" with shadow while the right one is ToolBar, how can you show it the same? 回答1: Use attibute android:elevetion=4dp on toolbar. 来源: https://stackoverflow.com/questions/29829746/android-actionbar-vs-toolbar

Android ActionBar vs ToolBar

戏子无情 提交于 2021-02-11 00:49:12
问题 Can you make Android new Toolbar to be shown with shadow like you could do with the old ActionBar? Please refer to the image: Left is ActionBar and you can see it looks "floating" with shadow while the right one is ToolBar, how can you show it the same? 回答1: Use attibute android:elevetion=4dp on toolbar. 来源: https://stackoverflow.com/questions/29829746/android-actionbar-vs-toolbar

Android toolbar icon color not so bright

廉价感情. 提交于 2021-02-05 10:40:59
问题 I am developing an app in which there are multiple tabs with icon without any title. The problem is that the icons are not looking as bright it should. I used white color(FFFFFF) in creating icon assets. Still it doesn't looks so good. The pic above shows Facebook Messenger and my App. There is difference between color(although both are white). Any suggestion will be appreciated. 回答1: Yeah I have experienced similar problem. I think it is fault of android asset studio when I create icon with

Android toolbar icon color not so bright

怎甘沉沦 提交于 2021-02-05 10:40:53
问题 I am developing an app in which there are multiple tabs with icon without any title. The problem is that the icons are not looking as bright it should. I used white color(FFFFFF) in creating icon assets. Still it doesn't looks so good. The pic above shows Facebook Messenger and my App. There is difference between color(although both are white). Any suggestion will be appreciated. 回答1: Yeah I have experienced similar problem. I think it is fault of android asset studio when I create icon with

Adding text below/above a switch button in Android menu icon

浪尽此生 提交于 2021-01-29 04:53:57
问题 I am trying to add a text below/above this switch item that is in my Toolbar to indicate functionality of the switch. I was wondering if there is a layout tag I could use to add a text below/above the button. Or is there some other method I have to use. menu_main.xml <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=".MainActivity"> <item android:id="@+id/edit"