Browse Source

restoration of DM mark-as-seen setting

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

25
app/src/main/java/awais/instagrabber/fragments/settings/SettingsPreferencesFragment.java

@ -84,15 +84,17 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment {
loggedInUsersPreferenceCategory.setIconSpaceReserved(false); loggedInUsersPreferenceCategory.setIconSpaceReserved(false);
loggedInUsersPreferenceCategory.setTitle(R.string.login_settings); loggedInUsersPreferenceCategory.setTitle(R.string.login_settings);
loggedInUsersPreferenceCategory.addPreference(getMarkStoriesSeenPreference()); loggedInUsersPreferenceCategory.addPreference(getMarkStoriesSeenPreference());
loggedInUsersPreferenceCategory.addPreference(getMarkDMSeenPreference());
loggedInUsersPreferenceCategory.addPreference(getEnableActivityNotificationsPreference()); loggedInUsersPreferenceCategory.addPreference(getEnableActivityNotificationsPreference());
} }
final PreferenceCategory anonUsersPreferenceCategory = new PreferenceCategory(requireContext());
screen.addPreference(anonUsersPreferenceCategory);
anonUsersPreferenceCategory.setIconSpaceReserved(false);
anonUsersPreferenceCategory.setTitle(R.string.anonymous_settings);
anonUsersPreferenceCategory.addPreference(getUseInstaDpPreference());
anonUsersPreferenceCategory.addPreference(getUseStoriesIgPreference());
else {
final PreferenceCategory anonUsersPreferenceCategory = new PreferenceCategory(requireContext());
screen.addPreference(anonUsersPreferenceCategory);
anonUsersPreferenceCategory.setIconSpaceReserved(false);
anonUsersPreferenceCategory.setTitle(R.string.anonymous_settings);
anonUsersPreferenceCategory.addPreference(getUseInstaDpPreference());
anonUsersPreferenceCategory.addPreference(getUseStoriesIgPreference());
}
} }
@ -233,6 +235,15 @@ public class SettingsPreferencesFragment extends BasePreferencesFragment {
return preference; return preference;
} }
private Preference getMarkDMSeenPreference() {
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext());
preference.setKey(Constants.DM_MARK_AS_SEEN);
preference.setTitle(R.string.dm_mark_as_seen_setting);
preference.setSummary(R.string.dm_mark_as_seen_setting_summary);
preference.setIconSpaceReserved(false);
return preference;
}
private Preference getEnableActivityNotificationsPreference() { private Preference getEnableActivityNotificationsPreference() {
final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext()); final SwitchPreferenceCompat preference = new SwitchPreferenceCompat(requireContext());
preference.setKey(Constants.CHECK_ACTIVITY); preference.setKey(Constants.CHECK_ACTIVITY);

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

@ -39,7 +39,7 @@
<string name="autoload_posts">Auto-load all posts from user</string> <string name="autoload_posts">Auto-load all posts from user</string>
<string name="mark_as_seen_setting">Mark stories as seen after viewing</string> <string name="mark_as_seen_setting">Mark stories as seen after viewing</string>
<string name="mark_as_seen_setting_summary">Story author will know you viewed it</string> <string name="mark_as_seen_setting_summary">Story author will know you viewed it</string>
<string name="dm_mark_as_seen_setting">Automatically mark DM as seen after viewing</string>
<string name="dm_mark_as_seen_setting">Mark DM as seen after viewing</string>
<string name="dm_mark_as_seen_setting_summary">Other members will know you viewed it</string> <string name="dm_mark_as_seen_setting_summary">Other members will know you viewed it</string>
<string name="activity_setting">Enable activity notifications</string> <string name="activity_setting">Enable activity notifications</string>
<string name="error_loading_profile">Error loading profile!\nTry logging in and search again.</string> <string name="error_loading_profile">Error loading profile!\nTry logging in and search again.</string>

Loading…
Cancel
Save