Update OMS patches
[GitHub/Stricted/android_vendor_extra.git] / patches / frameworks / base / 0015-Themes-Allow-Navbar-ripple-color-to-be-themed.patch
1 From 511aee76b3b17988444d06b27fbd0c0e0751fdd7 Mon Sep 17 00:00:00 2001
2 From: Dave Kover <dkover@cyngn.com>
3 Date: Thu, 14 Apr 2016 10:19:13 +0700
4 Subject: [PATCH 15/43] Themes: Allow Navbar ripple color to be themed
5
6 PS1:
7 Layers Commit by @setiawanjimmy
8 Rewrite of commit by: KreAch3R
9 Original commit by: Dave Kover
10 Distilled from: https://github.com/CyanogenMod/android_frameworks_base/commit/05ce0a6f5651743add398556d557a5f4c40c2503
11
12 Change-Id: I7969e952d7e08f1d12e89291512312421585b70f
13 ---
14 packages/SystemUI/res/values/projekt_colors.xml | 21 +++++++++++++++++++++
15 .../systemui/statusbar/policy/KeyButtonRipple.java | 5 ++++-
16 2 files changed, 25 insertions(+), 1 deletion(-)
17 create mode 100644 packages/SystemUI/res/values/projekt_colors.xml
18
19 diff --git a/packages/SystemUI/res/values/projekt_colors.xml b/packages/SystemUI/res/values/projekt_colors.xml
20 new file mode 100644
21 index 00000000000..a0f1df06b6a
22 --- /dev/null
23 +++ b/packages/SystemUI/res/values/projekt_colors.xml
24 @@ -0,0 +1,21 @@
25 +<?xml version="1.0" encoding="utf-8"?>
26 +<!--
27 + Copyright (c) 2016 Projekt Substratum
28 +
29 + Licensed under the Apache License, Version 2.0 (the "License");
30 + you may not use this file except in compliance with the License.
31 + You may obtain a copy of the License at
32 +
33 + http://www.apache.org/licenses/LICENSE-2.0
34 +
35 + Unless required by applicable law or agreed to in writing, software
36 + distributed under the License is distributed on an "AS IS" BASIS,
37 + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
38 + See the License for the specific language governing permissions and
39 + limitations under the License.
40 +-->
41 +
42 +<resources>
43 + <!-- Navigation button ripple color -->
44 + <color name="navbutton_ripple_color">#FFFFFFFF</color>
45 +</resources>
46 diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java
47 index 57e092a2603..2579579b0e7 100644
48 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java
49 +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonRipple.java
50 @@ -65,16 +65,19 @@ public class KeyButtonRipple extends Drawable {
51 private final HashSet<Animator> mRunningAnimations = new HashSet<>();
52 private final ArrayList<Animator> mTmpArray = new ArrayList<>();
53
54 + private int mRippleColor;
55 +
56 public KeyButtonRipple(Context ctx, View targetView) {
57 mMaxWidth = ctx.getResources().getDimensionPixelSize(R.dimen.key_button_ripple_max_width);
58 mTargetView = targetView;
59 + mRippleColor = ctx.getResources().getColor(R.color.navbutton_ripple_color);
60 }
61
62 private Paint getRipplePaint() {
63 if (mRipplePaint == null) {
64 mRipplePaint = new Paint();
65 mRipplePaint.setAntiAlias(true);
66 - mRipplePaint.setColor(0xffffffff);
67 + mRipplePaint.setColor(mRippleColor);
68 }
69 return mRipplePaint;
70 }
71 --
72 2.11.1
73