i am trying to achieve theme like this but i can't find any help about it i am trying to get white action bar with black icons and text and status bar with black icons and white background I am changing color pragmatically but I think there is some proper theme to get something like this i have also tried material.theme.light
Asked
Active
Viewed 2,195 times
-1

AskNilesh
- 67,701
- 16
- 123
- 163

Mateen Chaudhry
- 631
- 12
- 32
-
Are you using custom toolbar ? @Mateen – Abhishek kumar Jan 22 '19 at 06:21
-
no android's tool bar – Mateen Chaudhry Jan 22 '19 at 06:21
-
1what's the problem in changing `colorPrimary` and `colorPrimaryDark` to white to achieve your desired theme ? – Vivek Mishra Jan 22 '19 at 06:22
-
@VivekMishra if i change colorPrimaryDark to white status bar icons remains white and cant be seen thats problem in it – Mateen Chaudhry Jan 22 '19 at 06:23
-
How about this https://i.stack.imgur.com/auSbY.png – AskNilesh Jan 22 '19 at 06:24
-
@NileshRathod see my above comment – Mateen Chaudhry Jan 22 '19 at 06:24
-
https://stackoverflow.com/questions/46131907/how-to-change-status-bar-icon-color-in-android. That too is possible , check the link – Vivek Mishra Jan 22 '19 at 06:28
-
Possible duplicate of [Android statusbar icons color](https://stackoverflow.com/questions/30075827/android-statusbar-icons-color) – karan Jan 22 '19 at 06:30
-
@VivekMishra i know this can be done pragmatically i am asking if there is any proper theme – Mateen Chaudhry Jan 22 '19 at 06:30
-
you haven't mention that in your question. – Vivek Mishra Jan 22 '19 at 06:32
1 Answers
0
Here is your Solution
Try this
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white">
<android.support.v7.widget.Toolbar
android:id="@+id/ar_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="exitUntilCollapsed"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Nilesh Rathod"
android:textStyle="bold" />
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
Theme
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@android:color/white</item>
<item name="colorPrimaryDark">@android:color/white</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorControlNormal">#FFFFFF</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:statusBarColor">@android:color/white</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
<item name="android:windowTranslucentNavigation">false</item>
<item name="android:navigationBarColor">#000</item>
</style>
OUTPUT

AskNilesh
- 67,701
- 16
- 123
- 163
-
its working fine but menu items icons color is still white how can black them also? – Mateen Chaudhry Jan 22 '19 at 07:21
-
its `CoordinatorLayout` but menu items icons color is still white – Mateen Chaudhry Jan 22 '19 at 07:23
-
-
-
@MateenChaudhry have u added this `
- true
` in your theme because for me its working fine – AskNilesh Jan 22 '19 at 10:18 -
its working fine i am saying about toolbar's icon like settings icons its color is still white – Mateen Chaudhry Jan 22 '19 at 10:24
-
@MateenChaudhry `toolbar's icon like settings icons its color is still white` can u share that code how u added icon in toolbar – AskNilesh Jan 22 '19 at 10:25
-
-