android-toolbar

displaying my toolbar image as background to status bar effecting navigation bar in android

你说的曾经没有我的故事 提交于 2020-08-08 05:37:21
问题 I want my toolbar to take the space of status bar and the image used for it be the background of the status bar and I successfully do that with this code inside my activity // for using status bar space if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } the problem is this code make my activity layout take the full screen even the space with navigation bar so how

displaying my toolbar image as background to status bar effecting navigation bar in android

為{幸葍}努か 提交于 2020-08-08 05:37:07
问题 I want my toolbar to take the space of status bar and the image used for it be the background of the status bar and I successfully do that with this code inside my activity // for using status bar space if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } the problem is this code make my activity layout take the full screen even the space with navigation bar so how

How to find out if mobile has a notch or not

北城余情 提交于 2020-08-05 04:13:09
问题 I need to modify the app's toolbar if the notch is present. Right now that notch hides bit of content in toolbar. if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP || Build.VERSION.SDK_INT == Build.VERSION_CODES.M) { setTheme(R.style.AppTheme_NoActionBarHello); getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); SystemBarTintManager tintManager = new SystemBarTintManager(this); tintManager.setStatusBarTintEnabled(true); tintManager.setTintColor(ContextCompat

Add custom view to the right of toolbar

血红的双手。 提交于 2020-08-01 05:34:48
问题 I am trying to achieve this(A timer in toolbar with red background): I am trying to add customView in toolbar . It always end's up being on extreme left just beside the back arrow. Like the text YP in image below is a custom Textview added to toolbar.. The code for toolbar : <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.Toolbar android:id="@+id/base_activity_toolbar" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android

Android actionLayout not showing with Toolbar

时光总嘲笑我的痴心妄想 提交于 2020-07-30 04:36:06
问题 I'm trying to show custom layout as an item in options menu. And this is what I have done so far <item android:id="@+id/action_profile" android:orderInCategory="100" android:title="Profile" android:actionLayout="@layout/layout_menu_profile" app:showAsAction="never" /> I tried app:actionLayout="@layout/layout_menu_profile" as well as per this SO link but still it shows only title - Profile I have created new project through Android Studio 1.5 with Blank Activity. with minSDK = 15 and targetSDK

Toolbar TitleTextColor not changing in dark mode

别说谁变了你拦得住时间么 提交于 2020-07-22 06:39:15
问题 I'm integrating Dark Mode , i have Collapsing toolbar and toolbar which are wrapped in an appbarlayout , the issue is when i try to set the toolbar title color into white when dark mode is set , it is not working meanwhile in light mode , the color shows accordingly , i tried almost everything but i don't know exactly what is happening , i have color and color night folders and i set up the color for both and added it to to my toolbar but it didn't change anything , if any one could help , i

Cannot get Switch menu item because R.id.* is different from menu items' internal ids

半城伤御伤魂 提交于 2020-07-10 10:28:38
问题 I am not able to use setOnCheckedChangeListener because getting a Switch menu item by id won't work as the resource id is different from the menu id. This is what I've got: Toolbar <?xml version="1.0" encoding="utf-8"?> <androidx.appcompat.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" xmlns:app="http://schemas.android.com/apk/res-auto" android:theme="@style/Theme.AppCompat.Light.DarkActionBar"

Text background issue on Toolbar

三世轮回 提交于 2020-06-26 03:50:16
问题 When adding some alpha to my Toolbar background color, I notice there is a background applied to the title's TextView: Here is my layout: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="#0099cc"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width=

Text background issue on Toolbar

懵懂的女人 提交于 2020-06-26 03:50:07
问题 When adding some alpha to my Toolbar background color, I notice there is a background applied to the title's TextView: Here is my layout: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android:background="#0099cc"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width=