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 all 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 @@ -531,6 +531,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 @@ -192,6 +192,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 name="cannot_remove_user">لم يتمكن من إزالة المستخدم</string>
<string name="no_members_task">لا يوجد أعضاء فريق لتكليف المهام</string>
<string name="no_member_selected">لم يتم اختيار أي عضو. يرجى المحاولة مرة أخرى</string>
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 @@ -192,6 +192,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 name="cannot_remove_user">No se pudo eliminar al usuario</string>
<string name="no_members_task">No hay miembros del equipo presentes para asignar tareas</string>
<string name="no_member_selected">No se seleccionó ningún miembro. Por favor, inténtalo de nuevo</string>
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 @@ -192,6 +192,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 name="cannot_remove_user">L\'utilisateur n\'a pas pu être supprimé</string>
<string name="no_members_task">Aucun membre de l\'équipe présent pour attribuer des tâches</string>
<string name="no_member_selected">Aucun membre sélectionné. Veuillez réessayer</string>
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 @@ -192,6 +192,7 @@
<string name="showing_reply_of">उत्तर देखाउँदै:</string>
<string name="open_date">खोल्ने मिति</string>
<string name="my_survey">मेरो सर्वेक्षण</string>
<string name="username_too_long">प्रयोगकर्ताको नाम १५ वर्णभन्दा कम हुनुपर्छ</string>
<string name="cannot_remove_user">प्रयोगकर्ता हटाउन सकिएन</string>
<string name="no_members_task">कार्य सौंपन टोली सदस्यहरू उपस्थित छैनन्</string>
<string name="no_member_selected">कुनै सदस्य चयन गरिएको छैन। कृपया फेरि प्रयास गर्नुहोस्</string>
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 @@ -192,6 +192,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 name="cannot_remove_user">Isticmaalaha lama saari karin</string>
<string name="no_members_task">Wax xubno koox ah looma hayo in shaqo loo xil saaro</string>
<string name="no_member_selected">Ma jiro xubin la doortay. Fadlan isku day mar kale</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,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 name="cannot_remove_user">User could not be removed</string>
<string name="no_members_task">No Team members present to assign tasks</string>
<string name="no_member_selected">No member selected. Please try again</string>
Expand Down
Loading