summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Philip P. Moltmann <moltmann@google.com> 2018-06-26 15:05:42 -0700
committer Philip P. Moltmann <moltmann@google.com> 2018-07-09 16:02:29 -0700
commit20b80df94f3cc8e0bde50894e5dc2f613a0e6169 (patch)
tree7b2601def8ead88f970793724db46f93d091221c
parent8077622e413f947bc53f570c4847517e5e09b1ac (diff)
Factor our theme of permission grant dialog
This theme is meant for OEMs to theme the permission grant dialog. In the medium term future the AlertDialog should be extended so that the permission grant dialog will just be a AlertDialog. Bug: 78788390 Test: Looked at permission grant dialog Change-Id: If97b95c0fafaeec0a8136a69b6d2000689893095
-rw-r--r--core/res/res/values-land/dimens_package_installer.xml22
-rw-r--r--core/res/res/values-port/dimens_package_installer.xml22
-rw-r--r--core/res/res/values/styles_package_installer.xml97
-rw-r--r--core/res/res/values/themes_package_installer.xml35
4 files changed, 176 insertions, 0 deletions
diff --git a/core/res/res/values-land/dimens_package_installer.xml b/core/res/res/values-land/dimens_package_installer.xml
new file mode 100644
index 000000000000..72f4ec22c36f
--- /dev/null
+++ b/core/res/res/values-land/dimens_package_installer.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2018 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!-- Landscape dimensions for the permission grant dialog. -->
+<resources>
+ <!-- 37:20 == 65% width -->
+ <dimen name="permissionGrantDialogWidth">37</dimen>
+</resources>
diff --git a/core/res/res/values-port/dimens_package_installer.xml b/core/res/res/values-port/dimens_package_installer.xml
new file mode 100644
index 000000000000..67cafe752409
--- /dev/null
+++ b/core/res/res/values-port/dimens_package_installer.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2018 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!-- portrait dimensions for the permission grant dialog. -->
+<resources>
+ <!-- 380:20 == 95% width -->
+ <dimen name="permissionGrantDialogWidth">380</dimen>
+</resources>
diff --git a/core/res/res/values/styles_package_installer.xml b/core/res/res/values/styles_package_installer.xml
new file mode 100644
index 000000000000..8bfcc8dcde76
--- /dev/null
+++ b/core/res/res/values/styles_package_installer.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2018 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!-- styles for the permission grant dialog. -->
+<resources>
+ <style name="PermissionGrantDialog">
+ <item name="background">?attr/windowBackground</item>
+ <item name="elevation">?attr/windowElevation</item>
+ <item name="layout_weight">@dimen/permissionGrantDialogWidth</item>
+ </style>
+
+ <style name="PermissionGrantTitleIcon">
+ <item name="layout_width">36dp</item>
+ <item name="layout_height">36dp</item>
+ <item name="tint">?attr/colorAccent</item>
+ <item name="scaleType">fitCenter</item>
+ </style>
+
+ <style name="PermissionGrantTitleMessage"
+ parent="@style/TextAppearance.DeviceDefault">
+ <item name="paddingStart">22dp</item>
+ <item name="textSize">20sp</item>
+ <item name="textColor">?attr/textColorPrimary</item>
+ </style>
+
+ <style name="PermissionGrantIndex"
+ parent="@style/TextAppearance.DeviceDefault">
+ <item name="paddingEnd">12dp</item>
+ <item name="singleLine">true</item>
+ <item name="textColor">?attr/textColorSecondary</item>
+ </style>
+
+ <style name="PermissionGrantDescription">
+ <item name="layout_marginTop">20dp</item>
+ <item name="layout_marginStart">24dp</item>
+ <item name="layout_marginBottom">16dp</item>
+ <item name="layout_marginEnd">24dp</item>
+ </style>
+
+ <style name="PermissionGrantContent">
+ <item name="layout_marginStart">16dp</item>
+ <item name="layout_marginEnd">24dp</item>
+ </style>
+
+ <style name="PermissionGrantRadioGroup">
+ <item name="layout_marginStart">8dp</item>
+ <item name="layout_marginTop">-4dp</item>
+ </style>
+
+ <style name="PermissionGrantRadioButton"
+ parent="@style/Widget.DeviceDefault.CompoundButton.RadioButton">
+ <item name="paddingStart">16dp</item>
+ <item name="paddingTop">8dp</item>
+ <item name="paddingBottom">8dp</item>
+ <item name="textSize">16sp</item>
+ </style>
+
+ <style name="PermissionGrantDetailMessage"
+ parent="@style/TextAppearance.DeviceDefault">
+ <item name="layout_marginStart">8dp</item>
+ <item name="layout_marginBottom">4dp</item>
+ <item name="textColor">?attr/textColorPrimary</item>
+ <item name="textSize">16sp</item>
+ </style>
+
+ <style name="PermissionGrantDetailMessageSpace">
+ <item name="layout_height">8dp</item>
+ </style>
+
+ <style name="PermissionGrantCheckbox"
+ parent="@style/Widget.DeviceDefault.CompoundButton.CheckBox">
+ <item name="paddingStart">16dp</item>
+ <item name="textColor">?attr/textColorSecondary</item>
+ <item name="buttonTint">?attr/textColorSecondary</item>
+ <item name="textSize">16sp</item>
+ </style>
+
+ <style name="PermissionGrantButtonBar">
+ <item name="layout_marginStart">24dp</item>
+ <item name="layout_marginEnd">16dp</item>
+ <item name="layout_marginBottom">4dp</item>
+ </style>
+</resources>
diff --git a/core/res/res/values/themes_package_installer.xml b/core/res/res/values/themes_package_installer.xml
new file mode 100644
index 000000000000..a6341dc664ab
--- /dev/null
+++ b/core/res/res/values/themes_package_installer.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2018 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<!-- themes for the permission grant dialog. -->
+<resources>
+ <style name="Theme.DeviceDefault.Light.Panel.PermissionGrantApp"
+ parent="@style/Theme.DeviceDefault.Light.Panel">
+ <item name="windowIsFloating">false</item>
+ <item name="windowTranslucentStatus">true</item>
+ <item name="backgroundDimEnabled">true</item>
+ <item name="windowAnimationStyle">@style/Animation.Material.Dialog</item>
+ </style>
+
+ <style name="Theme.DeviceDefault.Light.Dialog.PermissionGrant"
+ parent="@style/Theme.DeviceDefault.Light.Dialog">
+ <item name="titleTextStyle">@style/PermissionGrantTitleMessage</item>
+ <item name="radioButtonStyle">@style/PermissionGrantRadioButton</item>
+ <item name="checkboxStyle">@style/PermissionGrantCheckbox</item>
+ <item name="buttonBarStyle">@style/PermissionGrantButtonBar</item>
+ </style>
+</resources>