|
|
@ -339,16 +339,6 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
prefs.registerOnSharedPreferenceChangeListener(this);
|
|
|
|
prefs.registerOnSharedPreferenceChangeListener(this);
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Drawable d = getDrawable(R.drawable.baseline_mail_24);
|
|
|
|
|
|
|
|
Bitmap bm = Bitmap.createBitmap(
|
|
|
|
|
|
|
|
d.getIntrinsicWidth(),
|
|
|
|
|
|
|
|
d.getIntrinsicHeight(),
|
|
|
|
|
|
|
|
Bitmap.Config.ARGB_8888);
|
|
|
|
|
|
|
|
Canvas canvas = new Canvas(bm);
|
|
|
|
|
|
|
|
d.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
|
|
|
|
|
|
|
d.setTint(Color.WHITE);
|
|
|
|
|
|
|
|
d.draw(canvas);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
boolean task_description = prefs.getBoolean("task_description", true);
|
|
|
|
boolean task_description = prefs.getBoolean("task_description", true);
|
|
|
|
int colorPrimary = (task_description
|
|
|
|
int colorPrimary = (task_description
|
|
|
|
? Helper.resolveColor(this, androidx.appcompat.R.attr.colorPrimaryDark)
|
|
|
|
? Helper.resolveColor(this, androidx.appcompat.R.attr.colorPrimaryDark)
|
|
|
@ -358,6 +348,18 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
|
|
|
colorPrimary = ColorUtils.setAlphaComponent(colorPrimary, 255);
|
|
|
|
colorPrimary = ColorUtils.setAlphaComponent(colorPrimary, 255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
double lum = ColorUtils.calculateLuminance(colorPrimary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Drawable d = getDrawable(R.drawable.baseline_mail_24);
|
|
|
|
|
|
|
|
Bitmap bm = Bitmap.createBitmap(
|
|
|
|
|
|
|
|
d.getIntrinsicWidth(),
|
|
|
|
|
|
|
|
d.getIntrinsicHeight(),
|
|
|
|
|
|
|
|
Bitmap.Config.ARGB_8888);
|
|
|
|
|
|
|
|
Canvas canvas = new Canvas(bm);
|
|
|
|
|
|
|
|
d.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
|
|
|
|
|
|
|
d.setTint(lum > LUMINANCE_THRESHOLD ? Color.BLACK : Color.WHITE);
|
|
|
|
|
|
|
|
d.draw(canvas);
|
|
|
|
|
|
|
|
|
|
|
|
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(
|
|
|
|
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(
|
|
|
|
null, bm, colorPrimary);
|
|
|
|
null, bm, colorPrimary);
|
|
|
|
setTaskDescription(td);
|
|
|
|
setTaskDescription(td);
|
|
|
|