Permalink
Browse files

Refine settings view behavior.

  • Loading branch information...
1 parent fce822c commit f69b2649cd2d47582f0fb0faccef924f99573f7f @kishikawakatsumi committed Jul 5, 2009
@@ -1,5 +1,4 @@
#import "HotEntryViewController.h"
-#import "XMLParser.h"
#import "FeedParser.h"
#import "EntryCell.h"
#import "WebViewController.h"
@@ -25,13 +24,6 @@ - (void)dealloc {
[super dealloc];
}
-- (void)loadEntriesWithURL:(NSString *)url entryTag:(NSString *)entryTag
- target:(id)object callBack:(SEL)method {
- XMLParser *parser = [XMLParser alloc];
- [parser parseXMLAtURL:[NSURL URLWithString:url] entryTag:entryTag target:object callBack:method parseError:nil];
- [parser release];
-}
-
- (void)loadHotEntries {
LOG_CURRENT_METHOD;
NSString *URL = @"http://b.hatena.ne.jp/hotentry.rss";
@@ -2,6 +2,8 @@
@interface UserSettingViewController : UITableViewController <UITextFieldDelegate> {
UITableView *userSettingView;
+ UITextField *nameField;
+ UITextField *passwordField;
}
@property (nonatomic, retain) UITableView *userSettingView;
@@ -6,13 +6,6 @@ @implementation UserSettingViewController
@synthesize userSettingView;
-- (id)initWithStyle:(UITableViewStyle)style {
- if (self = [super initWithStyle:style]) {
- ;
- }
- return self;
-}
-
- (void)dealloc {
[userSettingView setDelegate:nil];
[userSettingView release];
@@ -104,25 +97,25 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"UserNameCell"] autorelease];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
- UITextField *inputField = [[[UITextField alloc] initWithFrame:CGRectMake(20, 0, 282, 44)] autorelease];
- inputField.delegate = self;
-
- [inputField setAdjustsFontSizeToFitWidth:NO];
- [inputField setBorderStyle:UITextBorderStyleNone];
- [inputField setClearButtonMode:UITextFieldViewModeAlways];
- [inputField setClearsOnBeginEditing:NO];
- [inputField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
- [inputField setAutocorrectionType:UITextAutocorrectionTypeNo];
- [inputField setEnablesReturnKeyAutomatically:YES];
- [inputField setReturnKeyType:UIReturnKeyDone];
- [inputField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
- [inputField setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
-
- [inputField setPlaceholder:NSLocalizedString(@"UserName", nil)];
- [inputField setKeyboardType:UIKeyboardTypeDefault];
- [inputField setText:userSettings.userName];
-
- [cell addSubview:inputField];
+ [nameField setDelegate:self];
+
+ [nameField setAdjustsFontSizeToFitWidth:NO];
+ [nameField setBorderStyle:UITextBorderStyleNone];
+ [nameField setClearButtonMode:UITextFieldViewModeAlways];
+ [nameField setClearsOnBeginEditing:NO];
+ [nameField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
+ [nameField setAutocorrectionType:UITextAutocorrectionTypeNo];
+ [nameField setEnablesReturnKeyAutomatically:YES];
+ [nameField setReturnKeyType:UIReturnKeyNext];
+ [nameField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
+ [nameField setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
+
+ [nameField setPlaceholder:NSLocalizedString(@"UserName", nil)];
+ [nameField setKeyboardType:UIKeyboardTypeDefault];
+ [nameField setText:userSettings.userName];
+
+ [cell addSubview:nameField];
+ [nameField release];
}
return cell;
@@ -132,26 +125,26 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"PasseordCell"] autorelease];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
- UITextField *inputField = [[[UITextField alloc] initWithFrame:CGRectMake(20, 0, 282, 44)] autorelease];
- inputField.delegate = self;
-
- [inputField setAdjustsFontSizeToFitWidth:NO];
- [inputField setBorderStyle:UITextBorderStyleNone];
- [inputField setClearButtonMode:UITextFieldViewModeAlways];
- [inputField setClearsOnBeginEditing:NO];
- [inputField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
- [inputField setAutocorrectionType:UITextAutocorrectionTypeNo];
- [inputField setEnablesReturnKeyAutomatically:YES];
- [inputField setReturnKeyType:UIReturnKeyDone];
- [inputField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
- [inputField setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
-
- [inputField setPlaceholder:NSLocalizedString(@"Password", nil)];
- [inputField setKeyboardType:UIKeyboardTypeDefault];
- [inputField setSecureTextEntry:YES];
- [inputField setText:userSettings.password];
-
- [cell addSubview:inputField];
+ [passwordField setDelegate:self];
+
+ [passwordField setAdjustsFontSizeToFitWidth:NO];
+ [passwordField setBorderStyle:UITextBorderStyleNone];
+ [passwordField setClearButtonMode:UITextFieldViewModeAlways];
+ [passwordField setClearsOnBeginEditing:NO];
+ [passwordField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
+ [passwordField setAutocorrectionType:UITextAutocorrectionTypeNo];
+ [passwordField setEnablesReturnKeyAutomatically:YES];
+ [passwordField setReturnKeyType:UIReturnKeyDone];
+ [passwordField setContentVerticalAlignment:UIControlContentVerticalAlignmentCenter];
+ [passwordField setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
+
+ [passwordField setPlaceholder:NSLocalizedString(@"Password", nil)];
+ [passwordField setKeyboardType:UIKeyboardTypeDefault];
+ [passwordField setSecureTextEntry:YES];
+ [passwordField setText:userSettings.password];
+
+ [cell addSubview:passwordField];
+ [passwordField release];
}
return cell;
@@ -216,7 +209,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
#pragma mark <UITextFieldDelegate> Methods
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
- [textField resignFirstResponder];
+ if (textField == nameField) {
+ [nameField resignFirstResponder];
+ [passwordField becomeFirstResponder];
+ } else {
+ [textField resignFirstResponder];
+ }
+
return YES;
}
@@ -234,17 +233,11 @@ - (void)loadView {
- (void)viewDidLoad {
[super viewDidLoad];
+ nameField = [[UITextField alloc] initWithFrame:CGRectMake(20, 0, 282, 44)];
+ passwordField = [[UITextField alloc] initWithFrame:CGRectMake(20, 0, 282, 44)];
self.title = NSLocalizedString(@"Settings", nil);
}
-- (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
-}
-
-- (void)viewDidAppear:(BOOL)animated {
- [super viewDidAppear:animated];
-}
-
- (void)viewDidDisappear:(BOOL)animated {
[self saveSettings];
}
View
@@ -164,7 +164,7 @@
<li>Read, Edit, Delete your bookmarks.</li>
</ul>
<p>
- <strong>Hatena touch ver. 1.2.1</strong><br />
+ <strong>Hatena touch ver. 1.2.2</strong><br />
<a href="http://d.hatena.ne.jp/KishikawaKatsumi/">KISHIKAWA Katsumi</a>
</p>
</body>
View
@@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1.2.1</string>
+ <string>1.2.2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
View
@@ -162,7 +162,7 @@
<li>Myブックマークの閲覧・修正・削除</li>
</ul>
<p>
- <strong>はてな touch ver. 1.2.1</strong><br />
+ <strong>はてな touch ver. 1.2.2</strong><br />
<a href="http://d.hatena.ne.jp/KishikawaKatsumi/">KISHIKAWA Katsumi</a>
</p>
</body>

0 comments on commit f69b264

Please sign in to comment.