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

Commit 0a916863 authored by William Xiao's avatar William Xiao
Browse files

Apply ktfmt updates

Bug: 363239820
Test: N/A, just formatting
Flag: NONE  just formatting
Change-Id: Id4a4d80adfae20f2195138236f2e046d557671a6
parent 9637b6d9
Loading
Loading
Loading
Loading
+14 −21
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ constructor(

        fun dispatchTouchEvent(
            ev: MotionEvent?,
            disallowInterceptConsumer: Consumer<Boolean>?
            disallowInterceptConsumer: Consumer<Boolean>?,
        ): Boolean {
            disallowInterceptConsumer?.apply { consumers.add(this) }

@@ -252,9 +252,7 @@ constructor(
     *
     * @throws RuntimeException if the view is already initialized
     */
    fun initView(
        context: Context,
    ): View {
    fun initView(context: Context): View {
        return initView(
            ComposeView(context).apply {
                repeatWhenAttached {
@@ -329,12 +327,7 @@ constructor(
                val ltr = containerView.layoutDirection == View.LAYOUT_DIRECTION_LTR

                val backGestureInset =
                    Rect(
                        0,
                        0,
                        if (ltr) 0 else containerView.right,
                        containerView.bottom,
                    )
                    Rect(0, 0, if (ltr) 0 else containerView.right, containerView.bottom)

                containerView.systemGestureExclusionRects =
                    if (Flags.hubmodeFullscreenVerticalSwipeFix()) {
@@ -351,11 +344,11 @@ constructor(
                                0,
                                topEdgeSwipeRegionWidth,
                                containerView.right,
                                containerView.bottom - bottomEdgeSwipeRegionWidth
                                containerView.bottom - bottomEdgeSwipeRegionWidth,
                            ),
                            // Disable back gestures on the left side of the screen, to avoid
                            // conflicting with scene transitions.
                            backGestureInset
                            backGestureInset,
                        )
                    }
                logger.d({ "Insets updated: $str1" }) {
@@ -372,7 +365,7 @@ constructor(
            containerView,
            anyOf(
                keyguardInteractor.primaryBouncerShowing,
                keyguardInteractor.alternateBouncerShowing
                keyguardInteractor.alternateBouncerShowing,
            ),
            {
                anyBouncerShowing = it
@@ -380,12 +373,12 @@ constructor(
                    logger.d({ "New value for anyBouncerShowing: $bool1" }) { bool1 = it }
                }
                updateTouchHandlingState()
            }
            },
        )
        collectFlow(
            containerView,
            keyguardTransitionInteractor.isFinishedIn(KeyguardState.LOCKSCREEN),
            { onLockscreen = it }
            { onLockscreen = it },
        )
        collectFlow(
            containerView,
@@ -393,7 +386,7 @@ constructor(
            {
                hubShowing = it
                updateTouchHandlingState()
            }
            },
        )
        collectFlow(
            containerView,
@@ -404,12 +397,12 @@ constructor(
                communalInteractor.editActivityShowing,
                keyguardTransitionInteractor.isInTransition(
                    Edge.create(KeyguardState.GONE, KeyguardState.GLANCEABLE_HUB)
                )
                ),
            ),
            {
                inEditModeTransition = it
                updateTouchHandlingState()
            }
            },
        )
        collectFlow(
            containerView,
@@ -417,7 +410,7 @@ constructor(
                shadeInteractor.isAnyFullyExpanded,
                shadeInteractor.isUserInteracting,
                shadeInteractor.isShadeFullyCollapsed,
                ::Triple
                ::Triple,
            ),
            { (isFullyExpanded, isUserInteracting, isShadeFullyCollapsed) ->
                shadeConsumingTouches = isUserInteracting
@@ -441,7 +434,7 @@ constructor(
                        }
                    }
                updateTouchHandlingState()
            }
            },
        )
        collectFlow(containerView, keyguardInteractor.isDreaming, { isDreaming = it })

@@ -628,7 +621,7 @@ constructor(
            powerManager.userActivity(
                SystemClock.uptimeMillis(),
                PowerManager.USER_ACTIVITY_EVENT_TOUCH,
                0
                0,
            )
        }
    }
+26 −26
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                override fun create(
                    lifecycleOwner: LifecycleOwner,
                    touchHandlers: Set<TouchHandler>,
                    loggingName: String
                    loggingName: String,
                ): AmbientTouchComponent =
                    object : AmbientTouchComponent {
                        override fun getTouchMonitor(): TouchMonitor = touchMonitor
@@ -141,7 +141,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                    kosmos.notificationStackScrollLayoutController,
                    kosmos.keyguardMediaController,
                    kosmos.lockscreenSmartspaceController,
                    logcatLogBuffer("GlanceableHubContainerControllerTest")
                    logcatLogBuffer("GlanceableHubContainerControllerTest"),
                )
        }
        testableLooper = TestableLooper.get(this)
@@ -150,7 +150,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
        overrideResource(R.dimen.communal_top_edge_swipe_region_height, TOP_SWIPE_REGION_WIDTH)
        overrideResource(
            R.dimen.communal_bottom_edge_swipe_region_height,
            BOTTOM_SWIPE_REGION_WIDTH
            BOTTOM_SWIPE_REGION_WIDTH,
        )

        // Make communal available so that communalInteractor.desiredScene accurately reflects
@@ -188,7 +188,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                        kosmos.notificationStackScrollLayoutController,
                        kosmos.keyguardMediaController,
                        kosmos.lockscreenSmartspaceController,
                        logcatLogBuffer("GlanceableHubContainerControllerTest")
                        logcatLogBuffer("GlanceableHubContainerControllerTest"),
                    )

                // First call succeeds.
@@ -217,7 +217,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                    kosmos.notificationStackScrollLayoutController,
                    kosmos.keyguardMediaController,
                    kosmos.lockscreenSmartspaceController,
                    logcatLogBuffer("GlanceableHubContainerControllerTest")
                    logcatLogBuffer("GlanceableHubContainerControllerTest"),
                )

            assertThat(underTest.lifecycle.currentState).isEqualTo(Lifecycle.State.INITIALIZED)
