From be5a0289d7f574e590001bdf016e6be55b49d989 Mon Sep 17 00:00:00 2001 From: deeppp15 Date: Tue, 5 Nov 2024 15:13:15 -0500 Subject: [PATCH 1/2] username 15 char limit --- .../java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt | 4 ++++ .../planet/myplanet/ui/userprofile/BecomeMemberActivity.kt | 5 ++++- app/src/main/res/values-ar/strings.xml | 1 + app/src/main/res/values-es/strings.xml | 1 + app/src/main/res/values-fr/strings.xml | 1 + app/src/main/res/values-ne/strings.xml | 1 + app/src/main/res/values-so/strings.xml | 1 + app/src/main/res/values/strings.xml | 2 +- 8 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt index 7a0aca264f..2f1582b3e4 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt @@ -526,6 +526,10 @@ class LoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener { alertGuestLoginBinding.etUserName.error = getString(R.string.username_cannot_be_empty) isValid = false } + if (username.length > 15) { + 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 diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/BecomeMemberActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/BecomeMemberActivity.kt index 31c89f6747..d7d9c0d619 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/BecomeMemberActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/userprofile/BecomeMemberActivity.kt @@ -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 diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index c52cbbe996..657eaa8764 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -180,6 +180,7 @@ عرض الرد على: تاريخ الافتتاح استطلاعي + يجب أن يكون اسم المستخدم أقل من 15 حرفًا مبتدئ diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 9bce13a3eb..bca0a97ddd 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -180,6 +180,7 @@ mostrando la respuesta de: Fecha de apertura miEncuesta + el nombre de usuario debe tener menos de 15 caracteres Principiante diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 80384d6665..2b11b6402a 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -180,6 +180,7 @@ Affichage de la réponse de : Date d\'ouverture Mon sondage + le nom d\'utilisateur doit comporter moins de 15 caractères Débutant diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 51165db643..75973d0600 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -180,6 +180,7 @@ उत्तर देखाउँदै: खोल्ने मिति मेरो सर्वेक्षण + प्रयोगकर्ताको नाम १५ वर्णभन्दा कम हुनुपर्छ प्रारम्भिक diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index 861fd52ff5..ae47b2a6a8 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -180,6 +180,7 @@ muujinaya jawaabta: Taariikhda Furan Galmadaayda + magaca isticmaale waa inuu ka yar yahay 15 xaraf Bilow diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6c272ce887..891fc2de94 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -180,7 +180,7 @@ Showing reply of: Open Date mySurvey - + username should be less than 15 characters Beginner Intermediate From a01044af5849eff1a5f2682f4e11520946e5e09e Mon Sep 17 00:00:00 2001 From: dogi Date: Fri, 8 Nov 2024 13:46:30 -0500 Subject: [PATCH 2/2] Update LoginActivity.kt --- .../main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt index 2f1582b3e4..def6115714 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/sync/LoginActivity.kt @@ -526,7 +526,7 @@ class LoginActivity : SyncActivity(), TeamListAdapter.OnItemClickListener { alertGuestLoginBinding.etUserName.error = getString(R.string.username_cannot_be_empty) isValid = false } - if (username.length > 15) { + if (username.length > 25) { alertGuestLoginBinding.etUserName.error = getString(R.string.username_too_long) isValid = false }