summaryrefslogtreecommitdiffstats
path: root/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2016-01-14 22:55:02 -0800
committerBrian Carlstrom <bdc@google.com>2016-01-14 22:55:02 -0800
commit3ed860add8b83a9d69d7726bc636b8486a70039f (patch)
treed5376c26c431c5c678fdc06a03d13096d85d76f2 /src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
parentc23d802958158d522e7350321ad9ac6d43013883 (diff)
downloadandroid_packages_apps_PackageInstaller-3ed860add8b83a9d69d7726bc636b8486a70039f.tar.gz
android_packages_apps_PackageInstaller-3ed860add8b83a9d69d7726bc636b8486a70039f.tar.bz2
android_packages_apps_PackageInstaller-3ed860add8b83a9d69d7726bc636b8486a70039f.zip
Revert "Make request permissions dialog layout robost"
This reverts commit ecaeae17f52d6562d23dfec91e44bc3c0b4a6d13.
Diffstat (limited to 'src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java')
-rw-r--r--src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java b/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
index 1af400b3..c9ccf9c1 100644
--- a/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
+++ b/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
@@ -17,6 +17,7 @@ package com.android.packageinstaller.permission.ui;
import android.content.Context;
import android.util.AttributeSet;
+import android.view.View;
import android.widget.FrameLayout;
/**
@@ -26,10 +27,13 @@ import android.widget.FrameLayout;
* but allows the view to grow downwards for animation.
*/
public class ManualLayoutFrame extends FrameLayout {
+
private int mDesiredHeight;
private int mHeight;
private int mWidth;
+ private View mOffsetView;
+
public ManualLayoutFrame(Context context, AttributeSet attrs) {
super(context, attrs);
setClipChildren(false);
@@ -43,29 +47,10 @@ public class ManualLayoutFrame extends FrameLayout {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mWidth != 0) {
- int newWidth = mWidth;
- final int widthMode = MeasureSpec.getMode(widthMeasureSpec);
- switch (widthMode) {
- case MeasureSpec.AT_MOST: {
- newWidth = Math.min(mWidth, MeasureSpec.getSize(widthMeasureSpec));
- } break;
- case MeasureSpec.EXACTLY: {
- newWidth = MeasureSpec.getSize(widthMeasureSpec);
- } break;
- }
- // If the width changes we have to re-evaluate the height
- if (newWidth != mWidth) {
- mWidth = newWidth;
- mHeight = 0;
- }
+ // Keep the width constant to avoid weirdness.
widthMeasureSpec = MeasureSpec.makeMeasureSpec(mWidth, MeasureSpec.EXACTLY);
}
-
- // Let the content measure how much it needs to be fully shown
- heightMeasureSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
-
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
-
mDesiredHeight = getMeasuredHeight();
if (mHeight == 0 && mDesiredHeight != 0) {
// Record the first non-zero width and height, this will be the height henceforth.