アカウント追加ダイアログにヒントと検証を追加

This commit is contained in:
tateisu 2017-04-23 22:26:14 +09:00
parent c553c59d69
commit 4f3effe3d8
3 changed files with 12 additions and 0 deletions

View File

@ -53,10 +53,16 @@ public class LoginForm {
if( TextUtils.isEmpty( instance ) ){
Utils.showToast( activity, true, R.string.instance_not_specified );
return;
}else if( instance.contains( "/" )){
Utils.showToast( activity, true, R.string.instance_not_need_slash );
return;
}
if( TextUtils.isEmpty( user_mail ) ){
Utils.showToast(activity, true, R.string.mail_not_specified );
return;
}else if( ! user_mail.contains( "@" ) || ! user_mail.contains( "." )){
Utils.showToast( activity, true, R.string.mail_address_not_contains_at_mark );
return;
}
if( TextUtils.isEmpty( password ) ){
Utils.showToast( activity, true, R.string.password_not_specified );

View File

@ -27,6 +27,7 @@
android:layout_marginRight="12dp"
android:layout_marginStart="12dp"
android:inputType="textUri"
android:hint="@string/instance_hint"
/>
<TextView
@ -50,6 +51,7 @@
android:layout_marginRight="12dp"
android:layout_marginStart="12dp"
android:inputType="textEmailAddress"
android:hint="@string/mail_hint"
/>
<TextView

View File

@ -128,4 +128,8 @@
<string name="conversation_view">conversation view</string>
<string name="conversation">status:%1$d</string>
<string name="conversation_around">conversation around status:%1$d</string>
<string name="instance_not_need_slash">please input just host name of instance, without \'/\'.</string>
<string name="mail_address_not_contains_at_mark">please input user mail address that contains \'@\' and \'.\'</string>
<string name="instance_hint">ex) mastodon.social</string>
<string name="mail_hint">ex) your@e-mail.address</string>
</resources>