Browse Source

more crash resolution and home decor

renovate/org.robolectric-robolectric-4.x
Austin Huang 4 years ago
parent
commit
73a9e627d9
No known key found for this signature in database GPG Key ID: 84C23AA04587A91F
  1. 11
      app/src/main/java/awais/instagrabber/fragments/FollowViewerFragment.java
  2. 10
      app/src/main/java/awais/instagrabber/fragments/settings/MorePreferencesFragment.java
  3. 8
      app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java
  4. 8
      app/src/main/res/values/strings.xml

11
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() {

10
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

8
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());

8
app/src/main/res/values/strings.xml

@ -259,6 +259,8 @@
<string name="pref_category_theme">Theme</string>
<string name="pref_category_downloads">Downloads</string>
<string name="pref_category_locale">Locale</string>
<string name="account">Account</string>
<string name="account_hint">Current login not working? Simply add the account again.</string>
<string name="add_account">Add account</string>
<string name="about_category_license">License (English only)</string>
<string name="about_documentation">Visit our website</string>
@ -267,6 +269,8 @@
<string name="about_repository_summary">Audit, star, report bugs, contribute, and have fun (again)!</string>
<string name="about_feedback">Send feedback by email</string>
<string name="about_feedback_summary" translatable="false">[email protected]</string>
<string name="about_category_3pt">Third-Party Libraries</string>
<string name="about_category_3pt_summary">The following third-party libraries are used in this app:</string>
<string name="about_category_3pt">Third-Party Attributions</string>
<string name="about_category_3pt_summary">The following third-party open-source libraries are used:</string>
<string name="reminder">Reminder</string>
<string name="reminder_summary">Please use this app responsibly. Downloaded images should only be used for purposes allowed by applicable laws.</string>
</resources>
Loading…
Cancel
Save