Align items in the center within each table row within suggestions.
When differently-sized widgets OR widgets of same size but not filling space in previews are shown side by side, the top alignment looks odd. Besides, in the updated UX, we want them to be center aligned. Bug: 318410881 Bug: 319152349 Flag: N/A Test: Screenshot update in cl chain. Change-Id: I52cd7d6a1b5397a3c4c9dea8b072792b3211a8d3
This commit is contained in:
1 parent
772e0127c3
commit
933a05a2be
5 files changed
+39
-7
No files matched your search
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.launcher3.widget;
|
||||
|
||||
import static com.android.launcher3.Flags.enableCategorizedWidgetSuggestions;
|
||||
import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_BOTTOM_WIDGETS_TRAY;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -187,7 +188,13 @@ public class WidgetsBottomSheet extends BaseWidgetSheet {
|
||||
mWidgetCellHorizontalPadding)
|
||||
.forEach(row -> {
|
||||
TableRow tableRow = new TableRow(getContext());
|
||||
tableRow.setGravity(Gravity.TOP);
|
||||
if (enableCategorizedWidgetSuggestions()) {
|
||||
// Vertically center align items, so that even if they don't fill bounds,
|
||||
// they can look organized when placed together in a row.
|
||||
tableRow.setGravity(Gravity.CENTER_VERTICAL);
|
||||
} else {
|
||||
tableRow.setGravity(Gravity.TOP);
|
||||
}
|
||||
row.forEach(widgetItem -> {
|
||||
WidgetCell widget = addItemCell(tableRow);
|
||||
widget.applyFromCellItem(widgetItem);
|
||||
|
||||
Reference in new issue
Block a user