From 82885102d9065c7d0a1b9ec2e91e01f1f7e34fee Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Sun, 27 Dec 2020 22:28:10 -0500 Subject: [PATCH] close #438 --- .../settings/BackupPreferencesFragment.java | 20 +++++++++++++++++++ app/src/main/res/values/strings.xml | 8 +++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/BackupPreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/BackupPreferencesFragment.java index 62d59258..0214eabc 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/BackupPreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/BackupPreferencesFragment.java @@ -26,10 +26,30 @@ public class BackupPreferencesFragment extends BasePreferencesFragment { if (context == null) { return; } + screen.addPreference(getAboutPreference(context)); + screen.addPreference(getWarningPreference(context)); screen.addPreference(getCreatePreference(context)); screen.addPreference(getRestorePreference(context)); } + private Preference getAboutPreference(@NonNull final Context context) { + final Preference preference = new Preference(context); + preference.setSummary(R.string.backup_summary); + preference.setEnabled(false); + preference.setIcon(R.drawable.ic_outline_info_24); + preference.setIconSpaceReserved(true); + return preference; + } + + private Preference getWarningPreference(@NonNull final Context context) { + final Preference preference = new Preference(context); + preference.setSummary(R.string.backup_warning); + preference.setEnabled(false); + preference.setIcon(R.drawable.ic_warning); + preference.setIconSpaceReserved(true); + return preference; + } + private Preference getCreatePreference(@NonNull final Context context) { final Preference preference = new Preference(context); preference.setTitle(R.string.create_backup); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 900b9d96..b0519374 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -285,9 +285,11 @@ Locations Unknown Removed from Favourites - Settings Backup - Create - Restore + Backup & Restore User Settings + Back up app settings, account login information, and/or favorites data to a plain text or encrypted backup file for later restoration. + If you\'re backing up login info, treat the file as confidential: Keep them somewhere safe! + Create new backup file + Restore from existing backup file File: Enter password Select a backup file (.zaai/.backup)