1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 10:17:18 +00:00

Theme recents

This commit is contained in:
M66B 2021-02-09 20:19:31 +01:00
parent c71da4b3a2
commit 6d8417921c

View file

@ -20,12 +20,16 @@ package eu.faircode.email;
*/
import android.Manifest;
import android.app.ActivityManager;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
@ -256,6 +260,22 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
checkAuthentication();
int colorPrimaryDark = Helper.resolveColor(this, R.attr.colorPrimaryDark);
int colorActionForeground = Helper.resolveColor(this, R.attr.colorActionForeground);
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(colorActionForeground);
d.draw(canvas);
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription(null, bm, colorPrimaryDark);
setTaskDescription(td);
boolean navbar_colorize = prefs.getBoolean("navbar_colorize", false);
if (navbar_colorize) {
Window window = getWindow();