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

Commit 1bdc4ffe authored by Matt Pietal's avatar Matt Pietal
Browse files

Position NSSL by scene

Keyguard and the shade will each need to position the
NSSL (SharedNotificationContainer) based upon which scene is
active. The KeyguardInteractor will position it when on keyguard, and
NPVC will position it when the shade is being pulled down and
active. Migrate this logic out of NPVC and into the
SharedNotificationContainerViewModel.

The work isn't yet complete. Additional bugs have been filed to
continue the cleanup.

Bug: 288237177
Test: atest SystemUITests

Change-Id: Idce5a4f8dd55c68b40d52bb7f5cbc7e5d360bb07
parent 6cac1114
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -857,6 +857,8 @@

    <dimen name="keyguard_security_container_padding_top">20dp</dimen>

    <dimen name="keyguard_translate_distance_on_swipe_up">-200dp</dimen>

    <dimen name="keyguard_indication_margin_bottom">32dp</dimen>
    <dimen name="lock_icon_margin_bottom">74dp</dimen>
    <dimen name="ambient_indication_margin_bottom">71dp</dimen>
+2 −0
Original line number Diff line number Diff line
@@ -212,6 +212,8 @@
    <item type="id" name="keyguard_indication_text" />
    <item type="id" name="keyguard_indication_text_bottom" />
    <item type="id" name="nssl_guideline" />
    <item type="id" name="nssl_top_barrier" />
    <item type="id" name="nssl_bottom_barrier" />
    <item type="id" name="split_shade_guideline" />
    <item type="id" name="lock_icon" />
    <item type="id" name="lock_icon_bg" />
+23 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.systemui.common.shared.model

/** Positioning info for the shared notification container */
data class SharedNotificationContainerPosition(
    val top: Float = 0f,
    val bottom: Float = 0f,
)
+7 −0
Original line number Diff line number Diff line
@@ -43,6 +43,9 @@ interface ConfigurationRepository {
    val scaleForResolution: Flow<Float>

    fun getResolutionScale(): Float

    /** Convience to context.resources.getDimensionPixelSize() */
    fun getDimensionPixelSize(id: Int): Int
}

@ExperimentalCoroutinesApi
@@ -115,4 +118,8 @@ constructor(
        }
        return 1f
    }

    override fun getDimensionPixelSize(id: Int): Int {
        return context.resources.getDimensionPixelSize(id)
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ import com.android.systemui.plugins.FalsingManager
import com.android.systemui.shade.NotificationShadeWindowView
import com.android.systemui.statusbar.KeyguardIndicationController
import com.android.systemui.statusbar.VibratorHelper
import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController
import com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer
import com.android.systemui.statusbar.notification.stack.ui.viewbinder.SharedNotificationContainerBinder
import com.android.systemui.statusbar.notification.stack.ui.viewmodel.SharedNotificationContainerViewModel
@@ -90,6 +91,7 @@ constructor(
    private val keyguardBlueprintInteractor: KeyguardBlueprintInteractor,
    private val communalWidgetViewModel: CommunalWidgetViewModel,
    private val communalWidgetViewAdapter: CommunalWidgetViewAdapter,
    private val notificationStackScrollerLayoutController: NotificationStackScrollLayoutController,
) : CoreStartable {

    private var rootViewHandle: DisposableHandle? = null
@@ -131,6 +133,7 @@ constructor(
            SharedNotificationContainerBinder.bind(
                sharedNotificationContainer,
                sharedNotificationContainerViewModel,
                notificationStackScrollerLayoutController,
            )
        }
    }
Loading