Loading packages/SystemUI/aconfig/communal.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,13 @@ flag { description: "Enables the communal hub experience" bug: "304584416" } flag { name: "enable_widget_picker_size_filter" namespace: "communal" description: "Enables passing a size filter to the widget picker" bug: "345482907" metadata { purpose: PURPOSE_BUGFIX } } packages/SystemUI/res/values/dimens.xml +4 −0 Original line number Diff line number Diff line Loading @@ -912,6 +912,10 @@ obvious when corner radii differ.--> <dimen name="communal_enforced_rounded_corner_max_radius">28dp</dimen> <!-- Width and height used to filter widgets displayed in the communal widget picker --> <dimen name="communal_widget_picker_desired_width">360dp</dimen> <dimen name="communal_widget_picker_desired_height">240dp</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> Loading packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt +14 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.res.Resources import android.util.Log import androidx.activity.result.ActivityResultLauncher import com.android.internal.logging.UiEventLogger import com.android.systemui.Flags.enableWidgetPickerSizeFilter import com.android.systemui.communal.domain.interactor.CommunalInteractor import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor Loading @@ -36,6 +37,7 @@ import com.android.systemui.log.core.Logger import com.android.systemui.log.dagger.CommunalLog import com.android.systemui.media.controls.ui.view.MediaHost import com.android.systemui.media.dagger.MediaModule import com.android.systemui.res.R import javax.inject.Inject import javax.inject.Named import kotlinx.coroutines.CoroutineDispatcher Loading Loading @@ -138,6 +140,16 @@ constructor( return Intent(Intent.ACTION_PICK).apply { setPackage(packageName) if (enableWidgetPickerSizeFilter()) { 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) ) } putExtra( AppWidgetManager.EXTRA_CATEGORY_FILTER, communalSettingsInteractor.communalWidgetCategories.value Loading @@ -163,6 +175,8 @@ constructor( companion object { private const val TAG = "CommunalEditModeViewModel" private const val EXTRA_DESIRED_WIDGET_WIDTH = "desired_widget_width" private const val EXTRA_DESIRED_WIDGET_HEIGHT = "desired_widget_height" private const val EXTRA_UI_SURFACE_KEY = "ui_surface" private const val EXTRA_UI_SURFACE_VALUE = "widgets_hub" const val EXTRA_ADDED_APP_WIDGETS_KEY = "added_app_widgets" Loading Loading
packages/SystemUI/aconfig/communal.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,13 @@ flag { description: "Enables the communal hub experience" bug: "304584416" } flag { name: "enable_widget_picker_size_filter" namespace: "communal" description: "Enables passing a size filter to the widget picker" bug: "345482907" metadata { purpose: PURPOSE_BUGFIX } }
packages/SystemUI/res/values/dimens.xml +4 −0 Original line number Diff line number Diff line Loading @@ -912,6 +912,10 @@ obvious when corner radii differ.--> <dimen name="communal_enforced_rounded_corner_max_radius">28dp</dimen> <!-- Width and height used to filter widgets displayed in the communal widget picker --> <dimen name="communal_widget_picker_desired_width">360dp</dimen> <dimen name="communal_widget_picker_desired_height">240dp</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> Loading
packages/SystemUI/src/com/android/systemui/communal/ui/viewmodel/CommunalEditModeViewModel.kt +14 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import android.content.res.Resources import android.util.Log import androidx.activity.result.ActivityResultLauncher import com.android.internal.logging.UiEventLogger import com.android.systemui.Flags.enableWidgetPickerSizeFilter import com.android.systemui.communal.domain.interactor.CommunalInteractor import com.android.systemui.communal.domain.interactor.CommunalSceneInteractor import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor Loading @@ -36,6 +37,7 @@ import com.android.systemui.log.core.Logger import com.android.systemui.log.dagger.CommunalLog import com.android.systemui.media.controls.ui.view.MediaHost import com.android.systemui.media.dagger.MediaModule import com.android.systemui.res.R import javax.inject.Inject import javax.inject.Named import kotlinx.coroutines.CoroutineDispatcher Loading Loading @@ -138,6 +140,16 @@ constructor( return Intent(Intent.ACTION_PICK).apply { setPackage(packageName) if (enableWidgetPickerSizeFilter()) { 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) ) } putExtra( AppWidgetManager.EXTRA_CATEGORY_FILTER, communalSettingsInteractor.communalWidgetCategories.value Loading @@ -163,6 +175,8 @@ constructor( companion object { private const val TAG = "CommunalEditModeViewModel" private const val EXTRA_DESIRED_WIDGET_WIDTH = "desired_widget_width" private const val EXTRA_DESIRED_WIDGET_HEIGHT = "desired_widget_height" private const val EXTRA_UI_SURFACE_KEY = "ui_surface" private const val EXTRA_UI_SURFACE_VALUE = "widgets_hub" const val EXTRA_ADDED_APP_WIDGETS_KEY = "added_app_widgets" Loading