espagram/Espagram/EspagramAppDelegate.m
Abel Fokkinga 3013ee52c4 Version 1.1
- Added localised descriptions for all the tenses.
- After selecting a lesson, you will get a screen where you can see both the words in the lesson or start a multiple choice test.
- Lay-out fixes
- UI improvements
2013-01-02 17:33:00 -02:00

139 lines
6.6 KiB
Objective-C

//
// EspagramAppDelegate.m
// Espagram
//
// Created by Abel Fokkinga on 8/27/12.
// Copyright (c) 2012 Abel Fokkinga. All rights reserved.
//
#import "EspagramAppDelegate.h"
@implementation EspagramAppDelegate
- (void)customizeAppearance
{
// Create resizable images
UIImage *gradientImage44 = [[UIImage imageNamed:@"espagram_navbar-portrait-bg"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
//UIImage *gradientImage32 = [[UIImage imageNamed:@"espagram_gradient_32"]
// resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set the background image for *all* UINavigationBars
[[UINavigationBar appearance] setBackgroundImage:gradientImage44
forBarMetrics:UIBarMetricsDefault];
//[[UINavigationBar appearance] setBackgroundImage:gradientImage32
// forBarMetrics:UIBarMetricsLandscapePhone];
// Customize the title text for *all* UINavigationBars
[[UINavigationBar appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextColor,
[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, -1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"Noteworthy-Bold" size:0.0],
UITextAttributeFont,
nil]];
// Buttons
UIImage *button = [[UIImage imageNamed:@"barButton"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 5, 0, 5)];
[[UIBarButtonItem appearance] setBackgroundImage:button forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];
// [[UIBarButtonItem appearance] setBackgroundImage:button24 forState:UIControlStateNormal
// barMetrics:UIBarMetricsLandscapePhone];
[[UIBarButtonItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextColor,
[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"AmericanTypewriter" size:0.0],
UITextAttributeFont,
nil]
forState:UIControlStateNormal];
UIImage *buttonBack = [[UIImage imageNamed:@"barButtonBack"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
// UIImage *buttonBack24 = [[UIImage imageNamed:@"button_back_textured_24"]
// resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 5)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:buttonBack
forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
UIImage *buttonBackPressed = [[UIImage imageNamed:@"barButtonBackPressed"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 13, 0, 5)];
// UIImage *buttonBack24 = [[UIImage imageNamed:@"button_back_textured_24"]
// resizableImageWithCapInsets:UIEdgeInsetsMake(0, 12, 0, 5)];
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:buttonBackPressed
forState:UIControlStateSelected barMetrics:UIBarMetricsDefault];
// [[UIBarButtonItem appearance] setBackButtonBackgroundImage:buttonBack24
// forState:UIControlStateNormal barMetrics:UIBarMetricsLandscapePhone];
// Tab background
UIImage *tabBackground = [[UIImage imageNamed:@"espagram_tabbar-portrait-bg"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
[[UITabBar appearance] setBackgroundImage:tabBackground];
//[[UITabBar appearance] setSelectionIndicatorImage:
// [UIImage imageNamed:@"tab_select_indicator"]];
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor colorWithRed:255.0/255.0 green:255.0/255.0 blue:255.0/255.0 alpha:1.0],
UITextAttributeTextColor,
[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.8],
UITextAttributeTextShadowColor,
[NSValue valueWithUIOffset:UIOffsetMake(0, 1)],
UITextAttributeTextShadowOffset,
[UIFont fontWithName:@"AmericanTypewriter" size:0.0],
UITextAttributeFont,
nil]
forState:UIControlStateNormal];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[self customizeAppearance];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end