Update restore and reset dialog UI

This commit is contained in:
Vitaliy 2020-03-03 21:45:43 +02:00
parent 56eda77a2c
commit ca742998dc
2 changed files with 15 additions and 7 deletions

View file

@ -11,6 +11,8 @@
Thx - Hardy
-->
<string name="restore_all_profile_settings_descr">All profile settings will be restored to their original state after creating/importing this profile.</string>
<string name="restore_all_profile_settings">Restore all profile settings?</string>
<string name="saving_new_profile">Saving new profile</string>
<string name="profile_backup_failed">Could not back up profile.</string>
<string name="import_rendering_file">Import rendering file</string>

View file

@ -31,9 +31,12 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
return;
}
items.add(new TitleItem(getString(R.string.reset_all_profile_settings)));
ApplicationMode mode = getAppMode();
boolean customProfile = mode.isCustomProfile();
String title = getString(customProfile ? R.string.restore_all_profile_settings : R.string.reset_all_profile_settings);
items.add(new TitleItem(title));
int profileColor = mode.getIconColorInfo().getColor(nightMode);
int colorNoAlpha = ContextCompat.getColor(ctx, profileColor);
@ -52,12 +55,15 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
.create();
items.add(profileItem);
StringBuilder description = new StringBuilder(getString(R.string.reset_confirmation_descr, getString(R.string.shared_string_reset)));
description.append("\n\n");
description.append(getString(R.string.reset_all_profile_settings_descr));
String restoreDescr = getString(customProfile ? R.string.shared_string_restore : R.string.shared_string_reset);
String description = getString(customProfile ? R.string.restore_all_profile_settings_descr : R.string.reset_all_profile_settings_descr);
StringBuilder stringBuilder = new StringBuilder(description);
stringBuilder.append("\n\n");
stringBuilder.append(getString(R.string.reset_confirmation_descr, restoreDescr));
BaseBottomSheetItem resetAllSettings = new BottomSheetItemWithDescription.Builder()
.setDescription(description)
.setDescription(stringBuilder)
.setLayoutId(R.layout.bottom_sheet_item_pref_info)
.create();
items.add(resetAllSettings);
@ -65,7 +71,7 @@ public class ResetProfilePrefsBottomSheet extends BasePreferenceBottomSheet {
@Override
protected int getRightBottomButtonTextId() {
return R.string.shared_string_reset;
return getAppMode().isCustomProfile() ? R.string.shared_string_restore : R.string.shared_string_reset;
}
@Override