Merge lp:~threeve/ubuntuone-ios-files/tweak-sign-out-button into lp:ubuntuone-ios-files

Proposed by Jason Foreman
Status: Merged
Approved by: Zachery Bir
Approved revision: 47
Merged at revision: 47
Proposed branch: lp:~threeve/ubuntuone-ios-files/tweak-sign-out-button
Merge into: lp:ubuntuone-ios-files
Diff against target: 180 lines (+43/-34)
2 files modified
Files.xcodeproj/project.pbxproj (+9/-1)
Files/U1SettingsViewController.m (+34/-33)
To merge this branch: bzr merge lp:~threeve/ubuntuone-ios-files/tweak-sign-out-button
Reviewer Review Type Date Requested Status
Zachery Bir Approve
Review via email: mp+85739@code.launchpad.net

Description of the change

Made the sign out button more button-y.

To post a comment you must log in.
48. By Jason Foreman

Tweak sizing of padding on sign out button.

Revision history for this message
Zachery Bir (urbanape) wrote :

Works for me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Assets/ios_files_buttonBG.png'
2Binary files Assets/ios_files_buttonBG.png 1970-01-01 00:00:00 +0000 and Assets/ios_files_buttonBG.png 2011-12-14 20:36:40 +0000 differ
3=== added file 'Assets/ios_files_buttonBG@2x.png'
4Binary files Assets/ios_files_buttonBG@2x.png 1970-01-01 00:00:00 +0000 and Assets/ios_files_buttonBG@2x.png 2011-12-14 20:36:40 +0000 differ
5=== modified file 'Files.xcodeproj/project.pbxproj'
6--- Files.xcodeproj/project.pbxproj 2011-12-13 18:36:44 +0000
7+++ Files.xcodeproj/project.pbxproj 2011-12-14 20:36:40 +0000
8@@ -108,6 +108,8 @@
9 96CC17E21418094800EFC1BA /* U1NodeJSONParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 96CC17E11418094800EFC1BA /* U1NodeJSONParser.m */; };
10 96CC17E514180C6000EFC1BA /* U1FilesClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 96CC17E414180C5F00EFC1BA /* U1FilesClient.m */; };
11 96D1A8E0148DB9F800B210E7 /* U1TransparentToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 96D1A8DF148DB9F800B210E7 /* U1TransparentToolbar.m */; };
12+ 96DCD4711499375800E18609 /* ios_files_buttonBG.png in Resources */ = {isa = PBXBuildFile; fileRef = 96DCD46F1499375800E18609 /* ios_files_buttonBG.png */; };
13+ 96DCD4721499375800E18609 /* ios_files_buttonBG@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 96DCD4701499375800E18609 /* ios_files_buttonBG@2x.png */; };
14 96E860B613F7251D0026783D /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96E860B513F7251D0026783D /* UIKit.framework */; };
15 96E860B813F7251D0026783D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96E860B713F7251D0026783D /* Foundation.framework */; };
16 96E860BA13F7251D0026783D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96E860B913F7251D0026783D /* CoreGraphics.framework */; };
17@@ -227,7 +229,7 @@
18 960D46201409ECC500B73177 /* ic_folder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ic_folder@2x.png"; path = "Assets/ic_folder@2x.png"; sourceTree = "<group>"; };
19 960D4623140D8AF200B73177 /* U1ByteSizeValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1ByteSizeValueTransformer.h; sourceTree = "<group>"; };
20 960D4624140D8AF200B73177 /* U1ByteSizeValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1ByteSizeValueTransformer.m; sourceTree = "<group>"; };
21- 960D4626140D8B4400B73177 /* U1FuzzyDateTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; path = U1FuzzyDateTransformer.h; sourceTree = "<group>"; };
22+ 960D4626140D8B4400B73177 /* U1FuzzyDateTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1FuzzyDateTransformer.h; sourceTree = "<group>"; };
23 960D4627140D8B4400B73177 /* U1FuzzyDateTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1FuzzyDateTransformer.m; sourceTree = "<group>"; };
24 960D4629140D99DB00B73177 /* U1Node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1Node.h; sourceTree = "<group>"; };
25 960D462A140D99DC00B73177 /* U1Node.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1Node.m; sourceTree = "<group>"; };
26@@ -325,6 +327,8 @@
27 96CC17E414180C5F00EFC1BA /* U1FilesClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = U1FilesClient.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
28 96D1A8DE148DB9F800B210E7 /* U1TransparentToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1TransparentToolbar.h; sourceTree = "<group>"; };
29 96D1A8DF148DB9F800B210E7 /* U1TransparentToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1TransparentToolbar.m; sourceTree = "<group>"; };
30+ 96DCD46F1499375800E18609 /* ios_files_buttonBG.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ios_files_buttonBG.png; path = Assets/ios_files_buttonBG.png; sourceTree = "<group>"; };
31+ 96DCD4701499375800E18609 /* ios_files_buttonBG@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ios_files_buttonBG@2x.png"; path = "Assets/ios_files_buttonBG@2x.png"; sourceTree = "<group>"; };
32 96E860B113F7251D0026783D /* U1Files.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = U1Files.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 96E860B513F7251D0026783D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
34 96E860B713F7251D0026783D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
35@@ -511,6 +515,8 @@
36 96783E6513F8ABC70092C6A1 /* Assets */ = {
37 isa = PBXGroup;
38 children = (
39+ 96DCD46F1499375800E18609 /* ios_files_buttonBG.png */,
40+ 96DCD4701499375800E18609 /* ios_files_buttonBG@2x.png */,
41 96B2B7791497042D0078D952 /* u1_folder.png */,
42 96B2B77A1497042D0078D952 /* u1_folder@2x.png */,
43 96327C041492A13100607EF3 /* navbar.png */,
44@@ -949,6 +955,8 @@
45 96754B6E1496A7F3001D2A64 /* U1LoginController.xib in Resources */,
46 96B2B77B1497042D0078D952 /* u1_folder.png in Resources */,
47 96B2B77C1497042D0078D952 /* u1_folder@2x.png in Resources */,
48+ 96DCD4711499375800E18609 /* ios_files_buttonBG.png in Resources */,
49+ 96DCD4721499375800E18609 /* ios_files_buttonBG@2x.png in Resources */,
50 );
51 runOnlyForDeploymentPostprocessing = 0;
52 };
53
54=== modified file 'Files/U1SettingsViewController.m'
55--- Files/U1SettingsViewController.m 2011-12-13 20:15:22 +0000
56+++ Files/U1SettingsViewController.m 2011-12-14 20:36:40 +0000
57@@ -15,6 +15,8 @@
58
59 #import "U1SettingsViewController.h"
60
61+#import <QuartzCore/QuartzCore.h>
62+
63 #import "U1AccountManager.h"
64 #import "U1ByteSizeValueTransformer.h"
65 #import "U1FilesClient.h"
66@@ -100,7 +102,7 @@
67 - (IBAction)signOut:(id)sender;
68 {
69 // TODO: get actual copy for this from design team
70- UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Logging out from this device will not affect other devices connected to Ubuntu One." delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Log Out" otherButtonTitles:nil];
71+ UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Signing out on this device will not affect other devices connected to Ubuntu One." delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Sign Out" otherButtonTitles:nil];
72 [actionSheet showFromTabBar:self.tabBarController.tabBar];
73 [actionSheet release];
74 }
75@@ -177,7 +179,7 @@
76 switch (section)
77 {
78 case U1SettingsViewSectionAccount:
79- return 3;
80+ return 2;
81 case U1SettingsViewSectionCameraRoll:
82 return 3; // TODO const
83 }
84@@ -201,15 +203,15 @@
85 {
86 case U1SettingsViewSectionAccount:
87 {
88+ cell = [self.tableView dequeueReusableCellWithIdentifier:@"AccountCell"];
89+ if (!cell)
90+ {
91+ cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"AccountCell"] autorelease];
92+ [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
93+ }
94 switch (indexPath.row)
95 {
96 case 0:
97- cell = [self.tableView dequeueReusableCellWithIdentifier:@"AccountCell"];
98- if (!cell)
99- {
100- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"AccountCell"] autorelease];
101- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
102- }
103 [cell.textLabel setText:NSLocalizedString(@"Name", nil)];
104 [cell.detailTextLabel setText:@"Loading..."];
105 if (self.accountInfo)
106@@ -217,12 +219,6 @@
107 break;
108 case 1:
109 {
110- cell = [self.tableView dequeueReusableCellWithIdentifier:@"AccountCell"];
111- if (!cell)
112- {
113- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:@"AccountCell"] autorelease];
114- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
115- }
116 [cell.textLabel setText:NSLocalizedString(@"Storage", nil)];
117 U1ByteSizeValueTransformer *byteSizeTransformer = [[U1ByteSizeValueTransformer alloc] init];
118 NSString *storageFormat = NSLocalizedString(@"%@ of %@ used", nil);
119@@ -234,18 +230,6 @@
120 [byteSizeTransformer release];
121 break;
122 }
123- case 2:
124- {
125- cell = [self.tableView dequeueReusableCellWithIdentifier:@"LogOutCell"];
126- if (!cell)
127- {
128- cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"LogOutCell"] autorelease];
129- [cell.textLabel setTextAlignment:UITextAlignmentCenter];
130- [cell.textLabel setFont:[UIFont boldSystemFontOfSize:17.f]];
131- [cell.textLabel setText:@"Log Out of Ubuntu One"];
132- }
133- break;
134- }
135 }
136 break;
137 // return cell;
138@@ -268,18 +252,35 @@
139
140 - (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath;
141 {
142- if (indexPath.section == U1SettingsViewSectionAccount && indexPath.row == 2)
143- return indexPath;
144 return nil;
145 }
146
147-- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
148-{
149- if (indexPath.section == U1SettingsViewSectionAccount && indexPath.row == 2)
150+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section;
151+{
152+ if (section == U1SettingsViewSectionAccount)
153+ return 60.f;
154+ return 0.f;
155+}
156+
157+- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section;
158+{
159+ if (section == U1SettingsViewSectionAccount)
160 {
161- [self signOut:nil];
162- [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
163+ CGRect footerBounds = CGRectMake(0, 0, 320, 60);
164+ UIView *footerView = [[[UIView alloc] initWithFrame:footerBounds] autorelease];
165+
166+ UIButton *signOutButton = [[[UIButton alloc] initWithFrame:CGRectMake(10, 8, 300, 38)] autorelease];
167+ [footerView addSubview:signOutButton];
168+ UIImage *buttonImage = [[UIImage imageNamed:@"ios_files_buttonBG"] stretchableImageWithLeftCapWidth:0 topCapHeight:0];
169+ [signOutButton setBackgroundImage:buttonImage forState:UIControlStateNormal];
170+ [signOutButton setTitle:@"Sign Out of Ubuntu One" forState:UIControlStateNormal];
171+ [signOutButton.titleLabel setFont:[UIFont boldSystemFontOfSize:14.f]];
172+ [signOutButton.layer setCornerRadius:8.f];
173+ [signOutButton setClipsToBounds:YES];
174+ [signOutButton addTarget:self action:@selector(signOut:) forControlEvents:UIControlEventTouchUpInside];
175+ return footerView;
176 }
177+ return nil;
178 }
179
180 - (UITableViewCell *)preparedAutoUploadCell;

Subscribers

People subscribed via source and target branches