Production version
Add to Git the current app version (the same available in the OriginalZip folder)
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// CellDettagliMappaTableViewCell.h
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 31/10/18.
|
||||
// Copyright © 2018 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "Cell_Reti_sismicheTableViewCell.h"
|
||||
#import <GoogleMaps/GoogleMaps.h>
|
||||
#import "EQNSisma.h"
|
||||
#import <MapKit/MapKit.h>
|
||||
|
||||
@interface CellDettagliMappaTableViewCell : Cell_Reti_sismicheTableViewCell <MKMapViewDelegate>
|
||||
|
||||
@property (nonatomic, strong) IBOutlet MKMapView *mapView;
|
||||
-(UIImage *)condividiViewPath;
|
||||
@end
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
//
|
||||
// CellDettagliMappaTableViewCell.m
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 31/10/18.
|
||||
// Copyright © 2018 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import "CellDettagliMappaTableViewCell.h"
|
||||
#import "Costanti.h"
|
||||
#import <QuartzCore/QuartzCore.h>
|
||||
|
||||
@implementation CellDettagliMappaTableViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
[self setupView];
|
||||
}
|
||||
|
||||
-(void)setupView{
|
||||
|
||||
[super setupView];
|
||||
|
||||
CLLocation *coordinate = [[CLLocation alloc] initWithLatitude:[self.sisma.latitude doubleValue] longitude:[self.sisma.longitude doubleValue]];
|
||||
|
||||
MKCoordinateSpan span = MKCoordinateSpanMake(0.5, 0.5);
|
||||
MKCoordinateRegion region = MKCoordinateRegionMake(coordinate.coordinate, span);
|
||||
|
||||
[self.mapView setCenterCoordinate:coordinate.coordinate animated:NO];
|
||||
[self.mapView setRegion:region animated:YES];
|
||||
self.mapView.scrollEnabled = NO;
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
-(UIImage *)condividiViewPath{
|
||||
|
||||
// define the size and grab a UIImage from it
|
||||
|
||||
UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0.0);
|
||||
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
|
||||
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
||||
UIGraphicsEndImageContext();
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// Cell_Meteo_TableViewCell.h
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 01/11/18.
|
||||
// Copyright © 2018 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Cell_Reti_sismicheTableViewCell.h"
|
||||
|
||||
@interface Cell_Meteo_TableViewCell : Cell_Reti_sismicheTableViewCell
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,85 @@
|
||||
//
|
||||
// Cell_Meteo_TableViewCell.m
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 01/11/18.
|
||||
// Copyright © 2018 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Cell_Meteo_TableViewCell.h"
|
||||
#import <CoreText/CoreText.h>
|
||||
|
||||
@implementation Cell_Meteo_TableViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
-(void)setupView{
|
||||
|
||||
[super setupView];
|
||||
|
||||
NSString *temp = NSLocalizedString(@"Temperatura: ", @"");
|
||||
NSString *valueTemp = [NSString stringWithFormat:@"%1.f %°C", [self.sisma.te floatValue]-273];
|
||||
NSString *tempDesc = [NSString stringWithFormat:@"%@%@", temp, valueTemp];
|
||||
|
||||
|
||||
NSString *pres = NSLocalizedString(@"Pressione:", @"");
|
||||
NSString *valuePre = [NSString stringWithFormat:@"%@mb", self.sisma.pr];
|
||||
NSString *presDesc = [NSString stringWithFormat:@"%@%@",pres, valuePre];
|
||||
|
||||
NSString *vent = NSLocalizedString(@"Velocità vento: ", @"");
|
||||
NSString *valueVento = [NSString stringWithFormat:@"%@m/s", self.sisma.ws];
|
||||
NSString *ventoDesc = [NSString stringWithFormat:@"%@%@", vent, valueVento];
|
||||
|
||||
NSString *umi = NSLocalizedString(@"Umidità : ", @"");
|
||||
NSString *umiValue = [NSString stringWithFormat:@"%@%%", self.sisma.hu];
|
||||
NSString *umiditaDesc = [NSString stringWithFormat:@"%@%@", umi, umiValue];
|
||||
|
||||
NSString *nuv = NSLocalizedString(@"Copertura nuvolosa : ", @"");
|
||||
NSString *nuvValue = [NSString stringWithFormat:@"%@%%", self.sisma.cl];
|
||||
NSString *nuvolDesc = [NSString stringWithFormat:@"%@%@",nuv, nuvValue];
|
||||
|
||||
UILabel *titolo = (UILabel *)[self viewWithTag:20];
|
||||
titolo.text = NSLocalizedString(@"Meteo al momento del sisma", @"");
|
||||
|
||||
UILabel *temperatura = (UILabel *)[self viewWithTag:21];
|
||||
temperatura.attributedText = [self getAttributeString:tempDesc withRange:NSMakeRange(temp.length, valueTemp.length)];
|
||||
|
||||
UILabel *pressione = (UILabel *)[self viewWithTag:22];
|
||||
pressione.attributedText = [self getAttributeString:presDesc withRange:NSMakeRange(pres.length, valuePre.length)];
|
||||
|
||||
UILabel *vento = (UILabel *)[self viewWithTag:23];
|
||||
vento.attributedText = [self getAttributeString:ventoDesc withRange:NSMakeRange(vent.length, valueVento.length)];
|
||||
|
||||
UILabel *umidita = (UILabel *)[self viewWithTag:24];
|
||||
umidita.attributedText = [self getAttributeString:umiditaDesc withRange:NSMakeRange(umi.length, umiValue.length)];
|
||||
|
||||
UILabel *nuvolosita = (UILabel *)[self viewWithTag:25];
|
||||
nuvolosita.attributedText = [self getAttributeString:nuvolDesc withRange:NSMakeRange(nuv.length, nuvValue.length)];
|
||||
|
||||
UIImageView *icona = (UIImageView *)[self viewWithTag:26];
|
||||
NSString *imagName = [NSString stringWithFormat:@"weather_%@.png", self.sisma.ic];
|
||||
icona.image = [UIImage imageNamed:imagName];
|
||||
}
|
||||
|
||||
-(NSMutableAttributedString *)getAttributeString:(NSString *)string withRange:(NSRange )range{
|
||||
|
||||
NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:string];
|
||||
[attrString beginEditing];
|
||||
[attrString addAttribute:NSFontAttributeName value:[UIFont boldSystemFontOfSize:17] range:range];
|
||||
[attrString endEditing];
|
||||
|
||||
return attrString;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Cell_Reti_sismicheTableViewCell.h
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 01/11/18.
|
||||
// Copyright © 2018 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "Costanti.h"
|
||||
#import "EQNSisma.h"
|
||||
|
||||
@interface Cell_Reti_sismicheTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, strong) EQNSisma *sisma;
|
||||
@property (nonatomic, weak) UIButton *mappaButton;
|
||||
@property (nonatomic, weak) UIButton *meteoButton;
|
||||
@property (nonatomic, weak) UIButton *chiudi;
|
||||
@property (nonatomic, weak) UIButton *condividi;
|
||||
@property (nonatomic, weak) UIButton *dettagliMappa;
|
||||
@property (nonatomic, weak) UIButton *clickMappa;
|
||||
|
||||
-(void)setupView;
|
||||
-(void)createOtherButton;
|
||||
-(void)condividiView;
|
||||
@end
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
//
|
||||
// Cell_Reti_sismicheTableViewCell.m
|
||||
// Earthquake Network
|
||||
//
|
||||
// Created by Luca Beretta on 01/11/18.
|
||||
// Copyright © 2018 Luca Beretta. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Cell_Reti_sismicheTableViewCell.h"
|
||||
|
||||
@implementation Cell_Reti_sismicheTableViewCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
-(void)setupView{
|
||||
|
||||
UILabel *place = (UILabel *)[self viewWithTag:1];
|
||||
place.text = self.sisma.place;
|
||||
|
||||
UILabel *provider = (UILabel *)[self viewWithTag:2];
|
||||
provider.text = self.sisma.provider;
|
||||
|
||||
UILabel *magnitudo = (UILabel *)[self viewWithTag:3];
|
||||
magnitudo.text = NSLocalizedString(@"Magnitudo", @"");
|
||||
|
||||
UILabel *magnitudoValore = (UILabel *)[self viewWithTag:4];
|
||||
magnitudoValore.text = [NSString stringWithFormat:@"%@ mb", self.sisma.magnitude];
|
||||
|
||||
UILabel *profondita = (UILabel *)[self viewWithTag:5];
|
||||
profondita.text = [NSString stringWithFormat:@"%@: %.2f Km", NSLocalizedString(@"Profondità", @""), [self.sisma.depth floatValue]];
|
||||
|
||||
UILabel *data = (UILabel *)[self viewWithTag:6];
|
||||
|
||||
int tempo = 0;
|
||||
if ([self.sisma.differenza intValue] > 60) {
|
||||
|
||||
tempo = [self.sisma.differenza intValue]/60;
|
||||
data.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Data(Ora tua):", @"") , [NSString stringWithFormat:@"%@ - %d %@", self.sisma.data, tempo, NSLocalizedString(@"ore fa", @"")]];
|
||||
}else{
|
||||
|
||||
data.text = [NSString stringWithFormat:@"%@ %@",NSLocalizedString(@"Data(Ora tua):", @"") , [NSString stringWithFormat:@"%@ - %@ %@", self.sisma.data, self.sisma.differenza, NSLocalizedString(@"minuti fa", @"")]];
|
||||
}
|
||||
|
||||
// UILabel *dataValue = (UILabel *)[self viewWithTag:8];
|
||||
// dataValue.text = ;
|
||||
|
||||
UILabel *distanza = (UILabel *)[self viewWithTag:9];
|
||||
distanza.text = [NSString stringWithFormat:@"%@: %@", NSLocalizedString(@"Distanza", @""), [NSString stringWithFormat:@"%i km %@", [self.sisma.distanzaKM intValue], NSLocalizedString(@"dalla tua posizione", @"")]];
|
||||
|
||||
// UILabel *distanzaValue = (UILabel *)[self viewWithTag:11];
|
||||
// distanzaValue.text = ;
|
||||
|
||||
self.mappaButton = (UIButton *)[self viewWithTag:12];
|
||||
[self.mappaButton setTitle:NSLocalizedString(@"MAPPA", @"") forState:UIControlStateNormal];
|
||||
self.mappaButton.layer.borderWidth = 1;
|
||||
self.mappaButton.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
self.mappaButton.layer.cornerRadius = 5;
|
||||
// [mappa addTarget:self action:@selector(apriMappa:) forControlEvents:UIControlEventTouchDown];
|
||||
|
||||
UIButton *trend = (UIButton *)[self viewWithTag:13];
|
||||
[trend setTitle:NSLocalizedString(@"TRENS", @"") forState:UIControlStateNormal];
|
||||
trend.layer.borderWidth = 1;
|
||||
trend.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
trend.layer.cornerRadius = 5;
|
||||
|
||||
self.meteoButton = (UIButton *)[self viewWithTag:14];
|
||||
[self.meteoButton setTitle:NSLocalizedString(@"METEO", @"") forState:UIControlStateNormal];
|
||||
self.meteoButton.layer.borderWidth = 1;
|
||||
self.meteoButton.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
self.meteoButton.layer.cornerRadius = 5;
|
||||
|
||||
UIButton *config = (UIButton *)[self viewWithTag:15];
|
||||
[config setTitle:NSLocalizedString(@"CONFIG", @"") forState:UIControlStateNormal];
|
||||
config.layer.borderWidth = 1;
|
||||
config.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
config.layer.cornerRadius = 5;
|
||||
|
||||
self.dettagliMappa = (UIButton *)[self viewWithTag:300];
|
||||
self.clickMappa = (UIButton *)[self viewWithTag:112];
|
||||
UIView *containerView = (UIView *)[self viewWithTag:100];
|
||||
|
||||
if([self.sisma.magnitude doubleValue] > 4.0){
|
||||
containerView.backgroundColor = COLORE_CELLA_MAGNITUTE_FORTE;
|
||||
provider.backgroundColor = COLORE_CELLA_MAGNITUTE_FORTE_ETI;
|
||||
self.mappaButton.backgroundColor = COLORE_CELLA_MAGNITUTE_FORTE_ETI;
|
||||
trend.backgroundColor = COLORE_CELLA_MAGNITUTE_FORTE_ETI;
|
||||
self.meteoButton.backgroundColor = COLORE_CELLA_MAGNITUTE_FORTE_ETI;
|
||||
config.backgroundColor = COLORE_CELLA_MAGNITUTE_FORTE_ETI;
|
||||
magnitudoValore.textColor = COLORE_CELLA_MAGNITUTE_FORTE_TESTO;
|
||||
|
||||
}else if ([self.sisma.magnitude doubleValue] < 3.0){
|
||||
containerView.backgroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA;
|
||||
provider.backgroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA_ETI;
|
||||
self.mappaButton.backgroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA_ETI;
|
||||
trend.backgroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA_ETI;
|
||||
self.meteoButton.backgroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA_ETI;
|
||||
config.backgroundColor = COLORE_CELLA_MAGNITUTE_LEGGERA_ETI;
|
||||
magnitudoValore.textColor = COLORE_CELLA_MAGNITUTE_LEGGERA_TESTO;
|
||||
|
||||
|
||||
}else{
|
||||
containerView.backgroundColor = COLORE_CELLA_MAGNITUTE_MEDIA;
|
||||
provider.backgroundColor = COLORE_CELLA_MAGNITUTE_MEDIA_ETI;
|
||||
self.mappaButton.backgroundColor = COLORE_CELLA_MAGNITUTE_MEDIA_ETI;
|
||||
trend.backgroundColor = COLORE_CELLA_MAGNITUTE_MEDIA_ETI;
|
||||
self.meteoButton.backgroundColor = COLORE_CELLA_MAGNITUTE_MEDIA_ETI;
|
||||
config.backgroundColor = COLORE_CELLA_MAGNITUTE_MEDIA_ETI;
|
||||
magnitudoValore.textColor = COLORE_CELLA_MAGNITUTE_MEDIA_TESTO;
|
||||
|
||||
}
|
||||
containerView.layer.cornerRadius = 2;
|
||||
containerView.layer.masksToBounds = NO;
|
||||
containerView.layer.shadowOffset = CGSizeMake(0.0, 2);
|
||||
containerView.layer.shadowRadius = 5;
|
||||
containerView.layer.shadowOpacity = 0.5;
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)createOtherButton{
|
||||
|
||||
self.condividi = (UIButton *)[self viewWithTag:17];
|
||||
[self.condividi setTitle:NSLocalizedString(@"CONDIVIDI", @"") forState:UIControlStateNormal];
|
||||
self.condividi.layer.borderWidth = 1;
|
||||
self.condividi.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
self.condividi.layer.cornerRadius = 5;
|
||||
// [self.condividi addTarget:self action:@selector(condividiView) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
self.chiudi = (UIButton *)[self viewWithTag:18];
|
||||
[self.chiudi setTitle:NSLocalizedString(@"CHIUDI", @"") forState:UIControlStateNormal];
|
||||
self.chiudi.layer.borderWidth = 1;
|
||||
self.chiudi.layer.borderColor = [UIColor blackColor].CGColor;
|
||||
self.chiudi.layer.cornerRadius = 5;
|
||||
|
||||
}
|
||||
|
||||
-(void)condividiView{
|
||||
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user