Setting header color of app in overview (recent apps) screen

I’m adding some Lollipop-only styling to an app.

I want to change color of header in the overview screeen like Gmail has here (red instead of the default grey) :

Is there and ionic or Cordova plugin able to accomplish this?

Unfortunately there are no plugins to do that at the moment.

I haven’t tried this yet … but it should work.

You can do it manually by modifying the MainActivity.java file and creating a onResume() function and adding the following code to it:

TaskDescription tDesc = new TaskDescription(mTitle, mIcon, mColor);
MainActivity.setTaskDescription(tDesc);

Note that you have to assign values to all the variables used, and probably add a color to your resources XML files to be used.

Also backup your modified files so you can restore them at any time if your ionic build/run android commands ever reset those files for you.

I created a plugin called HeaderColor for cordova (only for Android devices) that does what you want. I hope it helps you.


Installation:

cordova plugin add cordova-plugin-headercolor

Usage:

window.plugins.headerColor.tint("#becb29");

Result:

enter image description here


###Github:

2 Likes

@tomloprod, thank you, it works like a charm.

1 Like

Thank you, it still working 2022.

1 Like