From: Jay Freeman (saurik) Date: Thu, 2 Dec 2010 07:04:06 +0000 (-0800) Subject: Only run the UIActivityIndicatorView animation while visible. X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/9c44cbca951c9f52c63e87181b28a7ba958e2ebb Only run the UIActivityIndicatorView animation while visible. --- diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index db8719cb..5fd65c21 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];