1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-26 09:44:31 +02:00

allow only user names with at least three characters

This commit is contained in:
OliE
2018-01-14 17:45:52 +01:00
parent c0917601e1
commit 6247e19a3d
3 changed files with 8 additions and 2 deletions

View File

@@ -173,8 +173,12 @@ public class UserSettingsActivity extends Activity {
{
boolean validate = true;
if (txtUserName.getText().toString().length() < 3) {
if (txtUserName.getText().toString().length() == 0) {
txtUserName.setError(getResources().getString(R.string.error_user_name_required));
} else {
txtUserName.setError(getResources().getString(R.string.error_user_name_too_short));
}
validate = false;
}

View File

@@ -170,4 +170,5 @@
<string name="label_feedback_message_positive">Ja klar</string>
<string name="label_feedback_message_negative">Nein danke</string>
<string name="label_feedback_message_issue">Würdest Du uns etwas Feedback geben?</string>
<string name="error_user_name_too_short">Fehler Benutzername muss mind. 3 Zeichen haben</string>
</resources>

View File

@@ -82,6 +82,7 @@
<string name="error_exporting">Error exporting</string>
<string name="error_importing">Error importing</string>
<string name="error_user_name_required">Error: user name is required</string>
<string name="error_user_name_too_short">Error: user name have to be at least 3 characters</string>
<string name="error_body_height_required">Error: body height is required</string>
<string name="error_initial_weight_required">Error: initial weight is required</string>
<string name="error_goal_weight_required">Error: goal weight is required</string>