1

I cannot find how to change the text color of the overview toolbar on Android.. :

On Navigation menu click

I tried this one :

android:theme="@style/AppTheme"

<style name="AppBlankTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme" parent="AppBlankTheme">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">true</item>
    <item name="android:textColorPrimary">@android:color/white</item>
    <item name="android:textColorSecondary">@android:color/white</item>
</style>

I want to change the color of the title ("Sharezone") and the close button of the overview toolbar to white.

Thanks.

------------------------- EDIT -------------------------------------------

After a lot of failed solutions, here's my entire code :

style.xml

<style name="AppBlankTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme" parent="AppBlankTheme">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:textColorTertiary">@color/grey_300</item>
</style>

AndroidManifest.xml

<application
    ...
    android:theme="@style/AppTheme">
    <activity
        android:name=".MainActivity"
        ...
        android:theme="@style/AppTheme">
    </activity>
</application>

And here's the toolbar I use in Activity :

<android.support.v7.widget.Toolbar android:id="@+id/toolbar"
    android:layout_width="match_parent" android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary">
    <TextView
        android:id="@+id/toolbar_app_name"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="@string/app_name"
        android:textSize="30sp"
        android:gravity="center_horizontal|center_vertical"
        android:textColor="@color/grey_300"/>
</android.support.v7.widget.Toolbar>

enter image description here

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
user3185672
  • 69
  • 1
  • 7
  • check out this link http://stackoverflow.com/questions/33655908/setting-android-toolbar-background-and-text-colors-in-android-studio-1-4-1 – Girish May 11 '17 at 13:21
  • check if you apply "AppTheme" and not "AppBlankTheme" to the layout of "Sharezone". – Johny May 11 '17 at 13:47

3 Answers3

0

This is because of Theme.which you have set in your style style name="AppBlankTheme" parent="Theme.AppCompat.Light.DarkActionBar"

please use this Theme

style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"

Now your App's dark theme will be removed

Ghanshyam Sharma
  • 451
  • 9
  • 21
0

#. Seems your themes are OK. In AndroidManifest.xml file, apply AppTheme to your desired Activity.

AndroidManifest.xml

    <activity
        android:name=".YourActivity"
        android:theme="@style/AppTheme" />

#. If you are using Toolbar in your layout XML, then you can change its title color programmatically:

Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar)
toolbar.setTitleTextColor(Color.WHITE);

UPDATE:

As per your updated question, seems you are using custom Toolbar. To change title "Sharezone" color, you have to change the background color of TextView (toolbar_app_name).

<android.support.v7.widget.Toolbar 
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="?attr/colorPrimary">

    <TextView
        android:id="@+id/toolbar_app_name"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:text="@string/app_name"
        android:textSize="30sp"
        android:gravity="center_horizontal|center_vertical"
        android:textColor="#FFFFFF"/>
</android.support.v7.widget.Toolbar>

Hope this will help~

Ferdous Ahamed
  • 21,438
  • 5
  • 52
  • 61
0

You can do that by XML, if your activity is called MainActivity go to the res/layout/activity_main, go to design and press/select the action bar, then to properties on the right and select titleTextColor and change tot he required colour.

select title bar

Choose colour here: Choose colour

Ajeeli
  • 325
  • 1
  • 3
  • 16