mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-05 02:16:49 +00:00
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:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.android.launcher3.widget.picker;
|
||||
|
||||
import static com.android.launcher3.Flags.enableCategorizedWidgetSuggestions;
|
||||
import static com.android.launcher3.Flags.enableUnfoldedTwoPanePicker;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -308,15 +309,25 @@ public class WidgetsTwoPaneSheet extends WidgetsFullSheet {
|
||||
if (mSuggestedWidgetsHeader != null) {
|
||||
mSuggestedWidgetsHeader.setExpanded(false);
|
||||
}
|
||||
|
||||
WidgetsListContentEntry contentEntryToBind;
|
||||
if (enableCategorizedWidgetSuggestions()) {
|
||||
// Setting max span size enables row to understand how to fit more than one item
|
||||
// in a row.
|
||||
contentEntryToBind = contentEntry.withMaxSpanSize(mMaxSpanPerRow);
|
||||
} else {
|
||||
contentEntryToBind = contentEntry;
|
||||
}
|
||||
|
||||
WidgetsRowViewHolder widgetsRowViewHolder =
|
||||
mWidgetsListTableViewHolderBinder.newViewHolder(mRightPane);
|
||||
mWidgetsListTableViewHolderBinder.bindViewHolder(widgetsRowViewHolder,
|
||||
contentEntry,
|
||||
contentEntryToBind,
|
||||
ViewHolderBinder.POSITION_FIRST | ViewHolderBinder.POSITION_LAST,
|
||||
Collections.EMPTY_LIST);
|
||||
widgetsRowViewHolder.mDataCallback = data -> {
|
||||
mWidgetsListTableViewHolderBinder.bindViewHolder(widgetsRowViewHolder,
|
||||
contentEntry,
|
||||
contentEntryToBind,
|
||||
ViewHolderBinder.POSITION_FIRST | ViewHolderBinder.POSITION_LAST,
|
||||
Collections.singletonList(data));
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user