diff options
author | Roman Birg <roman@cyngn.com> | 2015-05-25 08:31:32 -0700 |
---|---|---|
committer | Roman Birg <roman@cyngn.com> | 2016-01-27 13:54:45 -0800 |
commit | db442846cc795511d148febe1435233f1793e9e9 (patch) | |
tree | 072b0a5b78abf3cb8e61204f138b684daecad244 /res | |
parent | ed3b78339329a5816335eaeb33ddf42933593c99 (diff) | |
download | packages_apps_Settings-db442846cc795511d148febe1435233f1793e9e9.zip packages_apps_Settings-db442846cc795511d148febe1435233f1793e9e9.tar.gz packages_apps_Settings-db442846cc795511d148febe1435233f1793e9e9.tar.bz2 |
MasterClear: update UI
Also squashed the following related commits from 12.1:
MasterClear: fix FRP wipe crash
Requesting setRequestedOrientation() right after showing a custom dialog
in a DialogFragment does not play nice. It forces the activity to be
recreated instantly, so when the task finishes, there original activity
the AsyncTask is tied to is no longer valid.
However, if we let fragment manager keep track of all the dialogs, it
doesn't break the expected behavior.
REF: CYNGNOS-427
Change-Id: I0609816182a6b5319d2a88ff0075d53e3c2fed16
Signed-off-by: Roman Birg <roman@cyngn.com>
Settings: make FRP wipe dialog not cancelable
User should not be able to interact with the screen after the process
has started. Otherwise we can get in a bad state and never perform the
factory reset.
Ref: CYNGNOS-427
Change-Id: I197a6ca70487a33b0ce402fda7a2d58828e8e1bb
Signed-off-by: Roman Birg <roman@cyngn.com>
Settings: don't crash when dismissing FRP
If the user has pressed home while the dailog is up, there may be
nothing to dismiss by the time the task finishes.
Ref: CYNGNOS-427
Change-Id: Ic4fdec1ecb32f88181feba4bfd3eb337b1b61efd
Signed-off-by: Roman Birg <roman@cyngn.com>
Settings: continue factory reset if user leaves activity
If the FRP dialog is up, and the user presses the home button, the FRP
task will finish, and then try to use the activity context to initiate
the wipe, and the fragment to retreive args, both of which is no longer
valid.
Cache all variables before the task begins, and use the application
context to complete the calls.
Ref: CYNGNOS-427
Change-Id: I5c8b286195a0b57fd879a1022d64ea548363b925
Signed-off-by: Roman Birg <roman@cyngn.com>
Ref: Settings-86
Change-Id: I759de586bf5cb8558d42575d08df63aaf84fffa6
Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/master_clear_cm.xml | 197 | ||||
-rw-r--r-- | res/values/cm_colors.xml | 2 | ||||
-rw-r--r-- | res/values/cm_strings.xml | 17 | ||||
-rw-r--r-- | res/values/styles.xml | 4 |
4 files changed, 220 insertions, 0 deletions
diff --git a/res/layout/master_clear_cm.xml b/res/layout/master_clear_cm.xml new file mode 100644 index 0000000..cb8b50a --- /dev/null +++ b/res/layout/master_clear_cm.xml @@ -0,0 +1,197 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2015 The CyanogenMod 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="vertical"> + + <ScrollView + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1"> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + <!-- top section "Personal data & apps" --> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="center_vertical" + android:minHeight="?android:attr/listPreferredItemHeight" + android:orientation="vertical" + android:paddingBottom="16dp" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingTop="16dp"> + + <TextView + android:id="@+id/title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/factory_reset_instructions_title" + android:textAppearance="?android:attr/textAppearanceListItem" /> + + <TextView + android:id="@+id/summary" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="@string/factory_reset_instructions_summary" + android:textAppearance="?android:attr/textAppearanceListItemSecondary" + android:textColor="?android:attr/textColorSecondary" /> + + </LinearLayout> + + <View + style="@style/SolidSettingSeparator" + android:layout_marginEnd="0dp" + android:layout_marginStart="0dp" /> + + <TextView + android:layout_width="match_parent" + android:layout_height="?android:attr/listPreferredItemHeight" + android:gravity="center_vertical" + android:orientation="vertical" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:text="@string/factory_reset_personal_content" + android:textAppearance="@style/TextAppearance.CategoryTitle" /> + + <!-- erase stored content --> + <LinearLayout + android:id="@+id/erase_internal_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:clickable="true" + android:focusable="true" + android:orientation="horizontal" + android:paddingBottom="8dp" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingStart="?android:attr/listPreferredItemPaddingStart"> + + <CheckBox + android:id="@+id/erase_internal" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:clickable="false" + android:duplicateParentState="true" + android:focusable="false" + android:padding="3dp" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginStart="16dp" + android:duplicateParentState="true" + android:orientation="vertical"> + + <TextView + android:id="@+id/erase_storage_checkbox_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:duplicateParentState="true" + android:text="@string/factory_reset_erase_stored_content" + android:textAppearance="?android:attr/textAppearanceListItem" + android:textStyle="bold" /> + + <TextView + android:id="@+id/erase_storage_checkbox_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:duplicateParentState="true" + android:text="@string/factory_reset_erase_stored_content_summary" + android:textAppearance="?android:attr/textAppearanceListItemSecondary" + android:textColor="?android:attr/textColorSecondary" /> + </LinearLayout> + </LinearLayout> + + <!-- format sd card --> + <LinearLayout + android:id="@+id/erase_external_container" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:clickable="true" + android:focusable="true" + android:orientation="horizontal" + android:paddingBottom="8dp" + android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" + android:paddingStart="?android:attr/listPreferredItemPaddingStart" + android:paddingTop="8dp"> + + <CheckBox + android:id="@+id/erase_external" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:clickable="false" + android:duplicateParentState="true" + android:focusable="false" + android:padding="3dp" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginStart="16dp" + android:duplicateParentState="true" + android:orientation="vertical"> + + <TextView + android:id="@+id/erase_sdcard_checkbox_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:duplicateParentState="true" + android:text="@string/factory_reset_erase_sd_card" + android:textAppearance="?android:attr/textAppearanceListItem" + android:textStyle="bold" /> + + <TextView + android:id="@+id/erase_sdcard_checkbox_description" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:duplicateParentState="true" + android:text="@string/factory_reset_erase_sd_card_summary" + android:textAppearance="?android:attr/textAppearanceListItemSecondary" + android:textColor="?android:attr/textColorSecondary" /> + </LinearLayout> + </LinearLayout> + </LinearLayout> + </ScrollView> + + <View style="@style/SolidSettingSeparator" /> + + <Button + android:id="@+id/initiate_master_clear" + style="?android:attr/borderlessButtonStyle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:layout_marginBottom="8dp" + android:layout_marginEnd="12dp" + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:gravity="center" + android:padding="10dp" + android:text="@string/master_clear_button_text" + android:textColor="@color/factory_reset_color" + android:textSize="14sp" /> + +</LinearLayout> diff --git a/res/values/cm_colors.xml b/res/values/cm_colors.xml index 7de1813..9dbb44d 100644 --- a/res/values/cm_colors.xml +++ b/res/values/cm_colors.xml @@ -83,4 +83,6 @@ limitations under the License. <color name="contributors_cloud_selected_color">#ff5252</color> <color name="external_tile_icon_tint_color">?android:attr/colorAccent</color> + <color name="factory_reset_color">#FFFE412C</color> + <color name="divider">#ffe0e0e0</color> </resources> diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index f138d3e..111caef 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -1096,4 +1096,21 @@ <string name="last_time_used_label_cm">Last time used:</string> <!-- label for usage time --> <string name="usage_time_label_cm">Usage time:</string> + + <!-- SD card & phone storage settings screen, message on screen after user selects Factory data reset [CHAR LIMIT=NONE] --> + <string name="master_clear_desc_cm" product="tablet">This will erase all data from your tablet\'s <b>internal storage</b>, including:\n\n<li>Your device accounts</li>\n<li>System and app data and settings</li>\n<li>Downloaded apps</li></string> + <!-- SD card & phone storage settings screen, message on screen after user selects Factory data reset [CHAR LIMIT=NONE] --> + <string name="master_clear_desc_cm" product="default">This will erase all data from your phone\'s <b>internal storage</b>, including:\n\n<li>Your device accounts</li>\n<li>System and app data and settings</li>\n<li>Downloaded apps</li></string> + + <!-- Factory reset strings --> + <string name="factory_reset_instructions_title">Personal data & apps</string> + <string name="factory_reset_instructions_summary">This will erase all your accounts, apps, app data, and system settings on this device</string> + <string name="factory_reset_personal_content">Personal content</string> + <string name="factory_reset_erase_stored_content">Erase stored content</string> + <string name="factory_reset_erase_stored_content_summary">Erase music, photos, videos, and other user data stored on this device</string> + <string name="factory_reset_erase_stored_content_summary_forced">Erase music, photos, videos, and other user data stored on this device. \n\n<b>Content cannot be saved due to device encryption.</b></string> + <string name="factory_reset_erase_sd_card">Format SD card</string> + <string name="factory_reset_erase_sd_card_summary">Erase all data on the SD card, including music and photos</string> + <string name="factory_reset_warning_text_reset_now">RESET NOW</string> + <string name="factory_reset_warning_text_message">All your accounts, apps, app data, and system settings will be removed from this device. This cannot be reversed.</string> </resources> diff --git a/res/values/styles.xml b/res/values/styles.xml index 19b0f7d..a3581f2 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -371,6 +371,10 @@ <item name="android:layout_height">1dp</item> </style> + <style name="SolidSettingSeparator" parent="@style/settingSeparator"> + <item name="android:background">@color/divider</item> + </style> + <style name="floating_action_button"> <item name="android:layout_width">@dimen/fab_size</item> <item name="android:layout_height">@dimen/fab_size</item> |