Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
//  MusicheVC.m
//  Foresta
//
//  Created by Fabrizio on 19/12/12.
//  Copyright (c) 2012 Odyssey. All rights reserved.
//

#import "MusicheVC.h"
#import "NoConnectionVC.h"
#import "CopertinaVC.h"

@interface MusicheVC ()

@end

@implementation MusicheVC

@synthesize musicheItems;
@synthesize btn1;
@synthesize btn2;
@synthesize backToChapterBtn;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
        
    [btn1 addTarget:self action:@selector(buttonHighlight:) forControlEvents:UIControlEventTouchDown];
    
    btn2.titleLabel.textAlignment = UITextAlignmentCenter;
    [btn2 addTarget:self action:@selector(buttonHighlight:) forControlEvents:UIControlEventTouchDown];
}

- (void) viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    backToChapterBtn.hidden = !DATAMANAGER.isReading;
}

- (IBAction)doBackToChapter {
    [self.navigationController pushViewController:[DATAMANAGER backToReaderView:DATAMANAGER.readingChapter] animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


#pragma mark -
#pragma mark IBAction

- (IBAction)doBack {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)goToAttoriWeb {
    if([DATAMANAGER testConnection]) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString: LINK_ATTORI]];
    }
    else {
        NoConnectionVC *noConnVC = [[NoConnectionVC alloc]initWithImage:[UIImage imageNamed:@"attori_noConn.png"]];
        [self.navigationController pushViewController:noConnVC animated:YES];
    }
}

- (void)goToCopertina {
    CopertinaVC *copertinaVC = [[CopertinaVC alloc]initWithNibName:@"CopertinaVC" bundle:nil];
    [self.navigationController pushViewController:copertinaVC animated:YES];
}

- (void) buttonHighlight:(id)sender {
    UIButton *button = (UIButton*)sender;
    
    [UIView animateWithDuration:0.2 animations:^{
        [button setBackgroundColor:[UIColor lightGrayColor]];
    }
    completion:^(BOOL finished) {
        [button setBackgroundColor:[UIColor darkGrayColor]];
        if(button.tag == 1) {
            [self goToCopertina];
        }
        else {
            [self goToAttoriWeb];
        }
    }];
}

- (IBAction)doDownload {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString: LINK_DOWNLOAD]];
}

@end





Commits for Nextrek/iOS/Emmanuele Rossi/Trivagolando/Trivagolando/MusicheVC.m

Diff revisions: vs.
Revision Author Commited Message
67 FAquili picture FAquili Thu 23 Jan, 2014 14:31:55 +0000

Emmanuele Rossi apps
- mostri
- trikster
- trivagolando