Skip to content

Commit

Permalink
update to version 1.5.0 build 93
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Krueger committed Mar 26, 2013
1 parent a9e8393 commit 32a8950
Show file tree
Hide file tree
Showing 83 changed files with 7,675 additions and 299 deletions.
3 changes: 1 addition & 2 deletions PROJECT README
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ you get the private copy of the directories.
Include the following code comments for anything Silent Circle creates.

/*
Copyright © 2013, Silent Circle, LLC.
All rights reserved.
Copyright © 2012-2013, Silent Circle, LLC. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- (void) passcodeManagerWillLock: (SCPasscodeManager *) passcodeManager;
- (void) passcodeManagerDidLock: (SCPasscodeManager *) passcodeManager;
- (void) passcodeManagerDidUnlock: (SCPasscodeManager *) passcodeManager;
- (void)setBackground:(NSString *)backgroundName;
- (void) setBackground:(NSString *)backgroundName;
- (NSString *) getBackgroundName;


@end
66 changes: 37 additions & 29 deletions SilentChat/SilentChat/SilentChat/App/App+ApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@

#import "DDGQueue.h"
#import "NSManagedObjectContext+DDGManagedObjectContext.h"
#import "UIImage+Crop.h"


#define CLASS_DEBUG 1
Expand Down Expand Up @@ -296,38 +297,52 @@ - (UINavigationController *) makeRootViewController {
//} // -threeFingerTap
//

- (void) switchBackgrounds {
static NSMutableArray *bgNameArray;
static short arrayIndex = 0;

if (!bgNameArray) {
NSFileManager *filemanager = [NSFileManager defaultManager];
bgNameArray = [NSMutableArray arrayWithCapacity:15];
NSArray *allArray = [filemanager contentsOfDirectoryAtPath:[[NSBundle mainBundle] resourcePath] error:nil];
[allArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if (([[obj pathExtension] isEqualToString:@"jpg"] || [[obj pathExtension] isEqualToString:@"png"]) && [obj hasPrefix:@"background-"])
[bgNameArray addObject:obj];
}];

}
if (arrayIndex == [bgNameArray count])
arrayIndex = 0;
[self setBackground:[bgNameArray objectAtIndex:arrayIndex++]];
//- (void) switchBackgrounds {
// static NSMutableArray *bgNameArray;
// static short arrayIndex = 0;
//
// if (!bgNameArray) {
// NSFileManager *filemanager = [NSFileManager defaultManager];
// bgNameArray = [NSMutableArray arrayWithCapacity:15];
// NSArray *allArray = [filemanager contentsOfDirectoryAtPath:[[NSBundle mainBundle] resourcePath] error:nil];
// [allArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
// if (([[obj pathExtension] isEqualToString:@"jpg"] || [[obj pathExtension] isEqualToString:@"png"]) && [obj hasPrefix:@"background-"])
// [bgNameArray addObject:obj];
// }];
//
// }
// if (arrayIndex == [bgNameArray count])
// arrayIndex = 0;
// [self setBackground:[bgNameArray objectAtIndex:arrayIndex++]];
//
//// self.backgroundIV.image = [UIImage imageNamed:[bgNameArray objectAtIndex:arrayIndex++]];
//// [self.window insertSubview:self.backgroundIV belowSubview:self.rootViewController.view];
//
//}

// self.backgroundIV.image = [UIImage imageNamed:[bgNameArray objectAtIndex:arrayIndex++]];
// [self.window insertSubview:self.backgroundIV belowSubview:self.rootViewController.view];

- (NSString *)getBackgroundName
{
return self.preferences.globalBackground;
}

- (void)setBackground:(NSString *)backgroundName
{
NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent: backgroundName];
if ((self.backgroundIV.image = [UIImage imageWithContentsOfFile:path]) != nil) {
UIImage *rawImage = [UIImage imageWithContentsOfFile:path];
CGSize size = self.backgroundIV.bounds.size;
CGFloat multiplier = [UIScreen mainScreen].scale;
size.width *= multiplier;
size.height *= multiplier;
CGRect cropRect = CGRectMake((rawImage.size.width - size.width) * 0.5, (rawImage.size.height - size.height) * 0.5, size.width, size.height);
self.backgroundIV.image = [rawImage crop:cropRect];
NSLog(@"bgiv frame %@, image size %@, croprect %@, rawimagescale %f, newimage scale %f", NSStringFromCGRect(self.backgroundIV.frame), NSStringFromCGSize(rawImage.size), NSStringFromCGRect(cropRect), rawImage.scale, self.backgroundIV.image.scale);
rawImage = nil;
if (self.backgroundIV.image != nil) {
self.preferences.globalBackground = backgroundName;
}
else
self.backgroundIV.backgroundColor = [UIColor blackColor];

}

#pragma clang diagnostic push
Expand All @@ -354,15 +369,8 @@ - (BOOL) application: (UIApplication *) application didFinishLaunchingWithOption

self.backgroundIV = [[UIImageView alloc] initWithFrame:self.window.bounds];
[self.window insertSubview:self.backgroundIV belowSubview:self.rootViewController.view];
//self.preferences.globalBackground = @"bg05.jpg";
[self setBackground:self.preferences.globalBackground];

// UITapGestureRecognizer *threeFingerRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(threeFingerTap:)];
// threeFingerRecognizer.numberOfTouchesRequired = 3;
// [self.backgroundIV addGestureRecognizer:threeFingerRecognizer];
// self.backgroundIV.userInteractionEnabled = YES;


[self.window makeKeyAndVisible];

NSURL *url = [launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
Expand Down
1 change: 0 additions & 1 deletion SilentChat/SilentChat/SilentChat/App/AppConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// SilentText
//

#import <UIKit/UIKit.h>

#define VALIDATE_XMPP_CERT 1
#define DEBUG_AUTH_SERVER 0
Expand Down
1 change: 1 addition & 0 deletions SilentChat/SilentChat/SilentChat/Audio/STAudioView.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@property (nonatomic, weak) IBOutlet UIImageView* redLEDImageView;
@property (weak, nonatomic) IBOutlet UIImageView *blueLEDImageView;
@property (weak, nonatomic) IBOutlet UIButton *cancelButton;
@property (weak, nonatomic) IBOutlet UIImageView *controlbarImageView;


@property (assign) id<STAudioViewDelegate> delegate;
Expand Down
16 changes: 10 additions & 6 deletions SilentChat/SilentChat/SilentChat/Audio/STAudioView.m
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,24 @@ -(BOOL) setupRecorderWithError: (NSError **)error
[_redLEDImageView setHidden:YES];
[_blueLEDImageView setHidden:YES];


UIImage *sendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] stretchableImageWithLeftCapWidth:13 topCapHeight:13];
UIEdgeInsets insets = UIEdgeInsetsMake(14, 13, 13, 13);

// UIImage *sendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] stretchableImageWithLeftCapWidth:13 topCapHeight:13];
UIImage *sendBtnBackground = [[UIImage imageNamed:@"MessageEntrySendButton.png"] resizableImageWithCapInsets: insets];
[_sendButton setBackgroundImage:sendBtnBackground forState:UIControlStateNormal];

UIEdgeInsets insets = UIEdgeInsetsMake(15, 19,
15, 19);


insets = UIEdgeInsetsMake(16, 19, 16, 19);
UIImage *btnDisabledBackground = [[UIImage imageNamed:@"LighterButton"] resizableImageWithCapInsets: insets];

UIImage *activeBtnBackground = [[UIImage imageNamed:@"DarkerButton"] resizableImageWithCapInsets: insets];
[_sendButton setBackgroundImage:btnDisabledBackground forState:UIControlStateDisabled];
[_cancelButton setBackgroundImage:activeBtnBackground forState:UIControlStateNormal];
[_cancelButton setBackgroundImage:btnDisabledBackground forState:UIControlStateDisabled];

// insets = UIEdgeInsetsMake(50, 168, 50, 150);
//
// UIImage *controlBarImage = [[UIImage imageNamed:@"controlbar"] resizableImageWithCapInsets: insets];
// _controlbarImageView.image = controlBarImage;

NSMutableDictionary *settings = [[NSMutableDictionary alloc] initWithCapacity:0];

Expand Down
Loading

0 comments on commit 32a8950

Please sign in to comment.