[MediaWiki-commits] [Gerrit] Article loading indicator. Fades out current article backgro... - change (apps...wikipedia)
Mhurd has uploaded a new change for review. https://gerrit.wikimedia.org/r/165339 Change subject: Article loading indicator. Fades out current article background too. .. Article loading indicator. Fades out current article background too. Change-Id: I5c4f2e05c80b3fc948b800f3052efbf140825565 --- M wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M wikipedia/View Controllers/Navigation/Center/CenterNavController.m M wikipedia/View Controllers/References/ReferenceVC.m M wikipedia/View Controllers/WebView/WebViewController.h M wikipedia/View Controllers/WebView/WebViewController.m 5 files changed, 113 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia refs/changes/39/165339/1 diff --git a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m index 6255df8..3801217 100644 --- a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m +++ b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m @@ -269,7 +269,8 @@ [webVC navigateToPage: history.article.titleObj domain: history.article.domain discoveryMethod: DISCOVERY_METHOD_BACKFORWARD - invalidatingCache: NO]; +invalidatingCache: NO + showLoadingIndicator: NO]; } } @@ -286,7 +287,8 @@ [webVC navigateToPage: history.article.titleObj domain: history.article.domain discoveryMethod: DISCOVERY_METHOD_BACKFORWARD - invalidatingCache: NO]; +invalidatingCache: NO + showLoadingIndicator: NO]; } } diff --git a/wikipedia/View Controllers/Navigation/Center/CenterNavController.m b/wikipedia/View Controllers/Navigation/Center/CenterNavController.m index 7621b22..54753aa 100644 --- a/wikipedia/View Controllers/Navigation/Center/CenterNavController.m +++ b/wikipedia/View Controllers/Navigation/Center/CenterNavController.m @@ -93,7 +93,8 @@ [webVC navigateToPage: title domain: domain discoveryMethod: discoveryMethod -invalidatingCache: invalidateCache]; +invalidatingCache: invalidateCache + showLoadingIndicator: YES]; if (popToWebVC) { [ROOT popToViewController:webVC animated:animated]; } diff --git a/wikipedia/View Controllers/References/ReferenceVC.m b/wikipedia/View Controllers/References/ReferenceVC.m index f9ea5da..0bf988d 100644 --- a/wikipedia/View Controllers/References/ReferenceVC.m +++ b/wikipedia/View Controllers/References/ReferenceVC.m @@ -62,7 +62,8 @@ [self.webVC navigateToPage: pageTitle domain: [SessionSingleton sharedInstance].currentArticleDomain discoveryMethod: DISCOVERY_METHOD_LINK - invalidatingCache: NO]; + invalidatingCache: NO + showLoadingIndicator: YES]; [self.webVC referencesHide]; return NO; } diff --git a/wikipedia/View Controllers/WebView/WebViewController.h b/wikipedia/View Controllers/WebView/WebViewController.h index fb00508..6ba5eba 100644 --- a/wikipedia/View Controllers/WebView/WebViewController.h +++ b/wikipedia/View Controllers/WebView/WebViewController.h @@ -27,7 +27,8 @@ -(void)navigateToPage: (MWPageTitle *)title domain: (NSString *)domain discoveryMethod: (ArticleDiscoveryMethod)discoveryMethod -invalidatingCache: (BOOL)invalidateCache; +invalidatingCache: (BOOL)invalidateCache + showLoadingIndicator: (BOOL)showLoadingIndicator; -(void)tocScrollWebViewToSectionWithElementId: (NSString *)elementId duration: (CGFloat)duration diff --git a/wikipedia/View Controllers/WebView/WebViewController.m b/wikipedia/View Controllers/WebView/WebViewController.m index 2c35dca..9f7ff8f 100644 --- a/wikipedia/View Controllers/WebView/WebViewController.m +++ b/wikipedia/View Controllers/WebView/WebViewController.m @@ -136,6 +136,8 @@ @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomNavHeightConstraint; +@property (strong, nonatomic) UIActivityIndicatorView *activityIndicator; + @end #pragma mark Internal variables @@ -279,6 +281,8 @@ */ [self tocUpdateViewLayout]; + +[self loadingIndicatorAdd]; } -(void)tocUpdateViewLayout @@ -960,7 +964,8 @@ [weakSelf navigateToPage: pageTitle domain: [SessionSingleton sharedInstance].currentArticleDomain discoveryMethod: DISCOVERY_METHOD_LINK - invalidatingCache: NO]; + invalidatingCache: NO +showLoadingIndi
[MediaWiki-commits] [Gerrit] Article loading indicator. Fades out current article backgro... - change (apps...wikipedia)
Brion VIBBER has submitted this change and it was merged. Change subject: Article loading indicator. Fades out current article background too. .. Article loading indicator. Fades out current article background too. Change-Id: I5c4f2e05c80b3fc948b800f3052efbf140825565 --- M wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m M wikipedia/View Controllers/Navigation/Center/CenterNavController.m M wikipedia/View Controllers/References/ReferenceVC.m M wikipedia/View Controllers/WebView/WebViewController.h M wikipedia/View Controllers/WebView/WebViewController.m 5 files changed, 138 insertions(+), 13 deletions(-) Approvals: Brion VIBBER: Verified; Looks good to me, approved diff --git a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m index 6255df8..3801217 100644 --- a/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m +++ b/wikipedia/View Controllers/Navigation/Bottom/BottomMenuViewController.m @@ -269,7 +269,8 @@ [webVC navigateToPage: history.article.titleObj domain: history.article.domain discoveryMethod: DISCOVERY_METHOD_BACKFORWARD - invalidatingCache: NO]; +invalidatingCache: NO + showLoadingIndicator: NO]; } } @@ -286,7 +287,8 @@ [webVC navigateToPage: history.article.titleObj domain: history.article.domain discoveryMethod: DISCOVERY_METHOD_BACKFORWARD - invalidatingCache: NO]; +invalidatingCache: NO + showLoadingIndicator: NO]; } } diff --git a/wikipedia/View Controllers/Navigation/Center/CenterNavController.m b/wikipedia/View Controllers/Navigation/Center/CenterNavController.m index 7621b22..54753aa 100644 --- a/wikipedia/View Controllers/Navigation/Center/CenterNavController.m +++ b/wikipedia/View Controllers/Navigation/Center/CenterNavController.m @@ -93,7 +93,8 @@ [webVC navigateToPage: title domain: domain discoveryMethod: discoveryMethod -invalidatingCache: invalidateCache]; +invalidatingCache: invalidateCache + showLoadingIndicator: YES]; if (popToWebVC) { [ROOT popToViewController:webVC animated:animated]; } diff --git a/wikipedia/View Controllers/References/ReferenceVC.m b/wikipedia/View Controllers/References/ReferenceVC.m index f9ea5da..0bf988d 100644 --- a/wikipedia/View Controllers/References/ReferenceVC.m +++ b/wikipedia/View Controllers/References/ReferenceVC.m @@ -62,7 +62,8 @@ [self.webVC navigateToPage: pageTitle domain: [SessionSingleton sharedInstance].currentArticleDomain discoveryMethod: DISCOVERY_METHOD_LINK - invalidatingCache: NO]; + invalidatingCache: NO + showLoadingIndicator: YES]; [self.webVC referencesHide]; return NO; } diff --git a/wikipedia/View Controllers/WebView/WebViewController.h b/wikipedia/View Controllers/WebView/WebViewController.h index fb00508..6ba5eba 100644 --- a/wikipedia/View Controllers/WebView/WebViewController.h +++ b/wikipedia/View Controllers/WebView/WebViewController.h @@ -27,7 +27,8 @@ -(void)navigateToPage: (MWPageTitle *)title domain: (NSString *)domain discoveryMethod: (ArticleDiscoveryMethod)discoveryMethod -invalidatingCache: (BOOL)invalidateCache; +invalidatingCache: (BOOL)invalidateCache + showLoadingIndicator: (BOOL)showLoadingIndicator; -(void)tocScrollWebViewToSectionWithElementId: (NSString *)elementId duration: (CGFloat)duration diff --git a/wikipedia/View Controllers/WebView/WebViewController.m b/wikipedia/View Controllers/WebView/WebViewController.m index 2c35dca..77dd2f4 100644 --- a/wikipedia/View Controllers/WebView/WebViewController.m +++ b/wikipedia/View Controllers/WebView/WebViewController.m @@ -136,6 +136,9 @@ @property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomNavHeightConstraint; +@property (strong, nonatomic) UIActivityIndicatorView *activityIndicator; +@property (strong, nonatomic) UIView *activityIndicatorBackgroundView; + @end #pragma mark Internal variables @@ -279,6 +282,8 @@ */ [self tocUpdateViewLayout]; + +[self loadingIndicatorAdd]; } -(void)tocUpdateViewLayout @@ -677,6 +682,9 @@ // Prevent toc reveal if pull to refresh in effect. if (self.webView.scrollView.contentOffset.y < 0) return; +// Prevent toc reveal if loading article. +if (self.activityIndicator.isAnimating) return; + NSString *currentArticleTitle = [SessionSingleton sharedInstance].curren