Loading src/com/android/launcher3/widget/BaseWidgetSheet.java +2 −15 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.launcher3.widget; import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.Flags.enableCategorizedWidgetSuggestions; import static com.android.launcher3.Flags.enableUnfoldedTwoPanePicker; import static com.android.launcher3.Flags.enableWidgetTapToAdd; import static com.android.launcher3.LauncherPrefs.WIDGETS_EDUCATION_TIP_SEEN; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGET_ADD_BUTTON_TAP; Loading Loading @@ -320,19 +318,8 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity> MeasureSpec.getSize(heightMeasureSpec)); } private int getTabletHorizontalMargin(DeviceProfile deviceProfile) { // All bottom-sheets showing widgets will be full-width across all devices. if (enableCategorizedWidgetSuggestions()) { return 0; } if (deviceProfile.isLandscape && !deviceProfile.isTwoPanels) { return getResources().getDimensionPixelSize( R.dimen.widget_picker_landscape_tablet_left_right_margin); } if (deviceProfile.isTwoPanels && enableUnfoldedTwoPanePicker()) { return getResources().getDimensionPixelSize( R.dimen.widget_picker_two_panels_left_right_margin); } /** Returns the horizontal margins to be applied to the widget sheet. **/ protected int getTabletHorizontalMargin(DeviceProfile deviceProfile) { return deviceProfile.allAppsLeftRightMargin; } Loading src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java +21 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.widget.ScrollView; import androidx.annotation.NonNull; import androidx.annotation.Px; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.model.data.PackageItemInfo; Loading Loading @@ -154,6 +155,26 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { mFastScroller.setVisibility(GONE); } @Override protected int getTabletHorizontalMargin(DeviceProfile deviceProfile) { if (enableCategorizedWidgetSuggestions()) { // two pane picker is full width for fold as well as tablet. return getResources().getDimensionPixelSize( R.dimen.widget_picker_two_panels_left_right_margin); } if (deviceProfile.isTwoPanels && enableUnfoldedTwoPanePicker()) { // enableUnfoldedTwoPanePicker made two pane picker full-width for fold only. return getResources().getDimensionPixelSize( R.dimen.widget_picker_two_panels_left_right_margin); } if (deviceProfile.isLandscape && !deviceProfile.isTwoPanels) { // non-fold tablet landscape margins (ag/22163531) return getResources().getDimensionPixelSize( R.dimen.widget_picker_landscape_tablet_left_right_margin); } return deviceProfile.allAppsLeftRightMargin; } @Override protected void onUserSwipeToDismissProgressChanged() { super.onUserSwipeToDismissProgressChanged(); Loading Loading
src/com/android/launcher3/widget/BaseWidgetSheet.java +2 −15 Original line number Diff line number Diff line Loading @@ -16,8 +16,6 @@ package com.android.launcher3.widget; import static com.android.app.animation.Interpolators.EMPHASIZED; import static com.android.launcher3.Flags.enableCategorizedWidgetSuggestions; import static com.android.launcher3.Flags.enableUnfoldedTwoPanePicker; import static com.android.launcher3.Flags.enableWidgetTapToAdd; import static com.android.launcher3.LauncherPrefs.WIDGETS_EDUCATION_TIP_SEEN; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WIDGET_ADD_BUTTON_TAP; Loading Loading @@ -320,19 +318,8 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity> MeasureSpec.getSize(heightMeasureSpec)); } private int getTabletHorizontalMargin(DeviceProfile deviceProfile) { // All bottom-sheets showing widgets will be full-width across all devices. if (enableCategorizedWidgetSuggestions()) { return 0; } if (deviceProfile.isLandscape && !deviceProfile.isTwoPanels) { return getResources().getDimensionPixelSize( R.dimen.widget_picker_landscape_tablet_left_right_margin); } if (deviceProfile.isTwoPanels && enableUnfoldedTwoPanePicker()) { return getResources().getDimensionPixelSize( R.dimen.widget_picker_two_panels_left_right_margin); } /** Returns the horizontal margins to be applied to the widget sheet. **/ protected int getTabletHorizontalMargin(DeviceProfile deviceProfile) { return deviceProfile.allAppsLeftRightMargin; } Loading
src/com/android/launcher3/widget/picker/WidgetsTwoPaneSheet.java +21 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.widget.ScrollView; import androidx.annotation.NonNull; import androidx.annotation.Px; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.model.data.PackageItemInfo; Loading Loading @@ -154,6 +155,26 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet { mFastScroller.setVisibility(GONE); } @Override protected int getTabletHorizontalMargin(DeviceProfile deviceProfile) { if (enableCategorizedWidgetSuggestions()) { // two pane picker is full width for fold as well as tablet. return getResources().getDimensionPixelSize( R.dimen.widget_picker_two_panels_left_right_margin); } if (deviceProfile.isTwoPanels && enableUnfoldedTwoPanePicker()) { // enableUnfoldedTwoPanePicker made two pane picker full-width for fold only. return getResources().getDimensionPixelSize( R.dimen.widget_picker_two_panels_left_right_margin); } if (deviceProfile.isLandscape && !deviceProfile.isTwoPanels) { // non-fold tablet landscape margins (ag/22163531) return getResources().getDimensionPixelSize( R.dimen.widget_picker_landscape_tablet_left_right_margin); } return deviceProfile.allAppsLeftRightMargin; } @Override protected void onUserSwipeToDismissProgressChanged() { super.onUserSwipeToDismissProgressChanged(); Loading