Android 5.0: how to change the color of the name of the latest applications?

I am using AppCompat and my theme is expanding Theme.AppCompat.Light.DarkActionBar .

When in Android 5 Lollipop and I press the button for the latest applications, my application appears with the title dark instead of the white title in the ActionBar.

When I enter the application, everything looks great.

What can I do to change the title color in the latest apps view?

EDIT : Just realized that if I use a darker colorPrimary , the title turns white. I still need a way to force a white caption with the original color.

enter image description here

+55
android android-5.0-lollipop appcompat android-theme
Nov 13 '14 at 1:28
source share
3 answers

You cannot force the color of the text; it is automatically generated (white / black) based on the colorPrimary color.

+45
Dec 30 '15 at 9:56
source share

I also studied this, and in the best way I could find (suggestion from MrEngineer13) so that my recents application color was the 600th value of my primary color :

 Bitmap bm = BitmapFactory.decodeResource(getResources(), app_icon); TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.primary_600)); MainActivity.setTaskDescription(taskDesc); 

If you look closely at the Android 5.0 contacts app, you'll see that Google themselves are doing something similar:

Screenshot Android contacts

Therefore, I believe that it is impossible to change the color of the name, but Android will choose a good one for you. (which will also allow Android to change it for reasons of availability, ...)

+32
Dec 30 '15 at 9:52
source share

To change the color / name / icon, you just need to use the following:

 TaskDescription tDesc = new TaskDescription(mTitle, mIcon, mColor); MainActivity.setTaskDescription(tDesc); 
+21
Nov 13 :
source share



All Articles