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

Commit 4a3a1d6c authored by Wesley.CW Wang's avatar Wesley.CW Wang Committed by Michael W
Browse files

Refine style picker layout (1/2)

 - Change options border to 8dp, https://docs.google.com/presentation/d/15JadcGi5k1_0znUN_XdFpU7UxeXwxjK3Y7LxvhW5ETM/edit?ts=5eb5f9a8#slide=id.g777aaff414_1_0
 - Fix the options will be truncated when display size large,
 before: https://screenshot.googleplex.com/j1GckxT9fxU.png
 after: https://screenshot.googleplex.com/LMEzQwjz2Vc.png

Change-Id: Id238bb1c0c31471c43f50c4ff0e2a37f6b24dd61
parent 8dfb6641
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@
    <item android:id="@android:id/mask">
        <shape android:shape="rectangle">
            <solid android:color="@android:color/white"/>
            <corners android:radius="4dp" />
            <corners android:radius="8dp" />
        </shape>
    </item>
    <item android:drawable="@drawable/option_border_edge_custom" />
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@
            <stroke
                android:color="@color/option_border_color"
                android:width="@dimen/option_selected_border_width" />
            <corners android:radius="4dp" />
            <corners android:radius="8dp" />
        </shape>
    </item>
    <item android:state_activated="false">
@@ -29,7 +29,7 @@
                android:color="@color/black_24_alpha"
                android:alpha="0.24"
                android:width="@dimen/option_border_width" />
            <corners android:radius="4dp" />
            <corners android:radius="8dp" />
        </shape>
    </item>
</selector>
+4 −0
Original line number Diff line number Diff line
@@ -245,6 +245,10 @@ public class OptionSelectorController<T extends CustomizationOption<T>> {
            int numColumns = res.getInteger(R.integer.options_grid_num_columns);
            int widthPerItem = totalWidth / mAdapter.getItemCount();
            int extraSpace = availableWidth - widthPerItem * numColumns;
            while (extraSpace < 0) {
                numColumns -= 1;
                extraSpace = availableWidth - widthPerItem * numColumns;
            }
            int containerSidePadding = extraSpace / (numColumns + 1);
            mContainer.setLayoutManager(new GridLayoutManager(mContainer.getContext(), numColumns));
            mContainer.setPaddingRelative(containerSidePadding, 0, containerSidePadding, 0);