Fix the horizontal margins on the left panel in the two pane picker.
The recycler view when displayed in single pane picker, for large screen gets a larger padding. But when displayed in two pane picker, it is not needed - so we override it. Foldable's unfolded portrait doesn't seem to have screenshot test - will look into if we can add one in follow up. Bug: 322719955 Test: Screenshot test for existing modes & manual (see bug) Flag: ACONFIG com.android.launcher3.enable_unfolded_two_pane_picker DEVELOPMENT Change-Id: Ibd72146e7e5230eec0d2ce01c3917819a73d8f32
This commit is contained in:
@@ -72,14 +72,21 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
|
||||
|
||||
public BaseWidgetSheet(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
mContentHorizontalMargin = getResources().getDimensionPixelSize(
|
||||
R.dimen.widget_list_horizontal_margin);
|
||||
mContentHorizontalMargin = getWidgetListHorizontalMargin();
|
||||
mWidgetCellHorizontalPadding = getResources().getDimensionPixelSize(
|
||||
R.dimen.widget_cell_horizontal_padding);
|
||||
mNavBarScrimPaint = new Paint();
|
||||
mNavBarScrimPaint.setColor(Themes.getNavBarScrimColor(mActivityContext));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the margins to be applied to the left and right of the widget apps list.
|
||||
*/
|
||||
protected int getWidgetListHorizontalMargin() {
|
||||
return getResources().getDimensionPixelSize(
|
||||
R.dimen.widget_list_horizontal_margin);
|
||||
}
|
||||
|
||||
protected int getScrimColor(Context context) {
|
||||
return context.getResources().getColor(R.color.widgets_picker_scrim);
|
||||
}
|
||||
@@ -142,8 +149,7 @@ public abstract class BaseWidgetSheet extends AbstractSlideInView<BaseActivity>
|
||||
@Override
|
||||
public void setInsets(Rect insets) {
|
||||
mInsets.set(insets);
|
||||
@Px int contentHorizontalMargin = getResources().getDimensionPixelSize(
|
||||
R.dimen.widget_list_horizontal_margin);
|
||||
@Px int contentHorizontalMargin = getWidgetListHorizontalMargin();
|
||||
if (contentHorizontalMargin != mContentHorizontalMargin) {
|
||||
onContentHorizontalMarginChanged(contentHorizontalMargin);
|
||||
mContentHorizontalMargin = contentHorizontalMargin;
|
||||
|
||||
Reference in New Issue
Block a user