Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1604275 authored by William Leshner's avatar William Leshner Committed by Android (Google) Code Review
Browse files

Merge "Add desired widget sizes to widget picker action intent." into main

parents 028d0c4a e263b621
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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>
+18 −7
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import com.android.systemui.communal.shared.log.CommunalUiEvent
import com.android.systemui.communal.shared.model.CommunalSceneKey
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. */
@@ -45,8 +46,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"
    }
@@ -111,11 +114,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
                                        )
                                    )
                                }
                            )