From 6fdc2035ea04aefc09d54a1943eef168ca270d6d Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Tue, 14 Jul 2015 16:52:35 -0700 Subject: Widget row should not be cut off on the right, when there is an indent b/22483452 Change-Id: I9d1cd8b71f4b6a4f75af420e9f54b73e9ae7527c --- src/com/android/launcher3/widget/WidgetsListAdapter.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/android/launcher3/widget/WidgetsListAdapter.java b/src/com/android/launcher3/widget/WidgetsListAdapter.java index d07c9553a..d2ea25230 100644 --- a/src/com/android/launcher3/widget/WidgetsListAdapter.java +++ b/src/com/android/launcher3/widget/WidgetsListAdapter.java @@ -163,13 +163,15 @@ public class WidgetsListAdapter extends Adapter { 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); } -- cgit v1.2.3