Loading packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +2 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,8 @@ public interface QS extends FragmentBase { default void setQqsHeightListener(QqsHeightListener listener) {} default void setQSContentPaddingBottom(int padding) {} /** * Callback for when QSPanel container is scrolled */ Loading packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt +8 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow Loading Loading @@ -196,6 +197,7 @@ constructor( private val scrollState = ScrollState(0) private val locationTemp = IntArray(2) private var bottomBarPositionInRoot = IntRect(IntOffset(0, 0), 0) private var bottomContentPadding by mutableIntStateOf(0) private val containerView: FrameLayoutTouchPassthrough? get() = view as? FrameLayoutTouchPassthrough Loading Loading @@ -634,6 +636,10 @@ constructor( return qqsVisible.value } override fun setQSContentPaddingBottom(padding: Int) { bottomContentPadding = padding } private fun setListenerCollections() { lifecycleScope.launch { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { Loading Loading @@ -938,7 +944,7 @@ constructor( } } } Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.systemBars)) Spacer(Modifier.height { bottomContentPadding }.fillMaxWidth()) } } Loading Loading @@ -1008,6 +1014,7 @@ constructor( } println("QQS visible", qqsVisible.value) println("Always composed", alwaysCompose) println("bottom QS padding", bottomContentPadding) if (::viewModel.isInitialized) { printSection("View Model") { viewModel.dump(this@run, args) } } Loading packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.navigationbar.NavigationModeController import com.android.systemui.plugins.qs.QS import com.android.systemui.plugins.qs.QSContainerController import com.android.systemui.qs.flags.QSComposeFragment import com.android.systemui.res.R import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shared.system.QuickStepContract Loading Loading @@ -229,6 +230,11 @@ constructor( mView.setPadding(0, 0, 0, containerPadding) mView.setNotificationsMarginBottom(notificationsMargin) mView.setQSContainerPaddingBottom(qsContainerPadding) if (QSComposeFragment.isEnabled && !isQSCustomizing) { // To have complete control when QS is in compose, we add negative margin to negate // the padding of the container. That way we can adjust the padding inside compose. mView.setQSNegativeMarginBottom(containerPadding) } } private fun calculateBottomSpacing(): Paddings { Loading packages/SystemUI/src/com/android/systemui/shade/NotificationsQuickSettingsContainer.java +13 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,11 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout public void setQSContainerPaddingBottom(int paddingBottom) { mLastQSPaddingBottom = paddingBottom; if (!QSComposeFragment.isEnabled()) { if (QSComposeFragment.isEnabled()) { if (mQs != null) { mQs.setQSContentPaddingBottom(paddingBottom); } } else { if (mQSContainer != null) { mQSContainer.setPadding( mQSContainer.getPaddingLeft(), Loading @@ -127,6 +131,14 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout } } public void setQSNegativeMarginBottom(int margin) { if (QSComposeFragment.isEnabled() && mQSContainer != null) { MarginLayoutParams params = (MarginLayoutParams) mQSContainer.getLayoutParams(); params.bottomMargin = -margin; mQSContainer.setLayoutParams(params); } } public void setInsetsChangedListener(Consumer<WindowInsets> onInsetsChangedListener) { mInsetsChangedListener = onInsetsChangedListener; } Loading Loading
packages/SystemUI/plugin/src/com/android/systemui/plugins/qs/QS.java +2 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,8 @@ public interface QS extends FragmentBase { default void setQqsHeightListener(QqsHeightListener listener) {} default void setQSContentPaddingBottom(int padding) {} /** * Callback for when QSPanel container is scrolled */ Loading
packages/SystemUI/src/com/android/systemui/qs/composefragment/QSFragmentCompose.kt +8 −1 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.runtime.snapshotFlow Loading Loading @@ -196,6 +197,7 @@ constructor( private val scrollState = ScrollState(0) private val locationTemp = IntArray(2) private var bottomBarPositionInRoot = IntRect(IntOffset(0, 0), 0) private var bottomContentPadding by mutableIntStateOf(0) private val containerView: FrameLayoutTouchPassthrough? get() = view as? FrameLayoutTouchPassthrough Loading Loading @@ -634,6 +636,10 @@ constructor( return qqsVisible.value } override fun setQSContentPaddingBottom(padding: Int) { bottomContentPadding = padding } private fun setListenerCollections() { lifecycleScope.launch { lifecycle.repeatOnLifecycle(Lifecycle.State.STARTED) { Loading Loading @@ -938,7 +944,7 @@ constructor( } } } Spacer(Modifier.windowInsetsBottomHeight(WindowInsets.systemBars)) Spacer(Modifier.height { bottomContentPadding }.fillMaxWidth()) } } Loading Loading @@ -1008,6 +1014,7 @@ constructor( } println("QQS visible", qqsVisible.value) println("Always composed", alwaysCompose) println("bottom QS padding", bottomContentPadding) if (::viewModel.isInitialized) { printSection("View Model") { viewModel.dump(this@run, args) } } Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationsQSContainerController.kt +6 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import com.android.systemui.lifecycle.repeatWhenAttached import com.android.systemui.navigationbar.NavigationModeController import com.android.systemui.plugins.qs.QS import com.android.systemui.plugins.qs.QSContainerController import com.android.systemui.qs.flags.QSComposeFragment import com.android.systemui.res.R import com.android.systemui.shade.domain.interactor.ShadeInteractor import com.android.systemui.shared.system.QuickStepContract Loading Loading @@ -229,6 +230,11 @@ constructor( mView.setPadding(0, 0, 0, containerPadding) mView.setNotificationsMarginBottom(notificationsMargin) mView.setQSContainerPaddingBottom(qsContainerPadding) if (QSComposeFragment.isEnabled && !isQSCustomizing) { // To have complete control when QS is in compose, we add negative margin to negate // the padding of the container. That way we can adjust the padding inside compose. mView.setQSNegativeMarginBottom(containerPadding) } } private fun calculateBottomSpacing(): Paddings { Loading
packages/SystemUI/src/com/android/systemui/shade/NotificationsQuickSettingsContainer.java +13 −1 Original line number Diff line number Diff line Loading @@ -115,7 +115,11 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout public void setQSContainerPaddingBottom(int paddingBottom) { mLastQSPaddingBottom = paddingBottom; if (!QSComposeFragment.isEnabled()) { if (QSComposeFragment.isEnabled()) { if (mQs != null) { mQs.setQSContentPaddingBottom(paddingBottom); } } else { if (mQSContainer != null) { mQSContainer.setPadding( mQSContainer.getPaddingLeft(), Loading @@ -127,6 +131,14 @@ public class NotificationsQuickSettingsContainer extends ConstraintLayout } } public void setQSNegativeMarginBottom(int margin) { if (QSComposeFragment.isEnabled() && mQSContainer != null) { MarginLayoutParams params = (MarginLayoutParams) mQSContainer.getLayoutParams(); params.bottomMargin = -margin; mQSContainer.setLayoutParams(params); } } public void setInsetsChangedListener(Consumer<WindowInsets> onInsetsChangedListener) { mInsetsChangedListener = onInsetsChangedListener; } Loading