summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Colonna <bcolonna@google.com>2012-10-30 18:34:39 -0400
committerBrian Colonna <bcolonna@google.com>2012-10-30 18:34:39 -0400
commitddbf138d11d9ad4fa9ec871b2fc5862dad20f02c (patch)
tree2ec400ec5be1fcaf72d134aacc50fc464411be4a
parent68d257d788f5154922cd605ab8079a5c0815dffc (diff)
downloadframeworks_base-ddbf138d11d9ad4fa9ec871b2fc5862dad20f02c.zip
frameworks_base-ddbf138d11d9ad4fa9ec871b2fc5862dad20f02c.tar.gz
frameworks_base-ddbf138d11d9ad4fa9ec871b2fc5862dad20f02c.tar.bz2
Fixed misplacement of cancel(X) button for Face Unlock
Before the FUL service started, the FUL cancel button was positioned off of the right side of the window. This was because the FaceUnlockView (derived from RelativeLayout) was calling super.onMeasure() incorrectly, preventing it from using the new 'square' size when laying out child views. Change-Id: I2f1e86617da5c8f37123febab2e433288bdea062
-rw-r--r--core/java/com/android/internal/widget/FaceUnlockView.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/java/com/android/internal/widget/FaceUnlockView.java b/core/java/com/android/internal/widget/FaceUnlockView.java
index c8d65fc..e3c1247 100644
--- a/core/java/com/android/internal/widget/FaceUnlockView.java
+++ b/core/java/com/android/internal/widget/FaceUnlockView.java
@@ -53,15 +53,17 @@ public class FaceUnlockView extends RelativeLayout {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-
final int minimumWidth = getSuggestedMinimumWidth();
final int minimumHeight = getSuggestedMinimumHeight();
int viewWidth = resolveMeasured(widthMeasureSpec, minimumWidth);
int viewHeight = resolveMeasured(heightMeasureSpec, minimumHeight);
- viewWidth = viewHeight = Math.min(viewWidth, viewHeight);
- Log.v(TAG, "FaceUnlockView dimensions: " + viewWidth + "x" + viewHeight);
- setMeasuredDimension(viewWidth, viewHeight);
+ final int chosenSize = Math.min(viewWidth, viewHeight);
+ final int newWidthMeasureSpec =
+ MeasureSpec.makeMeasureSpec(chosenSize, MeasureSpec.AT_MOST);
+ final int newHeightMeasureSpec =
+ MeasureSpec.makeMeasureSpec(chosenSize, MeasureSpec.AT_MOST);
+
+ super.onMeasure(newWidthMeasureSpec, newHeightMeasureSpec);
}
}