Skip to content

Commit f272357

Browse files
author
jlorich
committed
Merge pull request #73 from cloudspace/70393186_fix_add_by_url
70393186 fix add by url
2 parents 94ed168 + 84a28c2 commit f272357

29 files changed

Lines changed: 12284 additions & 12262 deletions

EasyReader/Application/Controllers/EZRHomeScrollViewDelegate.m

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ @implementation EZRHomeScrollViewDelegate
1313
{
1414
EZRHomeViewController *controller;
1515
NSString *currentURL;
16+
BOOL dragging;
17+
CGPoint dragStart;
1618
}
1719

1820
- (instancetype)initWithController:(EZRHomeViewController *)homeController
@@ -21,18 +23,41 @@ - (instancetype)initWithController:(EZRHomeViewController *)homeController
2123

2224
if (self) {
2325
controller = homeController;
26+
dragging = NO;
2427
}
2528

2629
return self;
2730
}
2831

2932
//
3033
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
34+
// Make scrolling back up to the top feel more natural
3135
if (scrollView.contentOffset.y == scrollView.frame.size.height) {
3236
if (controller.webView_feedItem.scrollView.contentOffset.y == 0) {
3337
controller.webView_feedItem.scrollView.contentOffset = CGPointMake(0, 1);
3438
}
3539
}
40+
41+
// Prevent collectionview scrolling when shar bar is showing
42+
if (scrollView.contentOffset.y < 0) {
43+
controller.collectionView_feedItems.userInteractionEnabled = NO;
44+
} else {
45+
controller.collectionView_feedItems.userInteractionEnabled = YES;
46+
}
47+
48+
// Don't allow drags from the share view to go past the base view without a stop
49+
if (dragging && dragStart.y < 0 && scrollView.contentOffset.y >= 0) {
50+
scrollView.contentOffset = CGPointMake(0,0);
51+
}
52+
}
53+
54+
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
55+
dragging = YES;
56+
dragStart = scrollView.contentOffset;
57+
}
58+
59+
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
60+
dragging = NO;
3661
}
3762

3863
/**

EasyReader/Application/Controllers/Home/EZRHomeViewController.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@
4242
/// Displays website that hosts article
4343
@property (nonatomic, strong) EZRNestableWebView *webView_feedItem;
4444

45-
@property (nonatomic, strong) UIToolbar *toolbar_webView;
46-
47-
@property (nonatomic, strong) UIImageView *upIndicatorView;
48-
49-
5045

5146
# pragma mark - Properties
5247

EasyReader/Application/Controllers/Home/EZRHomeViewController.m

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ @interface EZRHomeViewController()
4747
@property User *currentUser;
4848

4949

50-
///
50+
/// The current feeds provider object
5151
@property (nonatomic, strong) EZRCurrentFeedsProvider *currentFeedsProvider;
5252

53-
54-
53+
/// The social sharing toolbar
5554
@property (nonatomic, weak) IBOutlet CLDSocialShareToolbar *socialShareToolbar;
5655

56+
/// The up indicator displayed over the web view to assist in navigating to the top of the page
57+
@property (nonatomic, strong) UIImageView *upIndicatorView;
58+
5759
@end
5860

5961

EasyReader/Application/Controllers/Menu/EZRMenuSearchController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ - (void)displayURL:(NSString*)searchText {
112112
]
113113
};
114114

115+
[self postSearchStateChangeNotification:kEZRSearchStateResultsAvailable];
115116
}
116117

117118
- (void)postSearchStateChangeNotification:(EZRSearchState)state

EasyReader/Application/Controllers/Menu/EZRMenuTableViewDelegate.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
4242
Feed *existingFeed = [Feed MR_findFirstByAttribute:@"id" withValue:feedData[@"id"]];
4343

4444
if (!existingFeed) {
45-
4645
[Feed createFeedWithUrl:feedData[@"url"] success:^(id responseObject, NSInteger httpStatus) {
4746

4847
} failure:^(id responseObject, NSInteger httpStatus, NSError *error) {

0 commit comments

Comments
 (0)