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

Commit bdf9641f authored by axfordjc's avatar axfordjc Committed by Jonathon Axford
Browse files

Wider notifications on landscape lockscreen

Guarded by flag lockscreen.enable_landscape, skinny notifications are no longer used on small landscape screens so notifications will take up the full width of the notification stack. This is required for small landscape lockscreen feature.

Bug: 296571001
Bug: 293252410

Test: NotificationStackScrollLayoutTest
Change-Id: I469ab15eed507ef2c4e4d1b8c4d565dd44051a2f
parent 3b61ee74
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -569,6 +569,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
    private boolean mShouldUseSplitNotificationShade;
    private boolean mHasFilteredOutSeenNotifications;
    @Nullable private SplitShadeStateController mSplitShadeStateController = null;
    private boolean mIsSmallLandscapeLockscreenEnabled = false;

    /** Pass splitShadeStateController to view and update split shade */
    public void passSplitShadeStateController(SplitShadeStateController splitShadeStateController) {
@@ -628,6 +629,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        super(context, attrs, 0, 0);
        Resources res = getResources();
        FeatureFlags featureFlags = Dependency.get(FeatureFlags.class);
        mIsSmallLandscapeLockscreenEnabled = featureFlags.isEnabled(
                Flags.LOCKSCREEN_ENABLE_LANDSCAPE);
        mDebugLines = featureFlags.isEnabled(Flags.NSSL_DEBUG_LINES);
        mDebugRemoveAnimation = featureFlags.isEnabled(Flags.NSSL_DEBUG_REMOVE_ANIMATION);
        mSensitiveRevealAnimEndabled = featureFlags.isEnabled(Flags.SENSITIVE_REVEAL_ANIM);
@@ -1054,6 +1057,17 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mOverflingDistance = configuration.getScaledOverflingDistance();

        Resources res = context.getResources();
        boolean useSmallLandscapeLockscreenResources = mIsSmallLandscapeLockscreenEnabled
                && res.getBoolean(R.bool.is_small_screen_landscape);
        // TODO (b/293252410) remove condition here when flag is launched
        //  Instead update the config_skinnyNotifsInLandscape to be false whenever
        //  is_small_screen_landscape is true. Then, only use the config_skinnyNotifsInLandscape.
        if (useSmallLandscapeLockscreenResources) {
            mSkinnyNotifsInLandscape = false;
        } else {
            mSkinnyNotifsInLandscape = res.getBoolean(
                    R.bool.config_skinnyNotifsInLandscape);
        }
        mGapHeight = res.getDimensionPixelSize(R.dimen.notification_section_divider_height);
        mStackScrollAlgorithm.initView(context);
        mAmbientState.reload(context);
@@ -1065,7 +1079,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        mBottomPadding = res.getDimensionPixelSize(R.dimen.notification_panel_padding_bottom);
        mMinimumPaddings = res.getDimensionPixelSize(R.dimen.notification_side_paddings);
        mQsTilePadding = res.getDimensionPixelOffset(R.dimen.qs_tile_margin_horizontal);
        mSkinnyNotifsInLandscape = res.getBoolean(R.bool.config_skinnyNotifsInLandscape);
        mSidePaddings = mMinimumPaddings;  // Updated in onMeasure by updateSidePadding()
        mMinInteractionHeight = res.getDimensionPixelSize(
                R.dimen.notification_min_interaction_height);
+1 −0
Original line number Diff line number Diff line
@@ -154,6 +154,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        assertFalse(Flags.NSSL_DEBUG_REMOVE_ANIMATION.getDefault());
        mFeatureFlags.set(Flags.NSSL_DEBUG_LINES, false);
        mFeatureFlags.set(Flags.NSSL_DEBUG_REMOVE_ANIMATION, false);
        mFeatureFlags.set(Flags.LOCKSCREEN_ENABLE_LANDSCAPE, false);

        // Register the feature flags we use
        // TODO: Ideally we wouldn't need to set these unless a test actually reads them,