@@ -241,7 +241,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                    kosmos.notificationStackScrollLayoutController,
                    kosmos.keyguardMediaController,
                    kosmos.lockscreenSmartspaceController,
                    logcatLogBuffer("GlanceableHubContainerControllerTest")
                    logcatLogBuffer("GlanceableHubContainerControllerTest"),
                )

            // Only initView without attaching a view as we don't want the flows to start collecting
@@ -342,7 +342,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                        from = KeyguardState.GONE,
                        to = KeyguardState.GLANCEABLE_HUB,
                        value = 1.0f,
                        transitionState = TransitionState.RUNNING
                        transitionState = TransitionState.RUNNING,
                    )
                )
                testableLooper.processAllMessages()
@@ -458,14 +458,14 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                            /* left= */ 0,
                            /* top= */ TOP_SWIPE_REGION_WIDTH,
                            /* right= */ CONTAINER_WIDTH,
                            /* bottom= */ CONTAINER_HEIGHT - BOTTOM_SWIPE_REGION_WIDTH
                            /* bottom= */ CONTAINER_HEIGHT - BOTTOM_SWIPE_REGION_WIDTH,
                        ),
                        Rect(
                            /* left= */ 0,
                            /* top= */ 0,
                            /* right= */ 0,
                            /* bottom= */ CONTAINER_HEIGHT
                        )
                            /* bottom= */ CONTAINER_HEIGHT,
                        ),
                    )
            }
        }
@@ -484,7 +484,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                            /* left= */ 0,
                            /* top= */ 0,
                            /* right= */ 0,
                            /* bottom= */ CONTAINER_HEIGHT
                            /* bottom= */ CONTAINER_HEIGHT,
                        )
                    )
            }
