Loading res/layout/widgets_bottom_sheet.xml +0 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" android:paddingTop="28dp" android:background="?android:attr/colorPrimary" android:elevation="@dimen/deep_shortcuts_elevation" Loading src/com/android/launcher3/widget/WidgetsBottomSheet.java +13 −4 Original line number Diff line number Diff line Loading @@ -133,10 +133,19 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab } } if (widgets.size() == 1) { // If there is only one widget, we want to center it instead of left-align. WidgetsBottomSheet.LayoutParams params = (WidgetsBottomSheet.LayoutParams) widgetRow.getLayoutParams(); params.gravity = widgets.size() == 1 ? Gravity.CENTER_HORIZONTAL : Gravity.START; params.gravity = Gravity.CENTER_HORIZONTAL; } else { // Otherwise, add an empty view to the start as padding (but still scroll edge to edge). View leftPaddingView = LayoutInflater.from(getContext()).inflate( R.layout.widget_list_divider, widgetRow, false); leftPaddingView.getLayoutParams().width = Utilities.pxFromDp( 16, getResources().getDisplayMetrics()); widgetCells.addView(leftPaddingView, 0); } } private void addDivider(ViewGroup parent) { Loading Loading
res/layout/widgets_bottom_sheet.xml +0 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingStart="16dp" android:paddingTop="28dp" android:background="?android:attr/colorPrimary" android:elevation="@dimen/deep_shortcuts_elevation" Loading
src/com/android/launcher3/widget/WidgetsBottomSheet.java +13 −4 Original line number Diff line number Diff line Loading @@ -133,10 +133,19 @@ public class WidgetsBottomSheet extends AbstractFloatingView implements Insettab } } if (widgets.size() == 1) { // If there is only one widget, we want to center it instead of left-align. WidgetsBottomSheet.LayoutParams params = (WidgetsBottomSheet.LayoutParams) widgetRow.getLayoutParams(); params.gravity = widgets.size() == 1 ? Gravity.CENTER_HORIZONTAL : Gravity.START; params.gravity = Gravity.CENTER_HORIZONTAL; } else { // Otherwise, add an empty view to the start as padding (but still scroll edge to edge). View leftPaddingView = LayoutInflater.from(getContext()).inflate( R.layout.widget_list_divider, widgetRow, false); leftPaddingView.getLayoutParams().width = Utilities.pxFromDp( 16, getResources().getDisplayMetrics()); widgetCells.addView(leftPaddingView, 0); } } private void addDivider(ViewGroup parent) { Loading