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

Commit 321dea13 authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "Widget row should not be cut off on the right, when there is an indent"...

Merge "Widget row should not be cut off on the right, when there is an indent" into ub-launcher3-burnaby
parents 2a1be7a6 6fdc2035
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -163,13 +163,15 @@ public class WidgetsListAdapter extends Adapter<WidgetsRowViewHolder> {
        ViewGroup container = (ViewGroup) mLayoutInflater.inflate(
                R.layout.widgets_list_row_view, parent, false);
        LinearLayout cellList = (LinearLayout) container.findViewById(R.id.widgets_cell_list);
        MarginLayoutParams lp = (MarginLayoutParams) cellList.getLayoutParams();

        // if the end padding is 0, then container view (horizontal scroll view) doesn't respect
        // the end of the linear layout width + the start padding and doesn't allow scrolling.
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
            lp.setMarginStart(mIndent);
            cellList.setPaddingRelative(mIndent, 0, 1, 0);
        } else {
            lp.leftMargin = mIndent;
            cellList.setPadding(mIndent, 0, 1, 0);
        }
        cellList.setLayoutParams(lp);

        return new WidgetsRowViewHolder(container);
    }