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

Commit 7609de36 authored by wilsonshih's avatar wilsonshih
Browse files

Loose the translucent condition when estimate splash screen bg color.

Only use the System background color if more than half of pixels in the
window background drawable are translucent. Increase the tolerance of
gradient drawable object.

Bug: 294505626
Test: cold launch sample app, verify splash screen draw with dominate
color.

Change-Id: I46c88a1bf2c5fb7d5152d147f035bb172b3f9f78
parent eb277dab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -385,8 +385,8 @@ public class SplashscreenContentDrawer {
    private static int estimateWindowBGColor(Drawable themeBGDrawable) {
        final DrawableColorTester themeBGTester = new DrawableColorTester(
                themeBGDrawable, DrawableColorTester.TRANSLUCENT_FILTER /* filterType */);
        if (themeBGTester.passFilterRatio() != 1) {
            // the window background is translucent, unable to draw
        if (themeBGTester.passFilterRatio() < 0.5f) {
            // more than half pixels of the window background is translucent, unable to draw
            Slog.w(TAG, "Window background is translucent, fill background with black color");
            return getSystemBGColor();
        } else {