diff options
author | 2023-09-06 14:55:26 +0000 | |
---|---|---|
committer | 2023-09-06 14:55:26 +0000 | |
commit | 8c98666d1b97fac0a937d7a8fc8e1d18c6fb7f88 (patch) | |
tree | 7d807053fb517116eddd12481fbe61f0f7be8643 | |
parent | 9d62188b5653d203e87f345e6682a950ecc187d5 (diff) | |
parent | 550425ee1fba1136e68224be094adca89249aaed (diff) |
Merge changes Ic18aa7c6,I444398f0,Ib6c66ade into main
* changes:
Revert "Revert "Enable the Compose implementation of the QS footer actions""
Fix the Compose footer actions paddings
Set the elevation on the Compose implementation of QS footer actions
5 files changed, 27 insertions, 6 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt index 13acde206247..482220013e32 100644 --- a/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt +++ b/packages/SystemUI/compose/features/src/com/android/systemui/qs/footer/ui/compose/FooterActions.kt @@ -137,6 +137,7 @@ fun FooterActions( ) } + val horizontalPadding = dimensionResource(R.dimen.qs_content_horizontal_padding) Row( modifier .fillMaxWidth() @@ -150,6 +151,8 @@ fun FooterActions( .padding( top = dimensionResource(R.dimen.qs_footer_actions_top_padding), bottom = dimensionResource(R.dimen.qs_footer_actions_bottom_padding), + start = horizontalPadding, + end = horizontalPadding, ) .layout { measurable, constraints -> // All buttons have a 4dp padding to increase their touch size. To be consistent diff --git a/packages/SystemUI/res/values/ids.xml b/packages/SystemUI/res/values/ids.xml index 579358fe709b..d8c808054fff 100644 --- a/packages/SystemUI/res/values/ids.xml +++ b/packages/SystemUI/res/values/ids.xml @@ -233,4 +233,7 @@ removed later. --> <item type="id" name="tag_smartspace_view" /> + + <!-- Tag set on the Compose implementation of the QS footer actions. --> + <item type="id" name="tag_compose_qs_footer_actions" /> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt index b0d73c9b7cf7..9de753d7a4c0 100644 --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt @@ -793,7 +793,7 @@ object Flags { /** Enable the Compose implementation of the Quick Settings footer actions. */ @JvmField - val COMPOSE_QS_FOOTER_ACTIONS = unreleasedFlag("compose_qs_footer_actions") + val COMPOSE_QS_FOOTER_ACTIONS = releasedFlag("compose_qs_footer_actions") /** Enable the share wifi button in Quick Settings internet dialog. */ @JvmField diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java index d2eac45754bd..37e750b86c21 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java @@ -235,11 +235,15 @@ public class QSContainerImpl extends FrameLayout implements Dumpable { quickStatusBarHeaderController.setContentMargins(mContentHorizontalPadding, mContentHorizontalPadding); } else { - view.setPaddingRelative( - mContentHorizontalPadding, - view.getPaddingTop(), - mContentHorizontalPadding, - view.getPaddingBottom()); + // Set the horizontal paddings unless the view is the Compose implementation of the + // footer actions. + if (view.getTag(R.id.tag_compose_qs_footer_actions) == null) { + view.setPaddingRelative( + mContentHorizontalPadding, + view.getPaddingTop(), + mContentHorizontalPadding, + view.getPaddingBottom()); + } } } } diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java index d801faa44b40..596d024958b0 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSFragment.java @@ -303,6 +303,17 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca // to all views except for qs_footer_actions, so we set it to the Compose view. composeView.setId(R.id.qs_footer_actions); + // Set this tag so that QSContainerImpl does not add horizontal paddings to this Compose + // implementation of the footer actions. They will be set in Compose instead so that the + // background fills the full screen width. + composeView.setTag(R.id.tag_compose_qs_footer_actions, true); + + // Set the same elevation as the View implementation, otherwise the footer actions will be + // drawn below the scroll view with QS grid and clicks won't get through on small devices + // where there isn't enough vertical space to show all the tiles and the footer actions. + composeView.setElevation( + composeView.getContext().getResources().getDimension(R.dimen.qs_panel_elevation)); + // Replace the View by the Compose provided one. ViewGroup parent = (ViewGroup) footerActionsView.getParent(); ViewGroup.LayoutParams layoutParams = footerActionsView.getLayoutParams(); |