android-toolbar

How to set Android toolbar height?

早过忘川 提交于 2020-01-02 01:36:32
问题 I want to achieve this: What I thought was to make a Custom Toolbar with a bigger height and work with the tabhost and tabpager normally. I have implemented it, but the toolbar is showing the normal height, so it doesn't show as I want, just the top part. Is this the right approach or is it possible to set a TabHost below a Linear/Relative Layout? Because I don't need to work with it as an action bar. Relevant Code toolbar.xml <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget

toolbar not appearing in pre lollipop devices

不问归期 提交于 2020-01-01 12:25:27
问题 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

Toolbar with four icons how can set like this image?

耗尽温柔 提交于 2019-12-31 07:23:10
问题 Toolbar with four icons how can set like this image ? I want to set four icons like image in toolbar. i have make toolbar . & setting icons in menu_main.xml .But i am not getting .Why could any one help me why it is not coming ? styles.xml <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color

How to change the navigation icon color

和自甴很熟 提交于 2019-12-31 05:40:12
问题 I have a navigationView in my app and after add two lines in app style : <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> The Navigation icon color changed to black and for this problem i added this line in style : <item name="android:textColorSecondary">@android:color/white</item> Now navigation icon is white again but now i have a new problem . With above code , the title of navigation items is change color too. I didn't find a solution to this Interference

Set Toolbar Icon Colour Programmatically

蹲街弑〆低调 提交于 2019-12-30 10:44:39
问题 How can I set the colour of icons (home and overflow menu icon) in a Toolbar / AppBarLayout programmatically ? I want to change the toolbar's colour scheme for a single fragment in an activity. Setting the AppBarLayout 's background to a light colour (e.g. light gray with appBarLayout.setBackgroundResource(..); ) results in white icons and a white title which are barely visible. Its layout is as follows: <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width

How to make Toolbar not overlap other content in Android?

旧巷老猫 提交于 2019-12-30 00:53:25
问题 I am trying to develop an activity with a toolbar (the example is more or less taken from a tutorial), but the Toolbar always overlaps part of the other content. Here is a screenshot: The blue toolbar overlaps some of the other content. I have tried to search for a similar question on SO but only found something unrelated. I also tried to change the order of some elements and replaced wrap_content <-> match_parent which at most worsens the layout. I am sure I am missing something very

What is the difference between Action Bar and newly introduced Toolbar?

三世轮回 提交于 2019-12-29 02:18:27
问题 After Google introduced Material Design, I have heard about a new widget class called Toolbar. What is the Toolbar, and what is the exact difference between ActionBar and ToolBar? 回答1: I found a good explanation from Android Developers Blog post. In this release, Android introduces a new Toolbar widget. This is a generalization of the Action Bar pattern that gives you much more control and flexibility. Toolbar is a view in your hierarchy just like any other, making it easier to interleave

How to display and set click event on Back Arrow on Toolbar?

和自甴很熟 提交于 2019-12-28 03:46:12
问题 How can I set back arrow in Android toolbar and also apply click listener? 回答1: First make one 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="@color/colorPrimary" local:theme="@style

How to display and set click event on Back Arrow on Toolbar?

时光总嘲笑我的痴心妄想 提交于 2019-12-28 03:46:07
问题 How can I set back arrow in Android toolbar and also apply click listener? 回答1: First make one 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="@color/colorPrimary" local:theme="@style

Add elevation/shadow on toolbar for pre-lollipop devices

旧街凉风 提交于 2019-12-27 17:05:29
问题 I updated my android app to the new material design, but I also wanted to add some shadow or elevation to the Toolbar. There seem to be some (hacky) ways of doing it via images/9-patches, but I wonder if it can be done via the support libraries. (just like the CardView can have elevation) According to this answer on another question, this is possible by wrapping the Toolbar in a AppBarLayout , but this doesn't work for me. My layout: <?xml version="1.0" encoding="utf-8"?> <android.support