summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Robert Horvath <robhor@google.com> 2020-03-27 13:09:26 +0100
committer Robert Horvath <robhor@google.com> 2020-03-27 14:25:56 +0100
commitd6ce2ccac7d972f52d247507b373f952e152edf9 (patch)
tree68607aa960bd3a506f49b353eacfb6d2127294f8
parentc02e0d8cdf1308be1bf5511f7287930a355bd4c3 (diff)
Opaque background for shutdown UI on TV
The background of the shutdown UI was transparent. This lead to the text on the shutdown UI being hard to read, as text from underneath might shine through. This change makes the background of the shutdown UI opaque for TVs. Bug: 152509487 Test: flash build and then factory reset / reboot the device Change-Id: I620224b9c7b289fbf4db3ffec78007653bea0d71
-rw-r--r--packages/SystemUI/res/values-television/dimens.xml20
-rw-r--r--packages/SystemUI/res/values/dimens.xml3
-rw-r--r--packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java6
3 files changed, 26 insertions, 3 deletions
diff --git a/packages/SystemUI/res/values-television/dimens.xml b/packages/SystemUI/res/values-television/dimens.xml
new file mode 100644
index 000000000000..6da0c693f389
--- /dev/null
+++ b/packages/SystemUI/res/values-television/dimens.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2020 The Android Open Source Project
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License
+ -->
+<resources>
+ <!-- Opacity at which the background for the shutdown UI will be drawn. -->
+ <item name="shutdown_scrim_behind_alpha" format="float" type="dimen">1.0</item>
+</resources> \ No newline at end of file
diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml
index 432cd749abbd..85da9262d5f2 100644
--- a/packages/SystemUI/res/values/dimens.xml
+++ b/packages/SystemUI/res/values/dimens.xml
@@ -1265,4 +1265,7 @@
<dimen name="screenrecord_status_icon_radius">5dp</dimen>
<dimen name="kg_user_switcher_text_size">16sp</dimen>
+
+ <!-- Opacity at which the background for the shutdown UI will be drawn. -->
+ <item name="shutdown_scrim_behind_alpha" format="float" type="dimen">0.95</item>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
index 12955a153360..43584a52a871 100644
--- a/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsImpl.java
@@ -49,8 +49,6 @@ import dagger.Lazy;
public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks {
- private static final float SHUTDOWN_SCRIM_ALPHA = 0.95f;
-
private final Context mContext;
private final Lazy<GlobalActionsDialog> mGlobalActionsDialogLazy;
private final KeyguardStateController mKeyguardStateController;
@@ -153,7 +151,9 @@ public class GlobalActionsImpl implements GlobalActions, CommandQueue.Callbacks
mBlurUtils.applyBlur(d.getWindow().getDecorView().getViewRootImpl(),
mBlurUtils.blurRadiusOfRatio(1));
} else {
- background.setAlpha((int) (SHUTDOWN_SCRIM_ALPHA * 255));
+ float backgroundAlpha = mContext.getResources().getFloat(
+ com.android.systemui.R.dimen.shutdown_scrim_behind_alpha);
+ background.setAlpha((int) (backgroundAlpha * 255));
}
d.show();