Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-20008] iOS: Rename AlertDialog placeholder properties to hintTex #7893

Merged
merged 1 commit into from
Mar 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
37 changes: 37 additions & 0 deletions apidoc/Titanium/UI/AlertDialog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,25 @@ properties:

- name: loginPlaceholder
summary: Placeholder of the login text field inside the dialog.
deprecated:
since: "5.4.0"
notes: Use <Titanium.UI.AlertDialog.loginHintText> instead.
description: |
Note that this property is only available if dialog `style` property is defined as
<Titanium.UI.iOS.AlertDialogStyle.LOGIN_AND_PASSWORD_INPUT>.
type: String
since: 5.1.0
platforms: [iphone, ipad]

- name: loginHintText
summary: Hint text of the login text field inside the dialog.
description: |
Note that this property is only available if dialog `style` property is defined as
<Titanium.UI.iOS.AlertDialogStyle.LOGIN_AND_PASSWORD_INPUT>.
type: String
since: "5.4.0"
platforms: [iphone, ipad]

- name: loginReturnKeyType
summary: Specifies the text to display on the keyboard `Return` key when this field is focused.
description: |
Expand Down Expand Up @@ -287,13 +299,25 @@ properties:

- name: passwordPlaceholder
summary: Placeholder of the password text field inside the dialog.
deprecated:
since: "5.4.0"
notes: Use <Titanium.UI.AlertDialog.passwordHintText> instead.
description: |
Note that this property is only available if dialog `style` property is defined as
<Titanium.UI.iOS.AlertDialogStyle.LOGIN_AND_PASSWORD_INPUT>.
type: String
since: 5.1.0
platforms: [iphone, ipad]

- name: passwordHintText
summary: Hint text of the password text field inside the dialog.
description: |
Note that this property is only available if dialog `style` property is defined as
<Titanium.UI.iOS.AlertDialogStyle.LOGIN_AND_PASSWORD_INPUT>.
type: String
since: "5.4.0"
platforms: [iphone, ipad]

- name: passwordReturnKeyType
summary: Specifies the text to display on the keyboard `Return` key when this field is focused.
description: |
Expand All @@ -316,6 +340,9 @@ properties:

- name: placeholder
summary: Placeholder of the text field inside the dialog.
deprecated:
since: "5.4.0"
notes: Use <Titanium.UI.AlertDialog.hintText> instead.
description: |
Note that this property is only available if dialog `style` property is defined as
<Titanium.UI.iOS.AlertDialogStyle.PLAIN_TEXT_INPUT> or
Expand All @@ -324,6 +351,16 @@ properties:
since: 5.1.0
platforms: [iphone, ipad]

- name: hintText
summary: Hint text of the text field inside the dialog.
description: |
Note that this property is only available if dialog `style` property is defined as
<Titanium.UI.iOS.AlertDialogStyle.PLAIN_TEXT_INPUT> or
<Titanium.UI.iOS.AlertDialogStyle.SECURE_TEXT_INPUT>.
type: String
since: "5.4.0"
platforms: [iphone, ipad]

- name: persistent
summary: Boolean value indicating if the alert dialog should only be cancelled by user gesture or by hide method.
description: |
Expand Down
23 changes: 20 additions & 3 deletions iphone/Classes/TiUIAlertDialogProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ -(void)show:(id)args
if ( (style == UIAlertViewStylePlainTextInput) || (style == UIAlertViewStyleSecureTextInput) ) {
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.secureTextEntry = (style == UIAlertViewStyleSecureTextInput);
textField.placeholder = [TiUtils stringValue:[self valueForKey:@"placeholder"]] ?: @"";
textField.placeholder = [TiUtils stringValue:[self valueForKey:@"hintText"]] ?: @"";
textField.keyboardType = [TiUtils intValue:[self valueForKey:@"keyboardType"] def:UIKeyboardTypeDefault];
textField.returnKeyType = [TiUtils intValue:[self valueForKey:@"returnKeyType"] def:UIReturnKeyDefault];
textField.keyboardAppearance = [TiUtils intValue:[self valueForKey:@"keyboardAppearance"] def:UIKeyboardAppearanceDefault];
Expand All @@ -174,13 +174,13 @@ -(void)show:(id)args
textField.keyboardType = [TiUtils intValue:[self valueForKey:@"loginKeyboardType"] def:UIKeyboardTypeDefault];
textField.returnKeyType = [TiUtils intValue:[self valueForKey:@"loginReturnKeyType"] def:UIReturnKeyNext];
textField.keyboardAppearance = [TiUtils intValue:[self valueForKey:@"keyboardAppearance"] def:UIKeyboardAppearanceDefault];
textField.placeholder = [TiUtils stringValue:[self valueForKey:@"loginPlaceholder"]] ?: @"Login";
textField.placeholder = [TiUtils stringValue:[self valueForKey:@"loginHintText"]] ?: @"Login";
}];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField) {
textField.keyboardType = [TiUtils intValue:[self valueForKey:@"passwordKeyboardType"] def:UIKeyboardTypeDefault];
textField.returnKeyType = [TiUtils intValue:[self valueForKey:@"passwordReturnKeyType"] def:UIReturnKeyDone];
textField.keyboardAppearance = [TiUtils intValue:[self valueForKey:@"keyboardAppearance"] def:UIKeyboardAppearanceDefault];
textField.placeholder = [TiUtils stringValue:[self valueForKey:@"passwordPlaceholder"]] ?: @"Password";
textField.placeholder = [TiUtils stringValue:[self valueForKey:@"passwordHintText"]] ?: @"Password";
textField.secureTextEntry = YES;
}];
}
Expand Down Expand Up @@ -283,4 +283,21 @@ -(void)alertViewCancel:(UIAlertView *)alertView
}
}

-(void)setPlaceholder:(id)value
{
DEPRECATED_REPLACED(@"UI.AlertDialog.placeholder", @"5.4.0", @"UI.AlertDialog.hintText");
[self setValue:value forKey:@"hintText"];
}

-(void)setLoginPlaceholder:(id)value
{
DEPRECATED_REPLACED(@"UI.AlertDialog.loginPlaceholder", @"5.4.0", @"UI.AlertDialog.loginHintText");
[self setValue:value forKey:@"loginHintText"];
}

-(void)setPasswordPlaceholder:(id)value
{
DEPRECATED_REPLACED(@"UI.AlertDialog.passwordPlaceholder", @"5.4.0", @"UI.AlertDialog.passwordHintText");
[self setValue:value forKey:@"passwordHintText"];
}
@end