summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilip P. Moltmann <moltmann@google.com>2016-09-30 22:51:59 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-09-30 22:51:59 +0000
commit3f0e1b2966ab600e18da79b7dbc4b501e0a00446 (patch)
treef85ad78a9ec2d9f15917fc070187053186e94e4a /src
parent718db932c2ea1ce5b94f1c613adabc898312f789 (diff)
parentb4090d16e423700984d0a3e015938806bfd55327 (diff)
downloadandroid_packages_apps_PackageInstaller-3f0e1b2966ab600e18da79b7dbc4b501e0a00446.tar.gz
android_packages_apps_PackageInstaller-3f0e1b2966ab600e18da79b7dbc4b501e0a00446.tar.bz2
android_packages_apps_PackageInstaller-3f0e1b2966ab600e18da79b7dbc4b501e0a00446.zip
If the permission dialog would stick out, move it.
am: b4090d16e4 Change-Id: I605d0e80afe0057dc10fa022b68f04e6d6cc2460
Diffstat (limited to 'src')
-rw-r--r--src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java b/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
index a20c9523..0b07c806 100644
--- a/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
+++ b/src/com/android/packageinstaller/permission/ui/ManualLayoutFrame.java
@@ -61,8 +61,13 @@ public class ManualLayoutFrame extends ViewGroup {
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
+ // We want to keep the content bottom at the same place to avoid movement of the "Allow"
+ // button.
+ // Try to keep the content bottom at the same height. If this would move the dialog out of
+ // the top of the screen move it down as much as possible, then keep it at that position for
+ // the rest of the sequence of permission dialogs.
View content = getChildAt(0);
- if (mContentBottom == 0) {
+ if (mContentBottom == 0 || content.getMeasuredHeight() > mContentBottom) {
mContentBottom = (getMeasuredHeight() + content.getMeasuredHeight()) / 2;
}
final int contentLeft = (getMeasuredWidth() - content.getMeasuredWidth()) / 2;