Merge "Tune widget picker bottom sheet VisD for large screen" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
b66fc8b145
@@ -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