Skip to content

Commit

Permalink
Merge branch 'release/1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
normansander committed Jun 9, 2015
2 parents 49cde05 + 167e2fb commit 6705c12
Show file tree
Hide file tree
Showing 29 changed files with 88 additions and 67 deletions.
6 changes: 0 additions & 6 deletions CriticalMaps.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

/* Begin PBXBuildFile section */
90F46A24D8DB4FCAABF4CF34 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1FD3CAC801A84BBA8D151E5D /* libPods.a */; };
940A9AEE1AC861C800F90DC3 /* PLAdditional.m in Sources */ = {isa = PBXBuildFile; fileRef = 940A9AED1AC861C800F90DC3 /* PLAdditional.m */; };
941511091A10004D0010205B /* PLTwitterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 941511081A10004D0010205B /* PLTwitterViewController.m */; };
942B71B61A5770CA00D02CA1 /* PLTwitterTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 942B71B51A5770CA00D02CA1 /* PLTwitterTableViewCell.m */; };
942E2D8219C316BD00BF92D7 /* PLUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 942E2D8119C316BD00BF92D7 /* PLUtils.m */; };
Expand Down Expand Up @@ -52,8 +51,6 @@
/* Begin PBXFileReference section */
1FD3CAC801A84BBA8D151E5D /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
42F8D420591A3C7DB831663C /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
940A9AEC1AC861C800F90DC3 /* PLAdditional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLAdditional.h; sourceTree = "<group>"; };
940A9AED1AC861C800F90DC3 /* PLAdditional.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLAdditional.m; sourceTree = "<group>"; };
941511071A10004D0010205B /* PLTwitterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTwitterViewController.h; sourceTree = "<group>"; };
941511081A10004D0010205B /* PLTwitterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PLTwitterViewController.m; sourceTree = "<group>"; };
942B71B41A5770CA00D02CA1 /* PLTwitterTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PLTwitterTableViewCell.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -186,8 +183,6 @@
94F0304819C1E4EC00F86611 /* PLConstants.m */,
942E2D8019C316BD00BF92D7 /* PLUtils.h */,
942E2D8119C316BD00BF92D7 /* PLUtils.m */,
940A9AEC1AC861C800F90DC3 /* PLAdditional.h */,
940A9AED1AC861C800F90DC3 /* PLAdditional.m */,
94ECBDA41AD1B7CC00A8D75A /* UIColor+Helper.h */,
94ECBDA51AD1B7CC00A8D75A /* UIColor+Helper.m */,
);
Expand Down Expand Up @@ -425,7 +420,6 @@
94A9C1AF19BF43AB0027C5DC /* PLDataModel.m in Sources */,
94ECBDA61AD1B7CC00A8D75A /* UIColor+Helper.m in Sources */,
945441AE1A111A6A00C8024F /* PLLabel.m in Sources */,
940A9AEE1AC861C800F90DC3 /* PLAdditional.m in Sources */,
94F0304919C1E4EC00F86611 /* PLConstants.m in Sources */,
94CF089919BDF227009FFF43 /* PLTabBarController.m in Sources */,
9484E8031A62E63F0007F9F3 /* HOButton.m in Sources */,
Expand Down
4 changes: 2 additions & 2 deletions CriticalMass/CriticalMaps-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.6.0</string>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.6.0.2</string>
<string>1.0.1</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions CriticalMass/Images.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Appicon29@2x.png",
"filename" : "cm_app_58x58.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Appicon40@2x.png",
"filename" : "cm_app_80x80.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Appicon60@2x.png",
"filename" : "cm_app_120x120.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Appicon60@3x.png",
"filename" : "cm_app_180x180.png",
"scale" : "3x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions CriticalMass/PLAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import "PLRulesViewController.h"
#import "PLConstants.h"
#import "PLDataModel.h"
#import "PLAdditional.h"
#import "Appirater.h"

@implementation PLAppDelegate
Expand All @@ -21,18 +20,19 @@ @implementation PLAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

