Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31329478 authored by Shamali P's avatar Shamali P Committed by Shamali Patwa
Browse files

Limit number of items grouped on a row to 3.

With shortcuts this allows for more space to display two word title
below without ellipsizing it. (screen/4pJvcFFKJhooqZU)

Also let widget description show upto 3 lines to more of it to show
when stacked (screen/7xv8ng4H7iRLU79)

Bug: N/A
Flag: N/A
Test: Screenshot
Change-Id: Ia4e30f943f602b811e607d9cb52152f78cdc20e5
parent 545fe249
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@
                    android:gravity="center_horizontal"
                    android:textSize="@dimen/widget_cell_font_size"
                    android:textColor="?android:attr/textColorSecondary"
                    android:maxLines="2"
                    android:maxLines="3"
                    android:ellipsize="end"
                    android:fadingEdge="horizontal"
                    android:alpha="0.7" />
+3 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import java.util.stream.Collectors;

/** An utility class which groups {@link WidgetItem}s into a table. */
public final class WidgetsTableUtils {
    private static final int MAX_ITEMS_IN_ROW = 3;

    /**
     * Groups widgets in the following order:
@@ -125,7 +126,8 @@ public final class WidgetsTableUtils {
                widgetItemsAtRow.add(widgetItem);
                containerSizeForRow = containerSize;
                currentRowWidth = containerWidth;
            } else if ((currentRowWidth + containerWidth) <= rowPx
            } else if (widgetItemsAtRow.size() < MAX_ITEMS_IN_ROW
                    && (currentRowWidth + containerWidth) <= rowPx
                    && widgetItem.hasSameType(widgetItemsAtRow.get(numOfWidgetItems - 1))
                    && containerSize.equals(containerSizeForRow)) {
                // Group items in the same row if