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

Commit 7e93b286 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Offset bounds by card top padding to align lockscreen/launcher...

Merge "Offset bounds by card top padding to align lockscreen/launcher smartspaces." into tm-dev am: 2274df1e am: 7065c8e2 am: 1d755052

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18199686



Change-Id: I1c58785cea054c7b971ed5c63ff7e4b4589d2f4a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents b691f06e 1d755052
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -134,6 +134,12 @@ public interface BcSmartspaceDataPlugin extends Plugin {
         * Get the index of the currently selected page.
         */
        int getSelectedPage();

        /**
         * Return the top padding value from the currently visible card, or 0 if there is no current
         * card.
         */
        int getCurrentCardTopPadding();
    }

    /** Interface for launching Intents, which can differ on the lockscreen */
+12 −0
Original line number Diff line number Diff line
@@ -409,7 +409,19 @@ class KeyguardUnlockAnimationController @Inject constructor(
        if (willUnlockWithSmartspaceTransition) {
            lockscreenSmartspaceBounds = Rect().apply {
                lockscreenSmartspace!!.getBoundsOnScreen(this)

                // The smartspace container on the lockscreen has left and top padding to align it
                // with other lockscreen content. This padding is inside the bounds on screen, so
                // add it to those bounds so that the padding-less launcher smartspace is properly
                // aligned.
                offset(lockscreenSmartspace!!.paddingLeft, lockscreenSmartspace!!.paddingTop)

                // Also offset by the current card's top padding, if it has any. This allows us to
                // align the tops of the lockscreen/launcher smartspace cards. Some cards, such as
                // the three-line date/weather/alarm card, only have three lines on lockscreen but
                // two on launcher.
                offset(0, (lockscreenSmartspace
                        as? BcSmartspaceDataPlugin.SmartspaceView)?.currentCardTopPadding ?: 0)
            }
        }

+2 −0
Original line number Diff line number Diff line
@@ -153,6 +153,8 @@ class DreamSmartspaceControllerTest : SysuiTestCase() {
        override fun setMediaTarget(target: SmartspaceTarget?) {}

        override fun getSelectedPage(): Int { return 0; }

        override fun getCurrentCardTopPadding(): Int { return 0; }
    }

    /**
+4 −0
Original line number Diff line number Diff line
@@ -603,6 +603,10 @@ class LockscreenSmartspaceControllerTest : SysuiTestCase() {
            override fun getSelectedPage(): Int {
                return -1
            }

            override fun getCurrentCardTopPadding(): Int {
                return 0
            }
        })
    }
}