// Set Appirater
[Appirater setAppId:@"918669647"];
[Appirater setDaysUntilPrompt:1];
[Appirater setUsesUntilPrompt:10];
[Appirater setSignificantEventsUntilPrompt:-1];
[Appirater setTimeBeforeReminding:2];

if(kDebug && kDebugShowAppirater) {
#ifdef DEBUG
if(kDebugShowAppirater) {
[Appirater setDebug:YES];
}

[PLAdditional setup];
#endif

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
Expand All @@ -41,9 +41,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

if(kDebug){
[(UITabBarController *) self.window.rootViewController setSelectedIndex: 2];
}
#ifdef DEBUG
[(UITabBarController *) self.window.rootViewController setSelectedIndex: kDebugInitialTabIndex];
#endif

[Appirater appLaunched:YES];

Expand Down
10 changes: 3 additions & 7 deletions CriticalMass/PLChatModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ - (id)init {
}

- (void)collectMessage:(NSString*) text {

NSString *timestamp = [PLUtils getTimestamp];
NSString *messageId = [NSString stringWithFormat:@"%@%@", _data.uid, timestamp];
NSString *messageIdHashed = [messageId md5];
Expand All @@ -58,8 +57,7 @@ - (void)collectMessage:(NSString*) text {
}

- (void)addMessages: (NSDictionary*)messages {

// iterate obtained messages
// Iterate obtained messages
for(id key in messages){

NSDictionary *message = [messages objectForKey:key];
Expand All @@ -69,7 +67,6 @@ - (void)addMessages: (NSDictionary*)messages {
co.isActive = YES;
co.timestamp = [message objectForKey:@"timestamp"];
}else{

// create chat object
PLChatObject *co = [[PLChatObject alloc] init];
co.identifier = key;
Expand All @@ -80,12 +77,11 @@ - (void)addMessages: (NSDictionary*)messages {
co.isActive = YES;

// fill dict

[_messages addObject:co];
}
}

// iterate existing messages and clear old
// Iterate existing messages and clear old
for (int i = 0; i < [_messages count]; i++) {
PLChatObject *co = [_messages objectAtIndex:i];
if(co.isActive){
Expand All @@ -95,7 +91,7 @@ - (void)addMessages: (NSDictionary*)messages {
}
}

// sort
// Sort
[_messages sortUsingDescriptors:
[NSArray arrayWithObjects:
[NSSortDescriptor sortDescriptorWithKey:@"timestamp" ascending:YES], nil]];
Expand Down
32 changes: 25 additions & 7 deletions CriticalMass/PLChatViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ - (void)viewDidLoad {
self.btnSend = [HOButton buttonWithType:UIButtonTypeRoundedRect];
self.btnSend.frame = CGRectMake(260, 0, 50, 50);
self.btnSend.layer.borderWidth = 1.0;
[self.btnSend setBackgroundColor:[UIColor clearColor]];
[self.btnSend setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
[self.btnSend addTarget:self action:@selector(onSend) forControlEvents:UIControlEventTouchUpInside];
[self.btnSend setTitle:@"send" forState:UIControlStateNormal];
[self.controlView addSubview: self.btnSend];
Expand All @@ -92,7 +94,6 @@ -(void)viewDidAppear:(BOOL)animated{

- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

- (void)onSend {
Expand All @@ -105,7 +106,7 @@ - (void)onSend {
self.textField.text = @"";
}

- (void)moveContent:(BOOL)moveUp{
- (void)moveContent:(BOOL)moveUp {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.3]; // if you want to slide up the view

Expand Down Expand Up @@ -147,7 +148,6 @@ - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
messageLabel.textColor = [UIColor blackColor];
messageLabel.numberOfLines = 0;
messageLabel.textAlignment = NSTextAlignmentCenter;
// messageLabel.font = [UIFont fontWithName:@"Palatino-Italic" size:20];
[messageLabel sizeToFit];

self.tableView.backgroundView = messageLabel;
Expand All @@ -168,7 +168,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

PLChatObject *message = [_chatModel.messages objectAtIndex:indexPath.row];

cell.textLabel.font = [self fontForCell];
cell.textLabel.text = message.text;
cell.textLabel.numberOfLines = 0;
cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
cell.imageView.image = [UIImage imageNamed:@"Punk"];
cell.imageView.image = [cell.imageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
cell.imageView.tintColor = [UIColor magicColor];
Expand Down Expand Up @@ -196,12 +199,24 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}

-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
PLChatObject *message = [_chatModel.messages objectAtIndex:indexPath.row];
NSString *cellText = message.text;
NSDictionary *attributes = @{NSFontAttributeName: [self fontForCell]};
CGRect rect = [cellText boundingRectWithSize:CGSizeMake(self.view.frame.size.width, CGFLOAT_MAX)
options:NSStringDrawingUsesLineFragmentOrigin
attributes:attributes
context:nil];
return rect.size.height + 20;
}

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
[self moveContent:YES];
return YES;
}

-(void)textFieldDidEndEditing:(UITextField *)textField {
- (void)textFieldDidEndEditing:(UITextField *)textField {
[self moveContent:NO];
}

Expand All @@ -215,9 +230,12 @@ - (void)onMessagesReceived {
// [self.tableView scrollToRowAtIndexPath: ipath atScrollPosition: UITableViewScrollPositionTop animated: YES];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.textField resignFirstResponder];
}

- (UIFont*)fontForCell {
return [UIFont systemFontOfSize:18.0];
}

@end
2 changes: 0 additions & 2 deletions CriticalMass/PLConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
@interface PLConstants : NSObject

// Debug
FOUNDATION_EXPORT BOOL const kDebug;
FOUNDATION_EXPORT BOOL const kDebugEnableTestURL;
FOUNDATION_EXPORT BOOL const kDebugEnableTestLocation;
FOUNDATION_EXPORT BOOL const kDebugDisableHTTPRequests;
FOUNDATION_EXPORT BOOL const kDebugInitialTabIndex;
FOUNDATION_EXPORT BOOL const kDebugShowAppirater;

// Urls
//FOUNDATION_EXPORT NSString *const kUrlTile;
FOUNDATION_EXPORT NSString *const kUrlService;

// Notifications
Expand Down
1 change: 0 additions & 1 deletion CriticalMass/PLConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ @implementation PLConstants
@end

// Debug
BOOL const kDebug = NO;
BOOL const kDebugEnableTestURL = NO;
BOOL const kDebugEnableTestLocation = NO;
BOOL const kDebugDisableHTTPRequests = NO;
Expand Down
15 changes: 13 additions & 2 deletions CriticalMass/PLDataModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,18 @@ - (void)initLocationManager
_locationManager.delegate = self;
_locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;

if(kDebug && kDebugEnableTestLocation){
#ifdef DEBUG
if(kDebugEnableTestLocation){
CLLocation *testLocation = [[CLLocation alloc] initWithLatitude:kTestLocationLatitude longitude:kTestLocationLongitude];
_currentLocation = testLocation;
[self performSelector:@selector(startRequestInterval) withObject:nil afterDelay:1.0];
}else{
[self enableGps];
}
#else
[self enableGps];
#endif

}

- (void)initHTTPRequestManager
Expand Down Expand Up @@ -190,9 +195,15 @@ - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLoca
if(_updateCount == 0){
[[NSNotificationCenter defaultCenter] postNotificationName:kNotificationInitialGpsDataReceived object:self];

if(!(kDebug && kDebugDisableHTTPRequests)){
#ifdef DEBUG
if(!kDebugDisableHTTPRequests){
[self performSelector:@selector(startRequestInterval) withObject:nil afterDelay:1.0];
}

#else
[self performSelector:@selector(startRequestInterval) withObject:nil afterDelay:1.0];
#endif

}

_updateCount++;
Expand Down
4 changes: 3 additions & 1 deletion CriticalMass/PLMapViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ - (void)initMap
_map.mapType = MKMapTypeStandard;
_map.showsPointsOfInterest = NO;

if(kDebug && kDebugEnableTestLocation){
#ifdef DEBUG
if(kDebugEnableTestLocation){
_map.centerCoordinate = CLLocationCoordinate2DMake(kTestLocationLatitude, kTestLocationLongitude);
}
#endif

[self.view addSubview:_map];
}
Expand Down
13 changes: 8 additions & 5 deletions CriticalMass/PLTabBarController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ - (void)viewDidLoad

self.view.tintColor = [UIColor magicColor];

[[UITabBar appearance] setBarTintColor:[UIColor whiteColor]];
[[UITabBar appearance] setTranslucent:NO];

UIViewController *viewController1 = [[PLMapViewController alloc] init];
UIViewController *viewController2 = [[PLRulesViewController alloc] init];
UIViewController *viewController3 = [[PLChatViewController alloc] init];
Expand All @@ -40,15 +43,15 @@ - (void)viewDidLoad
[tabViewControllers addObject:viewController5];

viewController1.tabBarItem =
[[UITabBarItem alloc] initWithTitle:@"Map" image:[UIImage imageNamed:@"Map"] tag:1];
[[UITabBarItem alloc] initWithTitle:@"Map" image:[UIImage imageNamed:@"Map"] tag:0];
viewController2.tabBarItem =
[[UITabBarItem alloc] initWithTitle:@"Knigge" image:[UIImage imageNamed:@"List"] tag:2];
[[UITabBarItem alloc] initWithTitle:@"Knigge" image:[UIImage imageNamed:@"List"] tag:1];
viewController3.tabBarItem =
[[UITabBarItem alloc] initWithTitle:@"Chat" image:[UIImage imageNamed:@"Bubble"] tag:3];
[[UITabBarItem alloc] initWithTitle:@"Chat" image:[UIImage imageNamed:@"Bubble"] tag:2];
viewController4.tabBarItem =
[[UITabBarItem alloc] initWithTitle:@"Twitter" image:[UIImage imageNamed:@"Twitter"] tag:4];
[[UITabBarItem alloc] initWithTitle:@"Twitter" image:[UIImage imageNamed:@"Twitter"] tag:3];
viewController5.tabBarItem =
[[UITabBarItem alloc] initWithTitle:@"Settings" image:[UIImage imageNamed:@"Settings"] tag:5];
[[UITabBarItem alloc] initWithTitle:@"Settings" image:[UIImage imageNamed:@"Settings"] tag:4];

[self setViewControllers:tabViewControllers animated:NO];
}
Expand Down
6 changes: 5 additions & 1 deletion CriticalMass/PLTwitterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,16 @@ - (void)viewDidLoad {

_supportedLocalities = @[
@"berlin",
@"leipzig",
@"wien",
@"cambridge",
@"hamburg",
@"dresden",
@"köln",
@"potsdam"
@"potsdam",
@"stuttgart",
@"münchen",
@"frankfurt"
];

_data = [PLDataModel sharedManager];
Expand Down
2 changes: 1 addition & 1 deletion CriticalMass/UIColor+Helper.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@implementation UIColor (Helper)

+ (UIColor *)magicColor {
return UIColorFromRGB(0x028a68);
return UIColorFromRGB(0x51c9ec);
}

@end
Binary file removed Gfx/Launch1.png
Binary file not shown.
Binary file removed Gfx/Launch2.png
Binary file not shown.
Binary file removed Gfx/appicon/[email protected]
Binary file not shown.
Binary file removed Gfx/appicon/[email protected]
Binary file not shown.
Binary file removed Gfx/appicon/[email protected]
Binary file not shown.
Binary file removed Gfx/appicon/[email protected]
Binary file not shown.
1 change: 0 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ pod 'NSString-Hashes'
pod 'AccordionView'
pod 'TTTAttributedLabel'
pod 'STTwitter'
pod 'GoogleAnalytics-iOS-SDK', '3.0.3c'
pod 'SAMLoadingView'
pod 'SDWebImage'
pod 'Appirater'
Loading

0 comments on commit 6705c12

Please sign in to comment.