@@ -504,14 +504,14 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                            /* left= */ 0,
                            /* top= */ TOP_SWIPE_REGION_WIDTH,
                            /* right= */ CONTAINER_WIDTH,
                            /* bottom= */ CONTAINER_HEIGHT - BOTTOM_SWIPE_REGION_WIDTH
                            /* bottom= */ CONTAINER_HEIGHT - BOTTOM_SWIPE_REGION_WIDTH,
                        ),
                        Rect(
                            /* left= */ 0,
                            /* top= */ 0,
                            /* right= */ CONTAINER_WIDTH,
                            /* bottom= */ CONTAINER_HEIGHT
                        )
                            /* bottom= */ CONTAINER_HEIGHT,
                        ),
                    )
            }
        }
@@ -529,7 +529,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                            /* left= */ 0,
                            /* top= */ 0,
                            /* right= */ CONTAINER_WIDTH,
                            /* bottom= */ CONTAINER_HEIGHT
                            /* bottom= */ CONTAINER_HEIGHT,
                        )
                    )
            }
@@ -597,7 +597,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                whenever(
                        notificationStackScrollLayoutController.isBelowLastNotification(
                            any(),
                            any()
                            any(),
                        )
                    )
                    .thenReturn(false)
@@ -675,7 +675,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                        from = KeyguardState.GONE,
                        to = KeyguardState.GLANCEABLE_HUB,
                        value = 1.0f,
                        transitionState = TransitionState.RUNNING
                        transitionState = TransitionState.RUNNING,
                    )
                )
                testableLooper.processAllMessages()
@@ -696,7 +696,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                whenever(
                        notificationStackScrollLayoutController.isBelowLastNotification(
                            any(),
                            any()
                            any(),
                        )
                    )
                    .thenReturn(true)
@@ -728,7 +728,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                whenever(
                        notificationStackScrollLayoutController.isBelowLastNotification(
                            any(),
                            any()
                            any(),
                        )
                    )
                    .thenReturn(true)
@@ -752,7 +752,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                whenever(
                        notificationStackScrollLayoutController.isBelowLastNotification(
                            any(),
                            any()
                            any(),
                        )
                    )
                    .thenReturn(true)
@@ -805,13 +805,13 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
            kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps(
                from = KeyguardState.LOCKSCREEN,
                to = KeyguardState.GLANCEABLE_HUB,
                kosmos.testScope
                kosmos.testScope,
            )
        } else {
            kosmos.fakeKeyguardTransitionRepository.sendTransitionSteps(
                from = KeyguardState.GLANCEABLE_HUB,
                to = KeyguardState.LOCKSCREEN,
                kosmos.testScope
                kosmos.testScope,
            )
        }
        testableLooper.processAllMessages()
@@ -836,7 +836,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                MotionEvent.ACTION_DOWN,
                CONTAINER_WIDTH.toFloat() / 2,
                CONTAINER_HEIGHT.toFloat() / 2,
                0
                0,
            )

        private val CANCEL_EVENT =
@@ -846,7 +846,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                MotionEvent.ACTION_CANCEL,
                CONTAINER_WIDTH.toFloat() / 2,
                CONTAINER_HEIGHT.toFloat() / 2,
                0
                0,
            )

        private val MOVE_EVENT =
@@ -856,7 +856,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                MotionEvent.ACTION_MOVE,
                CONTAINER_WIDTH.toFloat() / 2,
                CONTAINER_HEIGHT.toFloat() / 2,
                0
                0,
            )

        private val UP_EVENT =
@@ -866,7 +866,7 @@ class GlanceableHubContainerControllerTest : SysuiTestCase() {
                MotionEvent.ACTION_UP,
                CONTAINER_WIDTH.toFloat() / 2,
                CONTAINER_HEIGHT.toFloat() / 2,
                0
                0,
            )
    }
}