diff --git a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml index a946318cb3136..0a2d226a33eb0 100644 --- a/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml +++ b/packages/SystemUI/res-keyguard/layout/keyguard_pin_view.xml @@ -16,7 +16,6 @@ ** limitations under the License. */ --> - - - 3dp - 0dp + 2dp 2dp 26dp 0dp diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java index 099dd5d82a100..a7840cbf2789b 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageArea.java @@ -18,6 +18,7 @@ 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; @@ -58,7 +59,8 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp private boolean mBouncerVisible; private boolean mAltBouncerShowing; private ViewGroup mContainer; - private int mTopMargin; + private int mContainerTopMargin; + private int mLastOrientation = -1; public KeyguardMessageArea(Context context, AttributeSet attrs) { super(context, attrs); @@ -74,16 +76,28 @@ public class KeyguardMessageArea extends TextView implements SecurityMessageDisp mContainer = getRootView().findViewById(R.id.keyguard_message_area_container); } - void onConfigChanged() { + void onConfigChanged(Configuration newConfig) { final int newTopMargin = SystemBarUtils.getStatusBarHeight(getContext()); - if (mTopMargin == newTopMargin) { - return; - } - mTopMargin = newTopMargin; - ViewGroup.MarginLayoutParams lp = + if (mContainerTopMargin != newTopMargin) { + mContainerTopMargin = newTopMargin; + ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) mContainer.getLayoutParams(); - lp.topMargin = mTopMargin; - mContainer.setLayoutParams(lp); + 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); + } } @Override diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java index 05318bb0df784..659aadd696144 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java @@ -50,7 +50,7 @@ public class KeyguardMessageAreaController extends ViewController