OSDN Git Service

[DO NOT MERGE] Fix widget tray clipping due to wrong padding
authorHyunyoung Song <hyunyoungs@google.com>
Mon, 14 Mar 2016 18:00:07 +0000 (11:00 -0700)
committerHyunyoung Song <hyunyoungs@google.com>
Mon, 14 Mar 2016 18:03:25 +0000 (18:03 +0000)
b/27380335
padding was set wrong when the widget view hierarchy was
being refactored in this CL: ag/870011

Change-Id: I003634acded2bbe204098c0e6fefff13d154b5d6
(cherry picked from commit 58e61ac216adbc3e4e211a428692dbeb54e78b45)

src/com/android/launcher3/widget/WidgetsContainerView.java

index 03410ed..10a00c6 100644 (file)
@@ -312,7 +312,15 @@ public class WidgetsContainerView extends BaseContainerView
     //
     @Override
     protected void onUpdateBgPadding(Rect padding, Rect bgPadding) {
-        mRecyclerView.updateBackgroundPadding(bgPadding);
+        if (Utilities.isRtl(getResources())) {
+            getContentView().setPadding(0, bgPadding.top,
+                    bgPadding.right, bgPadding.bottom);
+            mRecyclerView.updateBackgroundPadding(new Rect(bgPadding.left, 0, 0, 0));
+        } else {
+            getContentView().setPadding(bgPadding.left, bgPadding.top,
+                    0, bgPadding.bottom);
+            mRecyclerView.updateBackgroundPadding(new Rect(0, 0, bgPadding.right, 0));
+        }
     }
 
     /**