summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
diff options
context:
space:
mode:
authorHaamed Gheibi <haamed@google.com>2022-03-09 12:05:14 -0800
committerWeijie Wang <quic_weijiew@quicinc.com>2022-03-15 15:38:25 +0800
commit12bb6d3cbf05cea529a165917c7430af607056f2 (patch)
treeff322630f9716306236ca70ecae1f265ae2aa2c6 /packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
parenta42412b7fc93a0eb852d8bf1a4d001f7df7f43b3 (diff)
Merge SP2A.220305.013
Bug: 220074017 Change-Id: Idfdd94e902f656ac65a2a75dfdd199f6f85ba472
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
index 62411dbff5fd..099dd5d82a10 100644
--- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
+++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java
@@ -27,8 +27,10 @@ import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
+import android.view.ViewGroup;
import android.widget.TextView;
+import com.android.internal.policy.SystemBarUtils;
import com.android.settingslib.Utils;
import com.android.systemui.R;
@@ -55,6 +57,8 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
private ColorStateList mNextMessageColorState = ColorStateList.valueOf(DEFAULT_COLOR);
private boolean mBouncerVisible;
private boolean mAltBouncerShowing;
+ private ViewGroup mContainer;
+ private int mTopMargin;
public KeyguardMessageArea(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -65,6 +69,24 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
}
@Override
+ protected void onAttachedToWindow() {
+ super.onAttachedToWindow();
+ mContainer = getRootView().findViewById(R.id.keyguard_message_area_container);
+ }
+
+ void onConfigChanged() {
+ final int newTopMargin = SystemBarUtils.getStatusBarHeight(getContext());
+ if (mTopMargin == newTopMargin) {
+ return;
+ }
+ mTopMargin = newTopMargin;
+ ViewGroup.MarginLayoutParams lp =
+ (ViewGroup.MarginLayoutParams) mContainer.getLayoutParams();
+ lp.topMargin = mTopMargin;
+ mContainer.setLayoutParams(lp);
+ }
+
+ @Override
public void setNextMessageColor(ColorStateList colorState) {
mNextMessageColorState = colorState;
}
@@ -153,6 +175,10 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp
colorState = mNextMessageColorState;
mNextMessageColorState = ColorStateList.valueOf(DEFAULT_COLOR);
}
+ if (mAltBouncerShowing) {
+ // alt bouncer has a black scrim, so always show the text in white
+ colorState = ColorStateList.valueOf(Color.WHITE);
+ }
setTextColor(colorState);
}