diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2016-01-20 18:06:28 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2016-01-21 02:53:09 +0000 |
commit | 9199155a7f5643e6a07a626973f892e05c7c5bd7 (patch) | |
tree | f0d8068d020a667cf725aa079e010390c579db53 /res | |
parent | 6e1457c742294d9886b8b650b0e9db494a3d7139 (diff) | |
download | android_packages_apps_PackageInstaller-9199155a7f5643e6a07a626973f892e05c7c5bd7.tar.gz android_packages_apps_PackageInstaller-9199155a7f5643e6a07a626973f892e05c7c5bd7.tar.bz2 android_packages_apps_PackageInstaller-9199155a7f5643e6a07a626973f892e05c7c5bd7.zip |
Make the permission request dialog's layout robust
The old implementation was relying on a fixed window size
where the content is positioned by a custom layout manager.
It is possible however that subsequent permissions requests
do not fit in the window as its size is computed based on
the content of the first permissions request. There were
also cases where the content is chopped after a rotation
as the dialog size width was not re-evaluated while it should
be. Further, animation from one permission request state
to another was not properly done resulting in content
being chopped off in some cases.
The current approach is to have a dialog width for the
content activity but the height is as tall as the screen
allowing us to fit arbitrary large permission request
content. Also we are resetting the fixed width on a
configuration change so the dialog is robust to adjust
size as needed.
bug:24679384
bug:25755378
Change-Id: I4d23f81d8e59ce23bf9a27155ebb5ec6e2e6752c
(cherry picked from commit c6dc4bb52b07886346b02b326c5c32a8299ed73e)
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/grant_permissions.xml | 105 | ||||
-rw-r--r-- | res/values/themes.xml | 3 |
2 files changed, 57 insertions, 51 deletions
diff --git a/res/layout/grant_permissions.xml b/res/layout/grant_permissions.xml index 463f0ccd..185bade5 100644 --- a/res/layout/grant_permissions.xml +++ b/res/layout/grant_permissions.xml @@ -17,71 +17,74 @@ <com.android.packageinstaller.permission.ui.ManualLayoutFrame xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" - android:layout_height="fill_parent" > + android:layout_height="fill_parent" + android:clipChildren="false"> <LinearLayout android:id="@+id/dialog_container" - android:layout_width="fill_parent" - android:layout_height="fill_parent" - android:paddingTop="24dip" - android:paddingBottom="8dip" - android:paddingStart="22dip" - android:paddingEnd="16dip" + android:layout_width="wrap_content" + android:layout_height="wrap_content" android:orientation="vertical"> <FrameLayout android:id="@+id/desc_container" android:layout_width="match_parent" - android:layout_height="wrap_content" > + android:layout_height="wrap_content" + android:paddingTop="24dip" + android:paddingStart="22dip" + android:paddingEnd="16dip" + android:background="?android:attr/colorBackgroundFloating"> <include layout="@layout/permission_description" /> </FrameLayout> - <CheckBox - android:id="@+id/do_not_ask_checkbox" - android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginTop="16dip" - android:text="@string/never_ask_again" - style="?android:attr/textAppearanceSmall" - android:visibility="gone"> - </CheckBox> - - <com.android.packageinstaller.permission.ui.ButtonBarLayout - android:id="@+id/button_group" + <LinearLayout android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="horizontal" - android:paddingStart="2dip" - android:paddingTop="16dip"> - - <TextView - android:id="@+id/current_page_text" - android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingBottom="8dip" + android:paddingStart="22dip" + android:paddingEnd="16dip" + android:background="?android:attr/colorBackgroundFloating"> + + <CheckBox + android:id="@+id/do_not_ask_checkbox" + android:layout_width="fill_parent" android:layout_height="wrap_content" - android:layout_gravity="start|bottom" - android:paddingTop="4dp" - android:paddingBottom="4dp" - android:paddingEnd="12dp" - android:singleLine="true" + android:layout_marginTop="16dip" + android:text="@string/never_ask_again" style="?android:attr/textAppearanceSmall" - android:textColor="?android:attr/textColorSecondary" - android:visibility="invisible"> - </TextView> - - <Space - android:id="@*android:id/spacer" - android:layout_width="0dp" - android:layout_height="0dp" - android:layout_weight="1" - android:visibility="invisible" > - </Space> - - <LinearLayout - android:layout_width="wrap_content" + android:visibility="gone"> + </CheckBox> + + <com.android.packageinstaller.permission.ui.ButtonBarLayout + android:id="@+id/button_group" + android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="end" - android:orientation="horizontal" > + android:orientation="horizontal" + android:paddingStart="2dip" + android:paddingTop="16dip"> + + <TextView + android:id="@+id/current_page_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="4dp" + android:paddingBottom="4dp" + android:paddingEnd="12dp" + android:singleLine="true" + style="?android:attr/textAppearanceSmall" + android:textColor="?android:attr/textColorSecondary" + android:visibility="invisible"> + </TextView> + + <Space + android:id="@*android:id/spacer" + android:layout_width="0dp" + android:layout_height="0dp" + android:layout_weight="1" + android:visibility="invisible" > + </Space> <Button android:id="@+id/permission_deny_button" @@ -100,9 +103,9 @@ android:text="@string/grant_dialog_button_allow" > </Button> - </LinearLayout> + </com.android.packageinstaller.permission.ui.ButtonBarLayout> - </com.android.packageinstaller.permission.ui.ButtonBarLayout> + </LinearLayout> </LinearLayout> diff --git a/res/values/themes.xml b/res/values/themes.xml index 026c77fa..a58c7be8 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -23,6 +23,9 @@ <style name="GrantPermissions" parent="@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar"> + <item name="*android:windowFixedHeightMajor">100%</item> + <item name="*android:windowFixedHeightMinor">100%</item> + <item name="android:windowBackground">@android:color/transparent</item> </style> </resources> |