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

Commit 26fe1e91 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7414767 from 01615901 to sc-release

Change-Id: I7786cc45b8fa5f655a3a2858fed24a3b124df4a7
parents 87f6ca03 01615901
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -326,9 +326,13 @@ public class OptionSelectorController<T extends CustomizationOption<T>> {
            int spaceBetweenItems = availableWidth
                    - Math.round(widthPerItem * LINEAR_LAYOUT_HORIZONTAL_DISPLAY_OPTIONS_MAX)
                    - mContainer.getPaddingLeft();
            mContainer.addItemDecoration(new HorizontalBehindSpaceItemDecoration(
                    mContainer.getContext(),
                    spaceBetweenItems / (int) LINEAR_LAYOUT_HORIZONTAL_DISPLAY_OPTIONS_MAX));
            int itemEndMargin =
                    spaceBetweenItems / (int) LINEAR_LAYOUT_HORIZONTAL_DISPLAY_OPTIONS_MAX;
            if (itemEndMargin <= 0) {
                itemEndMargin = res.getDimensionPixelOffset(R.dimen.option_tile_margin_horizontal);
            }
            mContainer.addItemDecoration(new ItemEndHorizontalSpaceItemDecoration(
                    mContainer.getContext(), itemEndMargin));
            return;
        }

@@ -437,12 +441,12 @@ public class OptionSelectorController<T extends CustomizationOption<T>> {
    }

    /** Custom ItemDecorator to add specific spacing between items in the list. */
    private static final class HorizontalBehindSpaceItemDecoration
    private static final class ItemEndHorizontalSpaceItemDecoration
            extends RecyclerView.ItemDecoration {
        private final int mHorizontalSpacePx;
        private final boolean mDirectionLTR;

        private HorizontalBehindSpaceItemDecoration(Context context, int horizontalSpacePx) {
        private ItemEndHorizontalSpaceItemDecoration(Context context, int horizontalSpacePx) {
            mDirectionLTR = context.getResources().getConfiguration().getLayoutDirection()
                    == View.LAYOUT_DIRECTION_LTR;
            mHorizontalSpacePx = horizontalSpacePx;