From 8d603a7de7b0e5e8f72eabe6b2307c4dfff5b663 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 1 Dec 2010 23:04:06 -0800 Subject: Only run the UIActivityIndicatorView animation while visible. --- UICaboodle/BrowserView.mm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'UICaboodle') diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index db8719c..5fd65c2 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -890,11 +890,15 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se if ([self isLoading]) { [[self navigationItem] setRightBarButtonItem:loadingitem_ animated:YES]; [self performSelector:@selector(layoutRightButton) withObject:nil afterDelay:0]; + + [indicator_ startAnimating]; [self applyLoadingTitle]; - } else if (custom_ != nil) { - [[self navigationItem] setRightBarButtonItem:[self customButton] animated:YES]; } else { - [[self navigationItem] setRightBarButtonItem:[self rightButton] animated:YES]; + [indicator_ stopAnimating]; + + [[self navigationItem] setRightBarButtonItem:( + custom_ != nil ? [self customButton] : [self rightButton] + ) animated:YES]; } } @@ -1009,7 +1013,6 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se indicator_ = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; [indicator_ setFrame:CGRectMake(15, 5, [indicator_ frame].size.width, [indicator_ frame].size.height)]; - [indicator_ startAnimating]; [webview_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; [indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin]; -- cgit v1.2.3