Update OMS patches
[GitHub/Stricted/android_vendor_extra.git] / patches / frameworks / base / 0016-SystemUI-Expose-QS-edit-item-decoration-background-c.patch
1 From 7cffd2c8451b327dced0bf6abcb81b4626d4f0a9 Mon Sep 17 00:00:00 2001
2 From: Ivan Iskandar <iiiiskandar14@gmail.com>
3 Date: Sun, 18 Sep 2016 21:33:18 +0700
4 Subject: [PATCH 16/43] SystemUI: Expose QS edit item decoration background
5 color
6
7 PS2:
8 More descriptive color name
9
10 @nathanchance edit: updated for 7.1 Nougat
11
12 Change-Id: I9867ca26e7d9dacad37d2b70180a98fede0fb0e8
13 ---
14 packages/SystemUI/res/values/projekt_colors.xml | 2 ++
15 .../SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java | 6 ++++--
16 2 files changed, 6 insertions(+), 2 deletions(-)
17
18 diff --git a/packages/SystemUI/res/values/projekt_colors.xml b/packages/SystemUI/res/values/projekt_colors.xml
19 index a0f1df06b6a..42f4a1568df 100644
20 --- a/packages/SystemUI/res/values/projekt_colors.xml
21 +++ b/packages/SystemUI/res/values/projekt_colors.xml
22 @@ -18,4 +18,6 @@
23 <resources>
24 <!-- Navigation button ripple color -->
25 <color name="navbutton_ripple_color">#FFFFFFFF</color>
26 + <!-- QS edit page background color -->
27 + <color name="qs_edit_item_decoration_bg">@*android:color/secondary_device_default_settings</color>
28 </resources>
29 diff --git a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
30 index 8d7f6ee7285..c7a1441a6b3 100644
31 --- a/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
32 +++ b/packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java
33 @@ -471,11 +471,10 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
34 private TileItemDecoration(Context context) {
35 TypedArray ta =
36 context.obtainStyledAttributes(new int[]{android.R.attr.colorSecondary});
37 - mDrawable = new ColorDrawable(ta.getColor(0, 0));
38 + mDrawable = new ColorDrawable();
39 ta.recycle();
40 }
41
42 -
43 @Override
44 public void onDraw(Canvas c, RecyclerView parent, State state) {
45 super.onDraw(c, parent, state);
46 @@ -494,6 +493,9 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
47 .getLayoutParams();
48 final int top = child.getTop() + params.topMargin +
49 Math.round(ViewCompat.getTranslationY(child));
50 + // Set drawable color
51 + mDrawable.setColor(mContext.getResources().getColor(
52 + R.color.qs_edit_item_decoration_bg));
53 // Draw full width, in case there aren't tiles all the way across.
54 mDrawable.setBounds(0, top, width, bottom);
55 mDrawable.draw(c);
56 --
57 2.11.1
58