summaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorHeemin Seog <hseog@google.com>2019-05-14 08:56:21 -0700
committerHeemin Seog <hseog@google.com>2019-05-17 13:22:07 -0700
commit884de09120642531eddf821c6aa700bf09e7d514 (patch)
tree5a955570670b39bddd2e076e123741dc59aab2bd /res
parent2457f266bef63752727bd81cba10b04d2b1bcc87 (diff)
downloadandroid_packages_apps_PackageInstaller-884de09120642531eddf821c6aa700bf09e7d514.tar.gz
android_packages_apps_PackageInstaller-884de09120642531eddf821c6aa700bf09e7d514.tar.bz2
android_packages_apps_PackageInstaller-884de09120642531eddf821c6aa700bf09e7d514.zip
App permission page
This page was originally done using separate layouts, but was remade using preferences. Also instead of using radio buttons, we've gone ahead and followed a similar pattern to Roles (using preference summary to denote selected row). Bug: 122822231 Test: manual Change-Id: I5a5b5d48b1adb355f3f8880975117a6497f5efd9
Diffstat (limited to 'res')
-rw-r--r--res/drawable/car_ic_info.xml25
-rw-r--r--res/drawable/car_ic_settings.xml34
-rw-r--r--res/layout/car_two_target_preference.xml84
-rw-r--r--res/layout/info_preference_widget.xml23
-rw-r--r--res/layout/settings_preference_widget.xml23
-rw-r--r--res/values/strings.xml3
6 files changed, 192 insertions, 0 deletions
diff --git a/res/drawable/car_ic_info.xml b/res/drawable/car_ic_info.xml
new file mode 100644
index 00000000..bc334fb0
--- /dev/null
+++ b/res/drawable/car_ic_info.xml
@@ -0,0 +1,25 @@
+<!--
+ Copyright (C) 2019 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="@*android:dimen/car_preference_icon_size"
+ android:height="@*android:dimen/car_preference_icon_size"
+ android:tint="@*android:color/car_tint"
+ android:viewportHeight="24.0"
+ android:viewportWidth="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"/>
+</vector>
diff --git a/res/drawable/car_ic_settings.xml b/res/drawable/car_ic_settings.xml
new file mode 100644
index 00000000..f278af91
--- /dev/null
+++ b/res/drawable/car_ic_settings.xml
@@ -0,0 +1,34 @@
+<!--
+ Copyright (C) 2019 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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="@*android:dimen/car_preference_icon_size"
+ android:height="@*android:dimen/car_preference_icon_size"
+ android:tint="@*android:color/car_tint"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M21.4 14.2l-1.94-1.45c.03-.25 .04 -.5 .04 -.76s-.01-.51-.04-.76L21.4 9.8c.42-.31
+.52 -.94 .24 -1.41l-1.6-2.76c-.28-.48-.88-.7-1.36-.5l-2.14 .91
+c-.48-.37-1.01-.68-1.57-.92l-.27-2.2c-.06-.52-.56-.92-1.11-.92h-3.18c-.55 0-1.05
+.4 -1.11 .92 l-.26 2.19c-.57 .24 -1.1 .55 -1.58 .92 l-2.14-.91c-.48-.2-1.08 .02
+-1.36 .5 l-1.6 2.76c-.28 .48 -.18 1.1 .24 1.42l1.94 1.45c-.03 .24 -.04 .49 -.04
+.75 s.01 .51 .04 .76 L2.6 14.2c-.42 .31 -.52 .94 -.24 1.41l1.6 2.76c.28 .48 .88
+.7 1.36 .5 l2.14-.91c.48 .37 1.01 .68 1.57 .92 l.27 2.19c.06 .53 .56 .93 1.11
+.93 h3.18c.55 0 1.04-.4 1.11-.92l.27-2.19c.56-.24 1.09-.55 1.57-.92l2.14 .91
+c.48 .2 1.08-.02 1.36-.5l1.6-2.76c.28-.48 .18 -1.1-.24-1.42zM12 15.5c-1.93
+0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/>
+</vector>
diff --git a/res/layout/car_two_target_preference.xml b/res/layout/car_two_target_preference.xml
new file mode 100644
index 00000000..66cf936a
--- /dev/null
+++ b/res/layout/car_two_target_preference.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:background="@android:color/transparent"
+ android:gravity="center_vertical"
+ android:minHeight="?android:attr/listPreferredItemHeightSmall">
+ <LinearLayout
+ android:layout_width="0dp"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:background="?android:attr/selectableItemBackground"
+ android:clipToPadding="false"
+ android:gravity="start|center_vertical"
+ android:paddingBottom="@*android:dimen/car_preference_row_vertical_margin"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+ android:paddingTop="@*android:dimen/car_preference_row_vertical_margin">
+ <androidx.preference.internal.PreferenceImageView
+ android:id="@android:id/icon"
+ android:layout_width="@*android:dimen/car_preference_icon_size"
+ android:layout_height="@*android:dimen/car_preference_icon_size"
+ android:layout_marginEnd="?android:attr/listPreferredItemPaddingEnd"/>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
+ android:orientation="vertical">
+ <TextView
+ android:id="@android:id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:ellipsize="end"
+ android:hyphenationFrequency="none"
+ android:singleLine="true"
+ android:textAppearance="?android:attr/textAppearanceListItem"/>
+ <TextView
+ android:id="@android:id/summary"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:hyphenationFrequency="none"
+ android:textAppearance="?android:attr/textAppearanceListItemSecondary"/>
+ </LinearLayout>
+ </LinearLayout>
+ <LinearLayout
+ android:id="@+id/action_widget_container"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+ <View
+ android:id="@+id/two_target_divider"
+ android:layout_width="1dp"
+ android:layout_height="match_parent"
+ android:layout_marginBottom="@*android:dimen/car_preference_row_vertical_margin"
+ android:layout_marginTop="@*android:dimen/car_preference_row_vertical_margin"
+ android:background="?attr/carDividerColor"/>
+ <!-- Preference should place its actual preference widget here. -->
+ <FrameLayout
+ android:id="@android:id/widget_frame"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:background="?android:attr/selectableItemBackground"
+ android:gravity="center"
+ android:minWidth="?android:attr/listPreferredItemHeightSmall"
+ android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+ android:paddingStart="?android:attr/listPreferredItemPaddingStart"/>
+ </LinearLayout>
+</LinearLayout>
diff --git a/res/layout/info_preference_widget.xml b/res/layout/info_preference_widget.xml
new file mode 100644
index 00000000..3efa9835
--- /dev/null
+++ b/res/layout/info_preference_widget.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<ImageView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:src="@drawable/car_ic_info"/>
diff --git a/res/layout/settings_preference_widget.xml b/res/layout/settings_preference_widget.xml
new file mode 100644
index 00000000..70f8cd65
--- /dev/null
+++ b/res/layout/settings_preference_widget.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright 2019 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.
+-->
+
+<ImageView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:src="@drawable/car_ic_settings"/>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c03934da..eaeaa4ea 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -604,6 +604,9 @@
<!-- Label when no apps have been denied a given permission [CHAR LIMIT=none] -->
<string name="no_apps_denied">No apps denied</string>
+ <!-- Label for the selected permission state for a given permission and application [CHAR LIMIT=30] -->
+ <string name="car_permission_selected">Selected</string>
+
<!-- Label for button that opens up the Settings [CHAR LIMIT=20] -->
<string name="settings">Settings</string>