summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/widget
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2015-07-15 00:09:38 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-07-15 00:09:38 +0000
commiteaa3750a019083ebbc836e3742f8f24fa0dfa8a8 (patch)
treea6ca2cb2756618b0931a8d15bca6904cf0165995 /src/com/android/launcher3/widget
parent2f824acaabf158d389f1ed5561bfc0f90a49dfa5 (diff)
parent321dea1346ba6e0e49a0cfc49b9303f3d7cfe303 (diff)
downloadandroid_packages_apps_Trebuchet-eaa3750a019083ebbc836e3742f8f24fa0dfa8a8.tar.gz
android_packages_apps_Trebuchet-eaa3750a019083ebbc836e3742f8f24fa0dfa8a8.tar.bz2
android_packages_apps_Trebuchet-eaa3750a019083ebbc836e3742f8f24fa0dfa8a8.zip
am 321dea13: Merge "Widget row should not be cut off on the right, when there is an indent" into ub-launcher3-burnaby
* commit '321dea1346ba6e0e49a0cfc49b9303f3d7cfe303': Widget row should not be cut off on the right, when there is an indent
Diffstat (limited to 'src/com/android/launcher3/widget')
-rw-r--r--src/com/android/launcher3/widget/WidgetsListAdapter.java10
1 files changed, 6 insertions, 4 deletions
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<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);
}