diff options
author | Pavel Grafov <pgrafov@google.com> | 2019-03-29 14:40:25 +0000 |
---|---|---|
committer | Pavel Grafov <pgrafov@google.com> | 2019-03-29 16:39:59 +0000 |
commit | 79852c74831be6af50f7b31d5447547a3a5d71c6 (patch) | |
tree | d48a2216674f8dc176571f93f032e8a1885471a9 /packages/VpnDialogs | |
parent | 38d503fe46436e6a92488d88088f2a43dab159f6 (diff) |
Make VPN key icon visible in dark theme.
Bug: 129463858
Test: manual
Change-Id: I423aeaf5296f53e44817b1a92138c3ba3dff0786
Diffstat (limited to 'packages/VpnDialogs')
-rw-r--r-- | packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java b/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java index 72ce9c4efdc0..989470fdb2e9 100644 --- a/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java +++ b/packages/VpnDialogs/src/com/android/vpndialogs/ConfirmDialog.java @@ -29,6 +29,7 @@ import android.os.UserManager; import android.text.Html; import android.text.Html.ImageGetter; import android.util.Log; +import android.util.TypedValue; import android.view.View; import android.widget.Button; import android.widget.TextView; @@ -111,8 +112,16 @@ public class ConfirmDialog extends AlertActivity @Override public Drawable getDrawable(String source) { // Should only reach this when fetching the VPN icon for the warning string. - Drawable icon = getDrawable(R.drawable.ic_vpn_dialog); + final Drawable icon = getDrawable(R.drawable.ic_vpn_dialog); icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight()); + + final TypedValue tv = new TypedValue(); + if (getTheme().resolveAttribute(android.R.attr.textColorPrimary, tv, true)) { + icon.setTint(getColor(tv.resourceId)); + } else { + Log.w(TAG, "Unable to resolve theme color"); + } + return icon; } |