Skip to content

Commit

Permalink
Icon badge number set to 0 when Open Pdf
Browse files Browse the repository at this point in the history
Fix Bug double interface when receive remote notification
  • Loading branch information
Gianluca committed Nov 9, 2011
1 parent abf1634 commit 7ef62f7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Classes/KioskApp/Controllers/MenuViewController_Kiosk.h
Expand Up @@ -29,6 +29,7 @@
UIScrollView *scrollView;

BOOL graphicsMode;
BOOL interfaceLoaded;
}

-(IBAction)actionOpenPlainDocument:(NSString *)documentName;
Expand All @@ -49,5 +50,6 @@
@property (nonatomic,retain ) NSDictionary *progressViewDict;
@property (nonatomic,retain ) NSDictionary *imgDict;
@property (nonatomic,assign ) BOOL graphicsMode;
@property (nonatomic,assign ) BOOL interfaceLoaded;

@end
8 changes: 6 additions & 2 deletions Classes/KioskApp/Controllers/MenuViewController_Kiosk.m
Expand Up @@ -25,12 +25,15 @@ @implementation MenuViewController_Kiosk
@synthesize documentsList;
@synthesize graphicsMode;
@synthesize scrollView;
@synthesize interfaceLoaded;


-(IBAction)actionOpenPlainDocument:(NSString *)documentName {

MFDocumentManager * documentManager = nil;
ReaderViewController * documentViewController = nil;

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];

NSArray *paths = nil;
NSString *documentsDirectory = nil;
Expand Down Expand Up @@ -174,7 +177,7 @@ -(void)buildInterface{
if (scrollView) {
[scrollView removeFromSuperview];
}else{

// Border.

if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
Expand All @@ -191,7 +194,7 @@ -(void)buildInterface{
}

aScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, scrollViewVOffset, scrollViewWidth, scrollViewHeight)];
aScrollView.backgroundColor = [UIColor whiteColor];
aScrollView.backgroundColor = [UIColor clearColor];
aScrollView.contentSize = CGSizeMake(scrollViewWidth, detailViewHeight * ((documentsCount/2)+(documentsCount%2)));

for (int i=1; i<= documentsCount ; i++) {
Expand Down Expand Up @@ -234,6 +237,7 @@ -(void)buildInterface{
}
scrollView = aScrollView;
[self.view addSubview:scrollView];
interfaceLoaded = YES;
// self.scrollView = aScrollView; // Not referenced anywhere else.
[aScrollView release];

Expand Down
6 changes: 3 additions & 3 deletions Classes/KioskApp/FastPDFKit_KioskAppDelegate.m
Expand Up @@ -202,11 +202,11 @@ - (void)connectionDidFinishDownloading:(NSURLConnection *)connection destination

//reload interface
if (menuVC_Kiosk) {
[menuVC_Kiosk buildInterface];
if (menuVC_Kiosk.interfaceLoaded) {
[menuVC_Kiosk buildInterface];
}
}



}

- (void)connection:(NSURLConnection *)connection didWriteData:(long long)bytesWritten totalBytesWritten:(long long)totalBytesWritten expectedTotalBytes:(long long)expectedTotalBytes{
Expand Down

0 comments on commit 7ef62f7

Please sign in to comment.