diff options
author | Luca Stefani <luca.stefani.ge1@gmail.com> | 2019-01-27 15:19:27 +0100 |
---|---|---|
committer | Luca Stefani <luca.stefani.ge1@gmail.com> | 2019-02-05 11:32:46 +0100 |
commit | 13e919f1be9e2204f85a7102581d7d232085c633 (patch) | |
tree | 1b30e610f9db0c32e24e82feea3f254434196c6b /res | |
parent | cbc5109d0da02f4c75ec21c22646fbbbfa8fece4 (diff) | |
download | android_packages_apps_Trebuchet-13e919f1be9e2204f85a7102581d7d232085c633.tar.gz android_packages_apps_Trebuchet-13e919f1be9e2204f85a7102581d7d232085c633.tar.bz2 android_packages_apps_Trebuchet-13e919f1be9e2204f85a7102581d7d232085c633.zip |
Trebuchet: Implement protected apps
Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Change-Id: Ide8f96ce360916fab44305c5f4a7c29ee31c179b
Diffstat (limited to 'res')
-rw-r--r-- | res/drawable/avd_protected_lock.xml | 52 | ||||
-rw-r--r-- | res/drawable/avd_protected_unlock.xml | 52 | ||||
-rw-r--r-- | res/drawable/ic_help.xml | 24 | ||||
-rw-r--r-- | res/drawable/ic_protected_locked.xml | 25 | ||||
-rw-r--r-- | res/drawable/ic_protected_unlocked.xml | 25 | ||||
-rw-r--r-- | res/layout/activity_hidden_apps.xml | 2 | ||||
-rw-r--r-- | res/layout/dialog_trust_welcome.xml | 61 | ||||
-rw-r--r-- | res/layout/item_hidden_app.xml | 18 | ||||
-rw-r--r-- | res/menu/menu_trust_apps.xml | 23 | ||||
-rw-r--r-- | res/values/config.xml | 2 | ||||
-rw-r--r-- | res/values/lineage_strings.xml | 14 | ||||
-rw-r--r-- | res/xml/launcher_preferences.xml | 4 |
12 files changed, 290 insertions, 12 deletions
diff --git a/res/drawable/avd_protected_lock.xml b/res/drawable/avd_protected_lock.xml new file mode 100644 index 000000000..464a5bf3c --- /dev/null +++ b/res/drawable/avd_protected_lock.xml @@ -0,0 +1,52 @@ +<!-- + Copyright (C) 2017 The LineageOS 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. +--> +<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt"> + <aapt:attr name="android:drawable"> + <vector + android:width="24dp" + android:height="24dp" + android:alpha="1" + android:viewportHeight="24" + android:viewportWidth="24"> + <path + android:name="lock" + android:fillColor="?android:attr/textColorSecondary" + android:pathData="M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,1 10,15A2,2 0 0,1 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17Z" /> + <group + android:name="group" + android:pivotX="8" + android:pivotY="6"> + <path + android:name="line" + android:fillColor="?android:attr/textColorSecondary" + android:pathData="M 7, 6 L 9, 6 L 9, 8 L 7, 8 L 7, 6" /> + </group> + </vector> + </aapt:attr> + <target android:name="group"> + <aapt:attr name="android:animation"> + <objectAnimator + android:name="group" + android:duration="350" + android:interpolator="@android:anim/accelerate_decelerate_interpolator" + android:propertyName="scaleY" + android:valueFrom="0" + android:valueTo="1" + android:valueType="floatType" /> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/res/drawable/avd_protected_unlock.xml b/res/drawable/avd_protected_unlock.xml new file mode 100644 index 000000000..374f943d0 --- /dev/null +++ b/res/drawable/avd_protected_unlock.xml @@ -0,0 +1,52 @@ +<!-- + Copyright (C) 2017 The LineageOS 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. +--> +<animated-vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt"> + <aapt:attr name="android:drawable"> + <vector + android:width="24dp" + android:height="24dp" + android:alpha="1" + android:viewportHeight="24" + android:viewportWidth="24"> + <path + android:name="lock" + android:fillColor="?android:attr/textColorSecondary" + android:pathData="M18,20V10H6V20H18M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,1 10,15A2,2 0 0,1 12,13A2,2 0 0,1 14,15A2,2 0 0,1 12,17Z" /> + <group + android:name="group" + android:pivotX="8" + android:pivotY="6"> + <path + android:name="line" + android:fillColor="?android:attr/textColorSecondary" + android:pathData="M 7, 6 L 9, 6 L 9, 8 L 7, 8 L 7, 6" /> + </group> + </vector> + </aapt:attr> + <target android:name="group"> + <aapt:attr name="android:animation"> + <objectAnimator + android:name="group" + android:duration="350" + android:interpolator="@android:anim/accelerate_decelerate_interpolator" + android:propertyName="scaleY" + android:valueFrom="1" + android:valueTo="0" + android:valueType="floatType" /> + </aapt:attr> + </target> +</animated-vector>
\ No newline at end of file diff --git a/res/drawable/ic_help.xml b/res/drawable/ic_help.xml new file mode 100644 index 000000000..e9a6a70ec --- /dev/null +++ b/res/drawable/ic_help.xml @@ -0,0 +1,24 @@ +<!-- + Copyright (C) 2019 The LineageOS 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="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path + android:fillColor="?android:attr/colorAccent" + android:pathData="M11,18h2v-2h-2v2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM12,6c-2.21,0 -4,1.79 -4,4h2c0,-1.1 0.9,-2 2,-2s2,0.9 2,2c0,2 -3,1.75 -3,5h2c0,-2.25 3,-2.5 3,-5 0,-2.21 -1.79,-4 -4,-4z"/> +</vector> diff --git a/res/drawable/ic_protected_locked.xml b/res/drawable/ic_protected_locked.xml new file mode 100644 index 000000000..8c39e3e79 --- /dev/null +++ b/res/drawable/ic_protected_locked.xml @@ -0,0 +1,25 @@ +<!-- + Copyright (C) 2019 The LineageOS 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="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + + <path + android:fillColor="?android:attr/textColorSecondary" + android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1s3.1,1.39 3.1,3.1v2L8.9,8L8.9,6zM18,20L6,20L6,10h12v10z"/> +</vector> diff --git a/res/drawable/ic_protected_unlocked.xml b/res/drawable/ic_protected_unlocked.xml new file mode 100644 index 000000000..6789fcb2b --- /dev/null +++ b/res/drawable/ic_protected_unlocked.xml @@ -0,0 +1,25 @@ +<!-- + Copyright (C) 2019 The LineageOS 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="24dp" + android:height="24dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + + <path + android:fillColor="?android:attr/textColorSecondary" + android:pathData="M12,17c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6h1.9c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM18,20L6,20L6,10h12v10z"/> +</vector> diff --git a/res/layout/activity_hidden_apps.xml b/res/layout/activity_hidden_apps.xml index be3fc7333..b1781bf26 100644 --- a/res/layout/activity_hidden_apps.xml +++ b/res/layout/activity_hidden_apps.xml @@ -46,7 +46,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="@string/protected_apps_loading" + android:text="@string/trust_apps_loading" android:textSize="16sp" /> </LinearLayout> </LinearLayout>
\ No newline at end of file diff --git a/res/layout/dialog_trust_welcome.xml b/res/layout/dialog_trust_welcome.xml new file mode 100644 index 000000000..e953d56e0 --- /dev/null +++ b/res/layout/dialog_trust_welcome.xml @@ -0,0 +1,61 @@ +<!-- + Copyright (C) 2019 The LineageOS 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="match_parent" + android:orientation="horizontal" + android:padding="16dp"> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center_horizontal" + android:orientation="vertical"> + + <ImageView + android:layout_width="64dp" + android:layout_height="64dp" + android:src="@drawable/ic_protected_locked" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="8dp" + android:text="@string/trust_apps_info_protected" + android:textAlignment="center" /> + </LinearLayout> + + <LinearLayout + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center_horizontal" + android:orientation="vertical"> + + <ImageView + android:layout_width="64dp" + android:layout_height="64dp" + android:src="@drawable/ic_hidden_locked" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="8dp" + android:text="@string/trust_apps_info_hidden" + android:textAlignment="center" /> + </LinearLayout> +</LinearLayout> diff --git a/res/layout/item_hidden_app.xml b/res/layout/item_hidden_app.xml index 73c604620..34fad9831 100644 --- a/res/layout/item_hidden_app.xml +++ b/res/layout/item_hidden_app.xml @@ -25,12 +25,24 @@ android:layout_marginStart="16dp" /> <ImageView + android:id="@+id/item_protected_app_switch" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_alignParentEnd="true" + android:layout_centerVertical="true" + android:layout_marginEnd="56dp" + android:clickable="true" + android:focusable="true" /> + + <ImageView android:id="@+id/item_hidden_app_switch" android:layout_width="24dp" android:layout_height="24dp" android:layout_alignParentEnd="true" android:layout_centerVertical="true" - android:layout_marginEnd="16dp" /> + android:layout_marginEnd="16dp" + android:clickable="true" + android:focusable="true" /> <TextView android:id="@+id/item_hidden_app_title" @@ -38,6 +50,6 @@ android:layout_height="wrap_content" android:layout_alignEnd="@id/item_hidden_app_switch" android:layout_centerVertical="true" - android:layout_marginEnd="56dp" - android:layout_marginStart="88dp" /> + android:layout_marginStart="88dp" + android:layout_marginEnd="88dp" /> </RelativeLayout> diff --git a/res/menu/menu_trust_apps.xml b/res/menu/menu_trust_apps.xml new file mode 100644 index 000000000..43c21b142 --- /dev/null +++ b/res/menu/menu_trust_apps.xml @@ -0,0 +1,23 @@ +<!-- + Copyright (C) 2019 The LineageOS 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. +--> +<menu xmlns:android="http://schemas.android.com/apk/res/android"> + + <item + android:id="@+id/menu_trust_help" + android:icon="@drawable/ic_help" + android:showAsAction="always" + android:title="@string/trust_apps_help" /> +</menu> diff --git a/res/values/config.xml b/res/values/config.xml index 2e7592b77..3bbd08cd5 100644 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -78,7 +78,7 @@ <!-- Name of a subclass of com.android.launcher3.AppFilter used to filter the activities shown in the launcher. Can be empty. --> - <string name="app_filter_class" translatable="false">com.android.launcher3.lineage.hidden.HiddenAppsFilter</string> + <string name="app_filter_class" translatable="false">com.android.launcher3.lineage.trust.HiddenAppsFilter</string> <!-- Name of an icon provider class. --> <string name="icon_provider_class" translatable="false"></string> diff --git a/res/values/lineage_strings.xml b/res/values/lineage_strings.xml index 828f2d465..031c83946 100644 --- a/res/values/lineage_strings.xml +++ b/res/values/lineage_strings.xml @@ -65,9 +65,13 @@ <!-- Expand statusbar --> <string name="statusbar_expand">Swipe down to show notifications</string> - <!-- Hidden apps --> - <string name="hidden_apps_manager_name">Hidden apps</string> - <string name="hidden_apps_auth_manager">Unlock to manage the hidden apps</string> - <string name="protected_apps_loading">Loading\u2026</string> - <string name="hidden_apps_no_lock_error">Please set up a secure lock screen to restrict app access</string> + <!-- Trust apps --> + <string name="trust_apps_manager_name">Hidden & Protected apps</string> + <string name="trust_apps_auth_manager">Unlock to manage the hidden and protected apps</string> + <string name="trust_apps_auth_open_app">Authenticate to open %1$s</string> + <string name="trust_apps_loading">Loading\u2026</string> + <string name="trust_apps_no_lock_error">Please set up a secure lock screen to restrict app access</string> + <string name="trust_apps_help">Help</string> + <string name="trust_apps_info_hidden">Hidden apps and their widgets are hidden from the drawer</string> + <string name="trust_apps_info_protected">Protected apps require authentication to be opened from the launcher</string> </resources> diff --git a/res/xml/launcher_preferences.xml b/res/xml/launcher_preferences.xml index e33f48511..b6f0a85ef 100644 --- a/res/xml/launcher_preferences.xml +++ b/res/xml/launcher_preferences.xml @@ -76,8 +76,8 @@ android:persistent="true" /> <Preference - android:key="pref_hidden_apps" - android:title="@string/hidden_apps_manager_name" /> + android:key="pref_trust_apps" + android:title="@string/trust_apps_manager_name" /> </PreferenceCategory> <PreferenceCategory |