Skip to content

Commit

Permalink
set color of title bar in recent apps
Browse files Browse the repository at this point in the history
  • Loading branch information
beriain committed Jul 10, 2018
1 parent b5ea82a commit 6e99b13
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/eu/polarclock/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import android.content.Intent;
import android.net.Uri;
import android.content.res.Configuration;
import android.os.Build;
import android.app.ActivityManager.TaskDescription;
import android.graphics.BitmapFactory;

public class MainActivity extends Activity {

Expand Down Expand Up @@ -57,4 +60,15 @@ public void onConfigurationChanged(Configuration newConfig) {
if(wv.getUrl().compareToIgnoreCase("file:///android_asset/polar-clock.html") == 0)
this.recreate();
}

@Override
public void onStart() {
super.onStart();
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
TaskDescription taskDescription = new TaskDescription(getString(R.string.app_name),
BitmapFactory.decodeResource(getResources(), R.mipmap.ic_launcher),
getColor(R.color.colorPrimary));
this.setTaskDescription(taskDescription);
}
}
}
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="splashBackground">#ffffff</color>
<color name="colorPrimary">#2ecc71</color>
</resources>

0 comments on commit 6e99b13

Please sign in to comment.