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

login: smoother username character limit (fixes #1859) #4749

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,10 @@ class LoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener {
alertGuestLoginBinding.etUserName.error = getString(R.string.username_cannot_be_empty)
isValid = false
}
if (username.length > 25) {
alertGuestLoginBinding.etUserName.error = getString(R.string.username_too_long)
isValid = false
}
if (firstChar != null && !Character.isDigit(firstChar) && !Character.isLetter(firstChar)) {
alertGuestLoginBinding.etUserName.error = getString(R.string.must_start_with_letter_or_number)
isValid = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ class BecomeMemberActivity : BaseActivity() {

override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
val input = s.toString()

if (input.length > 15) {
activityBecomeMemberBinding.etUsername.error = getString(R.string.username_too_long)
return
}
val firstChar = if (input.isNotEmpty()) input[0] else '\u0000'
var hasInvalidCharacters = false
val hasSpecialCharacters: Boolean
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<string name="showing_reply_of">عرض الرد على:</string>
<string name="open_date">تاريخ الافتتاح</string>
<string name="my_survey">استطلاعي</string>
<string name="username_too_long">يجب أن يكون اسم المستخدم أقل من 15 حرفًا</string>

<string-array name="level">
<item>مبتدئ</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<string name="showing_reply_of">mostrando la respuesta de:</string>
<string name="open_date">Fecha de apertura</string>
<string name="my_survey">miEncuesta</string>
<string name="username_too_long">el nombre de usuario debe tener menos de 15 caracteres</string>

<string-array name="level">
<item>Principiante</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<string name="showing_reply_of">Affichage de la réponse de :</string>
<string name="open_date">Date d\'ouverture</string>
<string name="my_survey">Mon sondage</string>
<string name="username_too_long">le nom d\'utilisateur doit comporter moins de 15 caractères</string>

<string-array name="level">
<item>Débutant</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ne/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<string name="showing_reply_of">उत्तर देखाउँदै:</string>
<string name="open_date">खोल्ने मिति</string>
<string name="my_survey">मेरो सर्वेक्षण</string>
<string name="username_too_long">प्रयोगकर्ताको नाम १५ वर्णभन्दा कम हुनुपर्छ</string>

<string-array name="level">
<item>प्रारम्भिक</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-so/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
<string name="showing_reply_of">muujinaya jawaabta:</string>
<string name="open_date">Taariikhda Furan</string>
<string name="my_survey">Galmadaayda</string>
<string name="username_too_long">magaca isticmaale waa inuu ka yar yahay 15 xaraf</string>

<string-array name="level">
<item>Bilow</item>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<string name="showing_reply_of">Showing reply of:</string>
<string name="open_date">Open Date</string>
<string name="my_survey">mySurvey</string>

<string name="username_too_long">username should be less than 15 characters</string>
<string-array name="level">
<item>Beginner</item>
<item>Intermediate</item>
Expand Down