Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d98a945d authored by Beth Thibodeau's avatar Beth Thibodeau
Browse files

Tint screenshot frame black in dark mode

Fixes: 123034259
Test: visual, demo at https://photos.app.goo.gl/AcyoYfZu6FX5qkaPA
Change-Id: I1834f068953a44deb266111ad668589fc8ade29f
parent 4808233a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -42,9 +42,11 @@ import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorMatrix;
import android.graphics.ColorMatrixColorFilter;
import android.graphics.Matrix;
@@ -743,6 +745,15 @@ class GlobalScreenshot {
                return (x - flashDurationPct) / (1f - flashDurationPct);
            }
        };

        Resources r = mContext.getResources();
        if ((r.getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK)
                == Configuration.UI_MODE_NIGHT_YES) {
            mScreenshotView.getBackground().setTint(Color.BLACK);
        } else {
            mScreenshotView.getBackground().setTintList(null);
        }

        ValueAnimator anim = ValueAnimator.ofFloat(0f, 1f);
        anim.setDuration(SCREENSHOT_DROP_IN_DURATION);
        anim.addListener(new AnimatorListenerAdapter() {