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

Unverified Commit 72aeb82a authored by Timi Rautamäki's avatar Timi Rautamäki Committed by Michael Bestas
Browse files

Keyguard: allow large clock on tablets

This effectively allows large clock to be shown on tablets,
while keeping it disabled for small screen devices.

Change-Id: I5bd1cdead55bd11dd4d0684ff95986cbcfdf4757
parent 47a033d3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
package com.android.keyguard;

import static com.android.systemui.shared.recents.utilities.Utilities.isTablet;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
@@ -99,7 +101,8 @@ public class KeyguardClockSwitch extends RelativeLayout {

        if (mDisplayedClockSize != null) {
            boolean landscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE;
            boolean useLargeClock = mDisplayedClockSize == LARGE && !landscape;
            boolean useLargeClock = mDisplayedClockSize == LARGE &&
                    (!landscape || isTablet(mContext));
            updateClockViews(useLargeClock, /* animate */ true);
        }
    }
@@ -302,7 +305,7 @@ public class KeyguardClockSwitch extends RelativeLayout {
        }
        boolean landscape = getResources().getConfiguration().orientation
                == Configuration.ORIENTATION_LANDSCAPE;
        boolean useLargeClock = clockSize == LARGE && !landscape;
        boolean useLargeClock = clockSize == LARGE && (!landscape || isTablet(mContext));

        // let's make sure clock is changed only after all views were laid out so we can
        // translate them properly