summaryrefslogtreecommitdiffstats
path: root/res/values-watch
diff options
context:
space:
mode:
authorAnthony Hugh <ahugh@google.com>2015-08-19 11:44:43 -0700
committerAnthony Hugh <ahugh@google.com>2015-08-21 16:21:28 -0700
commit9478120abc48a8934e5de14f7cf49342cef5485c (patch)
treee995ef96a7dc37c4c079c46e9b87a94a0d454d77 /res/values-watch
parent24938647726a06f636dc8c9f1195a378ebb07995 (diff)
downloadandroid_packages_apps_PackageInstaller-9478120abc48a8934e5de14f7cf49342cef5485c.tar.gz
android_packages_apps_PackageInstaller-9478120abc48a8934e5de14f7cf49342cef5485c.tar.bz2
android_packages_apps_PackageInstaller-9478120abc48a8934e5de14f7cf49342cef5485c.zip
Implement base version of GrantPermissions dialog
With the Emerald release, we need to support the new permission APIs. This changelist adds a dialog for the Activity.requestPermissions() API so that users can request permissions. This check in is a functional version, but not polished. will need to be a follow up CL to add the correct animations and update the UI to the appropriate redlines. The implementation for the confirmation dialog is modeled after the one in the clockwork libs/Views folder. There are some tweaks to match the designed behavior of the permission dialog. When there's more time in the future, we should try to condense this to one implementation. This is a resubmit without the wearable-support lib. I will figure out how to get that referenced in the next UI pass. BUG: 23118402 Change-Id: Ib2fb94b356aa965b999b3e12726fda86928a963e
Diffstat (limited to 'res/values-watch')
-rw-r--r--res/values-watch/colors.xml29
-rw-r--r--res/values-watch/dimens.xml28
-rw-r--r--res/values-watch/strings.xml29
-rw-r--r--res/values-watch/themes.xml67
4 files changed, 153 insertions, 0 deletions
diff --git a/res/values-watch/colors.xml b/res/values-watch/colors.xml
new file mode 100644
index 00000000..903bfef5
--- /dev/null
+++ b/res/values-watch/colors.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<resources>
+ <color name="grant_permissions_app_color">@color/grant_permissions_white_text_alpha_100</color>
+ <color name="grant_permissions_progress_color">@color/grant_permissions_white_text_alpha_100</color>
+ <color name="grant_permissions_title_color">@color/grant_permissions_white_text_alpha_70</color>
+
+ <color name="grant_permissions_white_text_alpha_100">@color/off_white</color>
+ <color name="grant_permissions_white_text_alpha_70">#b2eeeeee</color>
+
+ <color name="off_white">#ffeeeeee</color>
+
+ <!-- Copied from wearable support -->
+ <color name="circular_button_disabled">#757575</color>
+</resources>
diff --git a/res/values-watch/dimens.xml b/res/values-watch/dimens.xml
new file mode 100644
index 00000000..29a65fdc
--- /dev/null
+++ b/res/values-watch/dimens.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<resources>
+ <dimen name="grant_permissions_app_icon_size">32dp</dimen>
+ <dimen name="grant_permissions_app_icon_margin_top">8dp</dimen>
+
+ <dimen name="grant_permissions_app_breadcrumb_margin_bottom">3dp</dimen>
+
+ <dimen name="action_dialog_z">16dp</dimen>
+
+ <!-- Confirmation Dialog -->
+ <dimen name="conf_diag_floating_height">16dp</dimen>
+
+</resources>
diff --git a/res/values-watch/strings.xml b/res/values-watch/strings.xml
new file mode 100644
index 00000000..161ff834
--- /dev/null
+++ b/res/values-watch/strings.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 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.
+-->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+ <!-- Title for the dialog button to deny a permission grant and never ask the user again. -->
+ <string name="grant_dialog_button_deny_dont_ask_again">Deny and don\'t ask again</string>
+
+ <!-- Template for the current permission from the total number of permissions. -->
+ <string name="current_permission_template">
+ <xliff:g id="current_permission_index" example="1">%1$s</xliff:g> /
+ <xliff:g id="permission_count" example="2">%2$s</xliff:g>
+ </string>
+
+ <!-- Preference row title for showing system apps. -->
+ <string name="preference_show_system_apps">Show system apps</string>
+</resources>
diff --git a/res/values-watch/themes.xml b/res/values-watch/themes.xml
new file mode 100644
index 00000000..7a27bf7c
--- /dev/null
+++ b/res/values-watch/themes.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2015 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
+ -->
+
+<resources>
+ <style name="Settings" parent="Theme.Leanback">
+ <item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Permissions</item>
+ </style>
+
+ <style name="GrantPermissions" parent="Theme.Leanback">
+ <item name="android:windowIsFloating">true</item>
+ <item name="android:windowAnimationStyle">@style/Animation.Snackbar</item>
+ <item name="android:windowElevation">@dimen/action_dialog_z</item>
+ </style>
+
+ <style name="GrantPermissions.BreadcrumbText">
+ <item name="android:fontFamily">sans-serif-condensed</item>
+ <item name="android:textSize">14sp</item>
+ <item name="android:textColor">@color/grant_permissions_progress_color</item>
+ </style>
+
+ <style name="GrantPermissions.TitleText">
+ <item name="android:fontFamily">sans-serif-light</item>
+ <item name="android:textSize">18sp</item>
+ <item name="android:textColor">@color/grant_permissions_title_color</item>
+ <item name="android:lineSpacingMultiplier">1.221</item>
+ </style>
+
+ <style name="Animation.Snackbar" parent="@android:style/Animation">
+ <item name="android:windowEnterAnimation">@anim/snackbar_enter</item>
+ <item name="android:windowExitAnimation">@anim/snackbar_exit</item>
+ </style>
+
+ <!-- Copied from WearableSupport lib -->
+ <style name="TextAppearance.WearDiag" parent="android:TextAppearance.Medium">
+ <item name="android:textColor">#FFFFFF</item>
+ <item name="android:textSize">16sp</item>
+ </style>
+ <style name="TextAppearance.WearDiag.Button">
+ <item name="android:textSize">16sp</item>
+ </style>
+ <style name="Widget.WearDiag.Button" parent="@android:style/Widget.DeviceDefault.Button">
+ <item name="android:fontFamily">sans-serif-condensed-light</item>
+ <item name="android:gravity">center_vertical|left</item>
+ <item name="android:textAppearance">@style/TextAppearance.WearDiag.Button</item>
+ <item name="android:background">@android:color/transparent</item>
+ <item name="android:minLines">1</item>
+ <item name="android:maxLines">3</item>
+ <item name="android:ellipsize">marquee</item>
+ <item name="android:layout_height">60dp</item>
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:drawablePadding">12dp</item>
+ </style>
+</resources>