From ca742998dc632d80deff870bef609a00064449f2 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 3 Mar 2020 21:45:43 +0200 Subject: [PATCH] Update restore and reset dialog UI --- OsmAnd/res/values/strings.xml | 2 ++ .../ResetProfilePrefsBottomSheet.java | 20 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 20baa92d0d..44e972a76f 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,8 @@ Thx - Hardy --> + All profile settings will be restored to their original state after creating/importing this profile. + Restore all profile settings? Saving new profile Could not back up profile. Import rendering file diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java index 70bd98036e..7a15cf9862 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ResetProfilePrefsBottomSheet.java @@ -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