From 73a9e627d9cf9a8bcdb937df758b33220656e2a1 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Thu, 10 Sep 2020 15:57:07 -0400 Subject: [PATCH] more crash resolution and home decor --- .../instagrabber/fragments/FollowViewerFragment.java | 11 ++++++++--- .../fragments/settings/MorePreferencesFragment.java | 10 ++++++++-- .../settings/SettingsPreferencesFragment.java | 8 ++++---- app/src/main/res/values/strings.xml | 8 ++++++-- 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java b/app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java index a440c26c..30a15e3c 100644 --- a/app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java @@ -346,9 +346,14 @@ public final class FollowViewerFragment extends Fragment implements SwipeRefresh groups.add(group); } - adapter = new FollowAdapter(requireContext(), clickListener, groups); - adapter.toggleGroup(0); - binding.rvFollow.setAdapter(adapter); + try { + adapter = new FollowAdapter(requireContext(), clickListener, groups); + adapter.toggleGroup(0); + binding.rvFollow.setAdapter(adapter); + } + catch (IllegalStateException e) { + // do nothing + } } public void stopCurrentExecutor() { diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java index 3a622c23..797e0bcd 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java @@ -56,7 +56,8 @@ public class MorePreferencesFragment extends BasePreferencesFragment { // screen.addPreference(new MoreHeaderPreference(requireContext())); final PreferenceCategory accountCategory = new PreferenceCategory(requireContext()); - accountCategory.setTitle("Account"); + accountCategory.setTitle(R.string.account); + accountCategory.setSummary(R.string.account_hint); accountCategory.setIconSpaceReserved(false); screen.addPreference(accountCategory); // To re-login, user can just add the same account back from account switcher dialog @@ -116,11 +117,16 @@ public class MorePreferencesFragment extends BasePreferencesFragment { divider.setLayoutResource(R.layout.item_pref_divider); screen.addPreference(divider); - final Preference versionPreference = getPreference(R.string.version, BuildConfig.VERSION_NAME, -1, preference -> { + final Preference versionPreference = getPreference(R.string.version, + BuildConfig.VERSION_NAME + " (" + BuildConfig.VERSION_CODE + ")", -1, preference -> { FlavorTown.updateCheck((AppCompatActivity) requireActivity(), true); return true; }); screen.addPreference(versionPreference); + + final Preference reminderPreference = getPreference(R.string.reminder, R.string.reminder_summary, R.drawable.ic_warning, null); + reminderPreference.setEnabled(false); + screen.addPreference(reminderPreference); } @Override diff --git a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java index abcaa3b8..f1070132 100644 --- a/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java @@ -43,7 +43,7 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { isLoggedIn = !TextUtils.isEmpty(cookie) && CookieUtils.getUserIdFromCookie(cookie) != null; final PreferenceCategory generalCategory = new PreferenceCategory(requireContext()); screen.addPreference(generalCategory); - generalCategory.setTitle(getString(R.string.pref_category_general)); + generalCategory.setTitle(R.string.pref_category_general); generalCategory.setIconSpaceReserved(false); generalCategory.addPreference(getDefaultTabPreference()); generalCategory.addPreference(getUpdateCheckPreference()); @@ -52,21 +52,21 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment { final PreferenceCategory themeCategory = new PreferenceCategory(requireContext()); screen.addPreference(themeCategory); - themeCategory.setTitle(getString(R.string.pref_category_theme)); + themeCategory.setTitle(R.string.pref_category_theme); themeCategory.setIconSpaceReserved(false); themeCategory.addPreference(getThemePreference()); themeCategory.addPreference(getAmoledThemePreference()); final PreferenceCategory downloadsCategory = new PreferenceCategory(requireContext()); screen.addPreference(downloadsCategory); - downloadsCategory.setTitle(getString(R.string.pref_category_downloads)); + downloadsCategory.setTitle(R.string.pref_category_downloads); downloadsCategory.setIconSpaceReserved(false); downloadsCategory.addPreference(getDownloadUserFolderPreference()); downloadsCategory.addPreference(getSaveToCustomFolderPreference()); final PreferenceCategory localeCategory = new PreferenceCategory(requireContext()); screen.addPreference(localeCategory); - localeCategory.setTitle(getString(R.string.pref_category_locale)); + localeCategory.setTitle(R.string.pref_category_locale); localeCategory.setIconSpaceReserved(false); localeCategory.addPreference(getLanguagePreference()); localeCategory.addPreference(getPostTimePreference()); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index abdfa50f..84a0286a 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -259,6 +259,8 @@ Theme Downloads Locale + Account + Current login not working? Simply add the account again. Add account License (English only) Visit our website @@ -267,6 +269,8 @@ Audit, star, report bugs, contribute, and have fun (again)! Send feedback by email instagrabber@austinhuang.me - Third-Party Libraries - The following third-party libraries are used in this app: + Third-Party Attributions + The following third-party open-source libraries are used: + Reminder + Please use this app responsibly. Downloaded images should only be used for purposes allowed by applicable laws. \ No newline at end of file