Loading packages/SystemUI/res/layout/super_notification_shade.xml +7 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,13 @@ android:layout_height="match_parent" android:visibility="invisible" /> <!-- Shared container for the notification stack. Can be positioned by either the keyguard_root_view or notification_panel --> <com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer android:id="@+id/shared_notification_container" android:layout_width="match_parent" android:layout_height="match_parent" /> <include layout="@layout/brightness_mirror_container" /> <com.android.systemui.scrim.ScrimView Loading packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,7 @@ <item type="id" name="keyguard_indication_area" /> <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="lock_icon" /> <item type="id" name="lock_icon_bg" /> </resources> packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt +23 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ import com.android.systemui.keyguard.ui.view.layout.KeyguardLayoutManagerCommand import com.android.systemui.keyguard.ui.viewmodel.KeyguardIndicationAreaViewModel import com.android.systemui.shade.NotificationShadeWindowView import com.android.systemui.statusbar.KeyguardIndicationController 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 import javax.inject.Inject import kotlinx.coroutines.DisposableHandle Loading @@ -40,7 +43,9 @@ class KeyguardViewConfigurator @Inject constructor( private val keyguardRootView: KeyguardRootView, private val sharedNotificationContainer: SharedNotificationContainer, private val keyguardIndicationAreaViewModel: KeyguardIndicationAreaViewModel, private val sharedNotificationContainerViewModel: SharedNotificationContainerViewModel, private val notificationShadeWindowView: NotificationShadeWindowView, private val featureFlags: FeatureFlags, private val indicationController: KeyguardIndicationController, Loading @@ -55,10 +60,28 @@ constructor( notificationShadeWindowView.requireViewById(R.id.notification_panel) as ViewGroup bindIndicationArea(notificationPanel) bindLockIconView(notificationPanel) setupNotificationStackScrollLayout(notificationPanel) keyguardLayoutManager.layoutViews() keyguardLayoutManagerCommandListener.start() } fun setupNotificationStackScrollLayout(legacyParent: ViewGroup) { if (featureFlags.isEnabled(Flags.MIGRATE_NSSL)) { // This moves the existing NSSL view to a different parent, as the controller is a // singleton and recreating it has other bad side effects val nssl = legacyParent.requireViewById<View>(R.id.notification_stack_scroller).also { (it.getParent() as ViewGroup).removeView(it) } sharedNotificationContainer.addNotificationStackScrollLayout(nssl) SharedNotificationContainerBinder.bind( sharedNotificationContainer, sharedNotificationContainerViewModel ) } } fun bindIndicationArea(legacyParent: ViewGroup) { indicationAreaHandle?.dispose() Loading packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt +19 −7 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ import androidx.constraintlayout.widget.ConstraintSet.TOP import com.android.systemui.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.fragments.FragmentService import com.android.systemui.navigationbar.NavigationModeController import com.android.systemui.plugins.qs.QS Loading @@ -36,6 +38,7 @@ import com.android.systemui.plugins.qs.QSContainerController import com.android.systemui.recents.OverviewProxyService import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener import com.android.systemui.shared.system.QuickStepContract import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController import com.android.systemui.util.LargeScreenUtils import com.android.systemui.util.ViewController import com.android.systemui.util.concurrency.DelayableExecutor Loading @@ -54,7 +57,10 @@ class NotificationsQSContainerController @Inject constructor( private val shadeHeaderController: ShadeHeaderController, private val shadeExpansionStateManager: ShadeExpansionStateManager, private val fragmentService: FragmentService, @Main private val delayableExecutor: DelayableExecutor @Main private val delayableExecutor: DelayableExecutor, private val featureFlags: FeatureFlags, private val notificationStackScrollLayoutController: NotificationStackScrollLayoutController, ) : ViewController<NotificationsQuickSettingsContainer>(view), QSContainerController { private var qsExpanded = false Loading Loading @@ -118,6 +124,9 @@ class NotificationsQSContainerController @Inject constructor( isGestureNavigation = QuickStepContract.isGesturalMode(mode) } isGestureNavigation = QuickStepContract.isGesturalMode(currentMode) mView.setStackScroller(notificationStackScrollLayoutController.getView()) mView.setMigratingNSSL(featureFlags.isEnabled(Flags.MIGRATE_NSSL)) } public override fun onViewAttached() { Loading Loading @@ -254,14 +263,17 @@ class NotificationsQSContainerController @Inject constructor( } private fun setNotificationsConstraints(constraintSet: ConstraintSet) { if (featureFlags.isEnabled(Flags.MIGRATE_NSSL)) { return } val startConstraintId = if (splitShadeEnabled) R.id.qs_edge_guideline else PARENT_ID val nsslId = R.id.notification_stack_scroller constraintSet.apply { connect(R.id.notification_stack_scroller, START, startConstraintId, START) setMargin(R.id.notification_stack_scroller, START, if (splitShadeEnabled) 0 else panelMarginHorizontal) setMargin(R.id.notification_stack_scroller, END, panelMarginHorizontal) setMargin(R.id.notification_stack_scroller, TOP, topMargin) setMargin(R.id.notification_stack_scroller, BOTTOM, notificationsBottomMargin) connect(nsslId, START, startConstraintId, START) setMargin(nsslId, START, if (splitShadeEnabled) 0 else panelMarginHorizontal) setMargin(nsslId, END, panelMarginHorizontal) setMargin(nsslId, TOP, topMargin) setMargin(nsslId, BOTTOM, notificationsBottomMargin) } } Loading packages/SystemUI/src/com/android/systemui/shade/NotificationsQuickSettingsContainer.java +14 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup.MarginLayoutParams; import android.view.WindowInsets; import androidx.annotation.Nullable; Loading Loading @@ -56,6 +57,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout private QS mQs; private View mQSContainer; private int mLastQSPaddingBottom; private boolean mIsMigratingNSSL; /** * These are used to compute the bounding box containing the shade and the notification scrim, Loading @@ -75,10 +77,13 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout protected void onFinishInflate() { super.onFinishInflate(); mQsFrame = findViewById(R.id.qs_frame); mStackScroller = findViewById(R.id.notification_stack_scroller); mKeyguardStatusBar = findViewById(R.id.keyguard_header); } void setStackScroller(View stackScroller) { mStackScroller = stackScroller; } @Override public void onFragmentViewCreated(String tag, Fragment fragment) { mQs = (QS) fragment; Loading Loading @@ -108,7 +113,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout } public void setNotificationsMarginBottom(int margin) { LayoutParams params = (LayoutParams) mStackScroller.getLayoutParams(); MarginLayoutParams params = (MarginLayoutParams) mStackScroller.getLayoutParams(); params.bottomMargin = margin; mStackScroller.setLayoutParams(params); } Loading Loading @@ -173,8 +178,15 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout super.dispatchDraw(canvas); } void setMigratingNSSL(boolean isMigrating) { mIsMigratingNSSL = isMigrating; } @Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { if (mIsMigratingNSSL) { return super.drawChild(canvas, child, drawingTime); } int layoutIndex = mLayoutDrawingOrder.indexOf(child); if (layoutIndex >= 0) { return super.drawChild(canvas, mDrawingOrderedChildren.get(layoutIndex), drawingTime); Loading Loading
packages/SystemUI/res/layout/super_notification_shade.xml +7 −0 Original line number Diff line number Diff line Loading @@ -76,6 +76,13 @@ android:layout_height="match_parent" android:visibility="invisible" /> <!-- Shared container for the notification stack. Can be positioned by either the keyguard_root_view or notification_panel --> <com.android.systemui.statusbar.notification.stack.ui.view.SharedNotificationContainer android:id="@+id/shared_notification_container" android:layout_width="match_parent" android:layout_height="match_parent" /> <include layout="@layout/brightness_mirror_container" /> <com.android.systemui.scrim.ScrimView Loading
packages/SystemUI/res/values/ids.xml +1 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,7 @@ <item type="id" name="keyguard_indication_area" /> <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="lock_icon" /> <item type="id" name="lock_icon_bg" /> </resources>
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewConfigurator.kt +23 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,9 @@ import com.android.systemui.keyguard.ui.view.layout.KeyguardLayoutManagerCommand import com.android.systemui.keyguard.ui.viewmodel.KeyguardIndicationAreaViewModel import com.android.systemui.shade.NotificationShadeWindowView import com.android.systemui.statusbar.KeyguardIndicationController 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 import javax.inject.Inject import kotlinx.coroutines.DisposableHandle Loading @@ -40,7 +43,9 @@ class KeyguardViewConfigurator @Inject constructor( private val keyguardRootView: KeyguardRootView, private val sharedNotificationContainer: SharedNotificationContainer, private val keyguardIndicationAreaViewModel: KeyguardIndicationAreaViewModel, private val sharedNotificationContainerViewModel: SharedNotificationContainerViewModel, private val notificationShadeWindowView: NotificationShadeWindowView, private val featureFlags: FeatureFlags, private val indicationController: KeyguardIndicationController, Loading @@ -55,10 +60,28 @@ constructor( notificationShadeWindowView.requireViewById(R.id.notification_panel) as ViewGroup bindIndicationArea(notificationPanel) bindLockIconView(notificationPanel) setupNotificationStackScrollLayout(notificationPanel) keyguardLayoutManager.layoutViews() keyguardLayoutManagerCommandListener.start() } fun setupNotificationStackScrollLayout(legacyParent: ViewGroup) { if (featureFlags.isEnabled(Flags.MIGRATE_NSSL)) { // This moves the existing NSSL view to a different parent, as the controller is a // singleton and recreating it has other bad side effects val nssl = legacyParent.requireViewById<View>(R.id.notification_stack_scroller).also { (it.getParent() as ViewGroup).removeView(it) } sharedNotificationContainer.addNotificationStackScrollLayout(nssl) SharedNotificationContainerBinder.bind( sharedNotificationContainer, sharedNotificationContainerViewModel ) } } fun bindIndicationArea(legacyParent: ViewGroup) { indicationAreaHandle?.dispose() Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt +19 −7 Original line number Diff line number Diff line Loading @@ -29,6 +29,8 @@ import androidx.constraintlayout.widget.ConstraintSet.TOP import com.android.systemui.R import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.flags.FeatureFlags import com.android.systemui.flags.Flags import com.android.systemui.fragments.FragmentService import com.android.systemui.navigationbar.NavigationModeController import com.android.systemui.plugins.qs.QS Loading @@ -36,6 +38,7 @@ import com.android.systemui.plugins.qs.QSContainerController import com.android.systemui.recents.OverviewProxyService import com.android.systemui.recents.OverviewProxyService.OverviewProxyListener import com.android.systemui.shared.system.QuickStepContract import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController import com.android.systemui.util.LargeScreenUtils import com.android.systemui.util.ViewController import com.android.systemui.util.concurrency.DelayableExecutor Loading @@ -54,7 +57,10 @@ class NotificationsQSContainerController @Inject constructor( private val shadeHeaderController: ShadeHeaderController, private val shadeExpansionStateManager: ShadeExpansionStateManager, private val fragmentService: FragmentService, @Main private val delayableExecutor: DelayableExecutor @Main private val delayableExecutor: DelayableExecutor, private val featureFlags: FeatureFlags, private val notificationStackScrollLayoutController: NotificationStackScrollLayoutController, ) : ViewController<NotificationsQuickSettingsContainer>(view), QSContainerController { private var qsExpanded = false Loading Loading @@ -118,6 +124,9 @@ class NotificationsQSContainerController @Inject constructor( isGestureNavigation = QuickStepContract.isGesturalMode(mode) } isGestureNavigation = QuickStepContract.isGesturalMode(currentMode) mView.setStackScroller(notificationStackScrollLayoutController.getView()) mView.setMigratingNSSL(featureFlags.isEnabled(Flags.MIGRATE_NSSL)) } public override fun onViewAttached() { Loading Loading @@ -254,14 +263,17 @@ class NotificationsQSContainerController @Inject constructor( } private fun setNotificationsConstraints(constraintSet: ConstraintSet) { if (featureFlags.isEnabled(Flags.MIGRATE_NSSL)) { return } val startConstraintId = if (splitShadeEnabled) R.id.qs_edge_guideline else PARENT_ID val nsslId = R.id.notification_stack_scroller constraintSet.apply { connect(R.id.notification_stack_scroller, START, startConstraintId, START) setMargin(R.id.notification_stack_scroller, START, if (splitShadeEnabled) 0 else panelMarginHorizontal) setMargin(R.id.notification_stack_scroller, END, panelMarginHorizontal) setMargin(R.id.notification_stack_scroller, TOP, topMargin) setMargin(R.id.notification_stack_scroller, BOTTOM, notificationsBottomMargin) connect(nsslId, START, startConstraintId, START) setMargin(nsslId, START, if (splitShadeEnabled) 0 else panelMarginHorizontal) setMargin(nsslId, END, panelMarginHorizontal) setMargin(nsslId, TOP, topMargin) setMargin(nsslId, BOTTOM, notificationsBottomMargin) } } Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationsQuickSettingsContainer.java +14 −2 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup.MarginLayoutParams; import android.view.WindowInsets; import androidx.annotation.Nullable; Loading Loading @@ -56,6 +57,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout private QS mQs; private View mQSContainer; private int mLastQSPaddingBottom; private boolean mIsMigratingNSSL; /** * These are used to compute the bounding box containing the shade and the notification scrim, Loading @@ -75,10 +77,13 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout protected void onFinishInflate() { super.onFinishInflate(); mQsFrame = findViewById(R.id.qs_frame); mStackScroller = findViewById(R.id.notification_stack_scroller); mKeyguardStatusBar = findViewById(R.id.keyguard_header); } void setStackScroller(View stackScroller) { mStackScroller = stackScroller; } @Override public void onFragmentViewCreated(String tag, Fragment fragment) { mQs = (QS) fragment; Loading Loading @@ -108,7 +113,7 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout } public void setNotificationsMarginBottom(int margin) { LayoutParams params = (LayoutParams) mStackScroller.getLayoutParams(); MarginLayoutParams params = (MarginLayoutParams) mStackScroller.getLayoutParams(); params.bottomMargin = margin; mStackScroller.setLayoutParams(params); } Loading Loading @@ -173,8 +178,15 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout super.dispatchDraw(canvas); } void setMigratingNSSL(boolean isMigrating) { mIsMigratingNSSL = isMigrating; } @Override protected boolean drawChild(Canvas canvas, View child, long drawingTime) { if (mIsMigratingNSSL) { return super.drawChild(canvas, child, drawingTime); } int layoutIndex = mLayoutDrawingOrder.indexOf(child); if (layoutIndex >= 0) { return super.drawChild(canvas, mDrawingOrderedChildren.get(layoutIndex), drawingTime); Loading