diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java index 87e853cf64d7..099dd5d82a10 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java @@ -18,7 +18,6 @@ package com.android.keyguard; import android.content.Context; import android.content.res.ColorStateList; -import android.content.res.Configuration; import android.content.res.TypedArray; import android.graphics.Color; import android.os.Handler; @@ -31,8 +30,6 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; -import androidx.annotation.Nullable; - import com.android.internal.policy.SystemBarUtils; import com.android.settingslib.Utils; import com.android.systemui.R; @@ -60,14 +57,8 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp private ColorStateList mNextMessageColorState = ColorStateList.valueOf(DEFAULT_COLOR); private boolean mBouncerVisible; private boolean mAltBouncerShowing; - /** - * Container that wraps the KeyguardMessageArea - may be null if current view hierarchy doesn't - * contain {@link R.id.keyguard_message_area_container}. - */ - @Nullable private ViewGroup mContainer; - private int mContainerTopMargin; - private int mLastOrientation = -1; + private int mTopMargin; public KeyguardMessageArea(Context context, AttributeSet attrs) { super(context, attrs); @@ -83,31 +74,16 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp mContainer = getRootView().findViewById(R.id.keyguard_message_area_container); } - void onConfigChanged(Configuration newConfig) { - if (mContainer == null) { + void onConfigChanged() { + final int newTopMargin = SystemBarUtils.getStatusBarHeight(getContext()); + if (mTopMargin == newTopMargin) { return; } - final int newTopMargin = SystemBarUtils.getStatusBarHeight(getContext()); - if (mContainerTopMargin != newTopMargin) { - mContainerTopMargin = newTopMargin; - ViewGroup.MarginLayoutParams lp = + mTopMargin = newTopMargin; + ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mContainer.getLayoutParams(); - lp.topMargin = mContainerTopMargin; - mContainer.setLayoutParams(lp); - } - - if (mLastOrientation != newConfig.orientation) { - mLastOrientation = newConfig.orientation; - int messageAreaTopMargin = 0; - if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) { - messageAreaTopMargin = mContext.getResources().getDimensionPixelSize( - R.dimen.keyguard_lock_padding); - } - - ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) getLayoutParams(); - lp.topMargin = messageAreaTopMargin; - setLayoutParams(lp); - } + lp.topMargin = mTopMargin; + mContainer.setLayoutParams(lp); } @Override |