mirror of
https://github.com/viq/NewsBlur.git
synced 2025-09-18 21:43:31 +00:00
#1287 (mark read on scroll)
- Added a preference to override the mark read on scroll option per feed/folder. - If off, changing the feed menu item toggles the global preference. - If on, changing it only affects that feed.
This commit is contained in:
parent
1a6d408f9b
commit
7219bc8df4
4 changed files with 36 additions and 7 deletions
|
@ -1849,13 +1849,17 @@ heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|||
}
|
||||
|
||||
- (BOOL)isMarkReadOnScroll {
|
||||
NSNumber *markRead = [[NSUserDefaults standardUserDefaults] objectForKey:appDelegate.storiesCollection.scrollReadFilterKey];
|
||||
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
if (markRead != nil) {
|
||||
return markRead.boolValue;
|
||||
if ([userPreferences boolForKey:@"override_scroll_read_filter"]) {
|
||||
NSNumber *markRead = [userPreferences objectForKey:appDelegate.storiesCollection.scrollReadFilterKey];
|
||||
|
||||
if (markRead != nil) {
|
||||
return markRead.boolValue;
|
||||
}
|
||||
}
|
||||
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:@"default_scroll_read_filter"];
|
||||
return [userPreferences boolForKey:@"default_scroll_read_filter"];
|
||||
}
|
||||
|
||||
- (void)checkScroll {
|
||||
|
|
|
@ -289,7 +289,12 @@
|
|||
}
|
||||
|
||||
- (NSString *)scrollReadFilterKey {
|
||||
if (self.isRiverView) {
|
||||
NSUserDefaults *userPreferences = [NSUserDefaults standardUserDefaults];
|
||||
BOOL shouldOverride = [userPreferences boolForKey:@"override_scroll_read_filter"];
|
||||
|
||||
if (!shouldOverride) {
|
||||
return @"default_scroll_read_filter";
|
||||
} else if (self.isRiverView) {
|
||||
return [NSString stringWithFormat:@"folder:%@:scroll_read_filter", self.activeFolder];
|
||||
} else {
|
||||
return [NSString stringWithFormat:@"%@:scroll_read_filter", [self.activeFeed objectForKey:@"id"]];
|
||||
|
|
|
@ -142,15 +142,25 @@
|
|||
<key>Key</key>
|
||||
<string>show_global_shared_stories</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Mark stories read on scroll</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>YES</string>
|
||||
<key>Key</key>
|
||||
<string>default_scroll_read_filter</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Mark stories read on scroll</string>
|
||||
<string>Override scroll read per feed/folder</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>YES</string>
|
||||
<key>Key</key>
|
||||
<string>default_scroll_read_filter</string>
|
||||
<string>override_scroll_read_filter</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
|
|
|
@ -152,6 +152,16 @@
|
|||
<key>Key</key>
|
||||
<string>default_scroll_read_filter</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSToggleSwitchSpecifier</string>
|
||||
<key>Title</key>
|
||||
<string>Override scroll read per feed/folder</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>YES</string>
|
||||
<key>Key</key>
|
||||
<string>override_scroll_read_filter</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>Type</key>
|
||||
<string>PSMultiValueSpecifier</string>
|
||||
|
|
Loading…
Add table
Reference in a new issue