Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +8 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,8 @@ public interface QS extends FragmentBase { default void setPanelExpanded(boolean panelExpanded) {} default void setQqsHeightListener(QqsHeightListener listener) {} /** * Callback for when QSPanel container is scrolled */ Loading @@ -220,4 +222,10 @@ public interface QS extends FragmentBase { void onQsHeightChanged(); } @ProvidesInterface(version = HeightListener.VERSION) interface QqsHeightListener { int VERSION = 1; void onQqsHeightChanged(); } } packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt +10 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ constructor( private val collapsedMediaVisibilityChangedListener = MutableStateFlow<(Consumer<Boolean>)?>(null) private val heightListener = MutableStateFlow<QS.HeightListener?>(null) private val qqsHeightListener = MutableStateFlow<QS.QqsHeightListener?>(null) private val qsContainerController = MutableStateFlow<QSContainerController?>(null) private lateinit var viewModel: QSFragmentComposeViewModel Loading Loading @@ -400,6 +401,10 @@ constructor( heightListener.value = notificationPanelView } override fun setQqsHeightListener(listener: QS.QqsHeightListener?) { qqsHeightListener.value = listener } override fun hideImmediately() { // view?.animate()?.cancel() // view?.y = -qsMinExpansionHeight.toFloat() Loading Loading @@ -611,9 +616,14 @@ constructor( private fun setListenerCollections() { lifecycleScope.launch { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { var lastQqsHeight = -1 this@QSFragmentCompose.view?.setSnapshotBinding { scrollListener.value?.onQsPanelScrollChanged(scrollState.value) collapsedMediaVisibilityChangedListener.value?.accept(viewModel.qqsMediaVisible) if (lastQqsHeight != viewModel.qqsHeight) { lastQqsHeight = viewModel.qqsHeight qqsHeightListener.value?.onQqsHeightChanged() } } launch { setListenerJob( Loading packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java +10 −6 Original line number Diff line number Diff line Loading @@ -297,6 +297,13 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum private FlingQsWithoutClickListener mFlingQsWithoutClickListener; private ExpansionHeightSetToMaxListener mExpansionHeightSetToMaxListener; private final QS.HeightListener mQsHeightListener = this::onHeightChanged; private final QS.QqsHeightListener mQqsHeightListener = new QS.QqsHeightListener() { @Override public void onQqsHeightChanged() { updateHeightsOnShadeLayoutChange(); mPanelViewControllerLazy.get().positionClockAndNotifications(); } }; private final Runnable mQsCollapseExpandAction = this::collapseOrExpandQs; private final QS.ScrollListener mQsScrollListener = this::onScroll; Loading Loading @@ -2177,7 +2184,6 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum /** */ public final class QsFragmentListener implements FragmentHostManager.FragmentListener { private boolean mPreviouslyVisibleMedia = false; /** */ @Override Loading @@ -2189,6 +2195,9 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum mQs.setOverscrolling(mStackScrollerOverscrolling); mQs.setInSplitShade(mSplitShadeEnabled); mQs.setIsNotificationPanelFullWidth(mIsFullWidth); if (QSComposeFragment.isEnabled()) { mQs.setQqsHeightListener(mQqsHeightListener); } // recompute internal state when qspanel height changes mQs.getView().addOnLayoutChangeListener( Loading @@ -2204,12 +2213,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum setAnimateNextNotificationBounds( StackStateAnimator.ANIMATION_DURATION_STANDARD, 0); mNotificationStackScrollLayoutController.animateNextTopPaddingChange(); if (QSComposeFragment.isEnabled() && mPreviouslyVisibleMedia != visible) { updateHeightsOnShadeLayoutChange(); mPanelViewControllerLazy.get().positionClockAndNotifications(); } } mPreviouslyVisibleMedia = visible; }); mLockscreenShadeTransitionController.setQS(mQs); if (QSComposeFragment.isEnabled()) { Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +8 −0 Original line number Diff line number Diff line Loading @@ -205,6 +205,8 @@ public interface QS extends FragmentBase { default void setPanelExpanded(boolean panelExpanded) {} default void setQqsHeightListener(QqsHeightListener listener) {} /** * Callback for when QSPanel container is scrolled */ Loading @@ -220,4 +222,10 @@ public interface QS extends FragmentBase { void onQsHeightChanged(); } @ProvidesInterface(version = HeightListener.VERSION) interface QqsHeightListener { int VERSION = 1; void onQqsHeightChanged(); } }
packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt +10 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,7 @@ constructor( private val collapsedMediaVisibilityChangedListener = MutableStateFlow<(Consumer<Boolean>)?>(null) private val heightListener = MutableStateFlow<QS.HeightListener?>(null) private val qqsHeightListener = MutableStateFlow<QS.QqsHeightListener?>(null) private val qsContainerController = MutableStateFlow<QSContainerController?>(null) private lateinit var viewModel: QSFragmentComposeViewModel Loading Loading @@ -400,6 +401,10 @@ constructor( heightListener.value = notificationPanelView } override fun setQqsHeightListener(listener: QS.QqsHeightListener?) { qqsHeightListener.value = listener } override fun hideImmediately() { // view?.animate()?.cancel() // view?.y = -qsMinExpansionHeight.toFloat() Loading Loading @@ -611,9 +616,14 @@ constructor( private fun setListenerCollections() { lifecycleScope.launch { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { var lastQqsHeight = -1 this@QSFragmentCompose.view?.setSnapshotBinding { scrollListener.value?.onQsPanelScrollChanged(scrollState.value) collapsedMediaVisibilityChangedListener.value?.accept(viewModel.qqsMediaVisible) if (lastQqsHeight != viewModel.qqsHeight) { lastQqsHeight = viewModel.qqsHeight qqsHeightListener.value?.onQqsHeightChanged() } } launch { setListenerJob( Loading
packages/SystemUI/src/com/android/systemui/shade/QuickSettingsControllerImpl.java +10 −6 Original line number Diff line number Diff line Loading @@ -297,6 +297,13 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum private FlingQsWithoutClickListener mFlingQsWithoutClickListener; private ExpansionHeightSetToMaxListener mExpansionHeightSetToMaxListener; private final QS.HeightListener mQsHeightListener = this::onHeightChanged; private final QS.QqsHeightListener mQqsHeightListener = new QS.QqsHeightListener() { @Override public void onQqsHeightChanged() { updateHeightsOnShadeLayoutChange(); mPanelViewControllerLazy.get().positionClockAndNotifications(); } }; private final Runnable mQsCollapseExpandAction = this::collapseOrExpandQs; private final QS.ScrollListener mQsScrollListener = this::onScroll; Loading Loading @@ -2177,7 +2184,6 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum /** */ public final class QsFragmentListener implements FragmentHostManager.FragmentListener { private boolean mPreviouslyVisibleMedia = false; /** */ @Override Loading @@ -2189,6 +2195,9 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum mQs.setOverscrolling(mStackScrollerOverscrolling); mQs.setInSplitShade(mSplitShadeEnabled); mQs.setIsNotificationPanelFullWidth(mIsFullWidth); if (QSComposeFragment.isEnabled()) { mQs.setQqsHeightListener(mQqsHeightListener); } // recompute internal state when qspanel height changes mQs.getView().addOnLayoutChangeListener( Loading @@ -2204,12 +2213,7 @@ public class QuickSettingsControllerImpl implements QuickSettingsController, Dum setAnimateNextNotificationBounds( StackStateAnimator.ANIMATION_DURATION_STANDARD, 0); mNotificationStackScrollLayoutController.animateNextTopPaddingChange(); if (QSComposeFragment.isEnabled() && mPreviouslyVisibleMedia != visible) { updateHeightsOnShadeLayoutChange(); mPanelViewControllerLazy.get().positionClockAndNotifications(); } } mPreviouslyVisibleMedia = visible; }); mLockscreenShadeTransitionController.setQS(mQs); if (QSComposeFragment.isEnabled()) { Loading