diff options
| -rw-r--r-- | packages/SystemUI/res/values/dimens.xml | 4 | ||||
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt | 25 |
2 files changed, 22 insertions, 7 deletions
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 4209c1f6a732..61b49b217605 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -903,6 +903,10 @@ Keep it the same as in Launcher--> <dimen name="communal_enforced_rounded_corner_max_radius">16dp</dimen> + <!-- Width and height used to filter widgets displayed in the communal widget picker --> + <dimen name="communal_widget_picker_desired_width">464dp</dimen> + <dimen name="communal_widget_picker_desired_height">307dp</dimen> + <!-- The width/height of the unlock icon view on keyguard. --> <dimen name="keyguard_lock_height">42dp</dimen> <dimen name="keyguard_lock_padding">20dp</dimen> diff --git a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt index ad1327e90710..2d09c7698cca 100644 --- a/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt +++ b/packages/SystemUI/src/com/android/systemui/communal/widgets/EditWidgetsActivity.kt @@ -31,6 +31,7 @@ import com.android.internal.logging.UiEventLogger import com.android.systemui.communal.shared.log.CommunalUiEvent import com.android.systemui.communal.ui.viewmodel.CommunalEditModeViewModel import com.android.systemui.compose.ComposeFacade.setCommunalEditWidgetActivityContent +import com.android.systemui.res.R import javax.inject.Inject /** An Activity for editing the widgets that appear in hub mode. */ @@ -44,8 +45,10 @@ constructor( ) : ComponentActivity() { companion object { private const val EXTRA_IS_PENDING_WIDGET_DRAG = "is_pending_widget_drag" - private const val EXTRA_FILTER_STRATEGY = "filter_strategy" - private const val FILTER_STRATEGY_GLANCEABLE_HUB = 1 + private const val EXTRA_DESIRED_WIDGET_WIDTH = "desired_widget_width" + + private const val EXTRA_DESIRED_WIDGET_HEIGHT = "desired_widget_height" + private const val TAG = "EditWidgetsActivity" const val EXTRA_PRESELECTED_KEY = "preselected_key" } @@ -110,11 +113,19 @@ constructor( ?.let { packageName -> try { addWidgetActivityLauncher.launch( - Intent(Intent.ACTION_PICK).also { - it.setPackage(packageName) - it.putExtra( - EXTRA_FILTER_STRATEGY, - FILTER_STRATEGY_GLANCEABLE_HUB + Intent(Intent.ACTION_PICK).apply { + setPackage(packageName) + putExtra( + EXTRA_DESIRED_WIDGET_WIDTH, + resources.getDimensionPixelSize( + R.dimen.communal_widget_picker_desired_width + ) + ) + putExtra( + EXTRA_DESIRED_WIDGET_HEIGHT, + resources.getDimensionPixelSize( + R.dimen.communal_widget_picker_desired_height + ) ) } ) |