Skip to content

Commit c717d11

Browse files
adampAndroid (Google) Code Review
authored andcommitted
Merge "Fix keyguard measurement bugs" into jb-mr1-lockscreen-dev
2 parents de974f6 + eeb6255 commit c717d11

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardSecurityViewFlipper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ protected void onMeasure(int widthSpec, int heightSpec) {
219219

220220
child.measure(childWidthSpec, childHeightSpec);
221221

222-
width = Math.max(width, Math.min(child.getMeasuredWidth(), widthSize));
223-
height = Math.max(height, Math.min(child.getMeasuredHeight(), heightSize));
222+
width = Math.max(width, Math.min(child.getMeasuredWidth(), widthSize - wPadding));
223+
height = Math.max(height, Math.min(child.getMeasuredHeight(), heightSize - hPadding));
224224
}
225-
setMeasuredDimension(width, height);
225+
setMeasuredDimension(width + wPadding, height + hPadding);
226226
}
227227

228228
private int makeChildMeasureSpec(int maxSize, int childDimen) {

policy/src/com/android/internal/policy/impl/keyguard/MultiPaneChallengeLayout.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ private void layoutWithGravity(int width, int height, View child, Rect padding,
363363
adjustedWidth = (int) (paddedWidth * lp.centerWithinArea + 0.5f);
364364
adjustedHeight = height;
365365
} else if (fixedLayoutVertical) {
366-
final int paddedHeight = height - padding.top - padding.bottom;
366+
final int paddedHeight = height - getPaddingTop() - getPaddingBottom();
367367
adjustedWidth = width;
368368
adjustedHeight = (int) (paddedHeight * lp.centerWithinArea + 0.5f);
369369
} else {

0 commit comments

Comments
 (0)