Tune widget picker bottom sheet VisD for large screen
Test: Open widget picker by long pressing the home screen. Open app specific widget picker by long pressing an app icon that has widgets. Try both landscape and portrait, also on phone/tablet/foldable. Bug: 214215594 Change-Id: I7b4b3a8d7421f1d4df84d49a18b465693a17bd7b
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<!-- AllApps -->
|
||||
<dimen name="all_apps_top_padding">0dp</dimen>
|
||||
<!-- Widget picker-->
|
||||
<dimen name="widget_list_horizontal_margin">49dp</dimen>
|
||||
|
||||
<!-- Bottom sheet-->
|
||||
<dimen name="bottom_sheet_extra_top_padding">0dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
|
||||
<resources>
|
||||
<!-- AllApps -->
|
||||
<dimen name="all_apps_top_padding">300dp</dimen>
|
||||
<dimen name="all_apps_bottom_sheet_horizontal_padding">65dp</dimen>
|
||||
|
||||
<!-- Widget picker-->
|
||||
<dimen name="widget_list_horizontal_margin">30dp</dimen>
|
||||
|
||||
<!-- Bottom sheet-->
|
||||
<dimen name="bottom_sheet_extra_top_padding">300dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -94,7 +94,6 @@
|
||||
|
||||
<!-- All Apps -->
|
||||
<dimen name="all_apps_starting_vertical_translate">320dp</dimen>
|
||||
<dimen name="all_apps_top_padding">0dp</dimen>
|
||||
<dimen name="all_apps_search_bar_field_height">48dp</dimen>
|
||||
<!-- all_apps_search_bar_field_height / 2 -->
|
||||
<dimen name="all_apps_search_bar_content_overlap">24dp</dimen>
|
||||
@@ -368,6 +367,7 @@
|
||||
<dimen name="padded_rounded_button_padding">8dp</dimen>
|
||||
|
||||
<!-- Bottom sheet related parameters -->
|
||||
<dimen name="bottom_sheet_extra_top_padding">0dp</dimen>
|
||||
<dimen name="bottom_sheet_handle_width">32dp</dimen>
|
||||
<dimen name="bottom_sheet_handle_height">4dp</dimen>
|
||||
<dimen name="bottom_sheet_handle_margin">16dp</dimen>
|
||||
|
||||
@@ -175,6 +175,7 @@ public class DeviceProfile {
|
||||
public Point allAppsBorderSpacePx;
|
||||
public int allAppsShiftRange;
|
||||
public int allAppsTopPadding;
|
||||
public int bottomSheetTopPadding;
|
||||
public int allAppsCellHeightPx;
|
||||
public int allAppsCellWidthPx;
|
||||
public int allAppsIconSizePx;
|
||||
@@ -294,8 +295,11 @@ public class DeviceProfile {
|
||||
desiredWorkspaceHorizontalMarginPx = getHorizontalMarginPx(inv, res);
|
||||
desiredWorkspaceHorizontalMarginOriginalPx = desiredWorkspaceHorizontalMarginPx;
|
||||
|
||||
allAppsTopPadding = res.getDimensionPixelSize(R.dimen.all_apps_top_padding)
|
||||
+ (isTablet ? heightPx - availableHeightPx : 0);
|
||||
bottomSheetTopPadding = windowBounds.insets.top // statusbar height
|
||||
+ res.getDimensionPixelSize(R.dimen.bottom_sheet_extra_top_padding)
|
||||
+ (isTablet ? 0 : edgeMarginPx); // phones need edgeMarginPx additional padding
|
||||
|
||||
allAppsTopPadding = isTablet ? bottomSheetTopPadding : 0;
|
||||
allAppsShiftRange = isTablet
|
||||
? heightPx - allAppsTopPadding
|
||||
: res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate);
|
||||
|
||||
@@ -163,9 +163,8 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<Launcher>
|
||||
widthUsed = Math.max(widthUsed, minUsedWidth);
|
||||
}
|
||||
|
||||
int heightUsed = mInsets.top + deviceProfile.edgeMarginPx;
|
||||
measureChildWithMargins(mContent, widthMeasureSpec,
|
||||
widthUsed, heightMeasureSpec, heightUsed);
|
||||
widthUsed, heightMeasureSpec, deviceProfile.bottomSheetTopPadding);
|
||||
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
|
||||
MeasureSpec.getSize(heightMeasureSpec));
|
||||
}
|
||||
|
||||
@@ -96,8 +96,6 @@ public class WidgetsFullSheet extends BaseWidgetSheet
|
||||
private static final String KEY_WIDGETS_EDUCATION_DIALOG_SEEN =
|
||||
"launcher.widgets_education_dialog_seen";
|
||||
|
||||
private final Rect mInsets = new Rect();
|
||||
|
||||
private final UserManagerState mUserManagerState = new UserManagerState();
|
||||
|
||||
private final boolean mHasWorkProfile;
|
||||
|
||||
Reference in New Issue
Block a user