From 1c4cf4c59fb8a797c34b9c7e97a7c140e0eb4776 Mon Sep 17 00:00:00 2001 From: Deep Vora <70479785+deeppp15@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:30:51 -0500 Subject: [PATCH] teams: smoother tasks assigning (fixes #4787) (#4798) Co-authored-by: dogi --- app/build.gradle | 4 ++-- .../myplanet/ui/team/teamTask/TeamTaskFragment.kt | 12 +++++++++++- app/src/main/res/values-ar/strings.xml | 2 ++ app/src/main/res/values-es/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-ne/strings.xml | 2 ++ app/src/main/res/values-so/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 3 ++- 8 files changed, 25 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 36a8454a78..92de088c7f 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "org.ole.planet.myplanet" minSdkVersion 26 targetSdkVersion 34 - versionCode 2107 - versionName "0.21.7" + versionCode 2108 + versionName "0.21.8" ndkVersion '21.3.6528147' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/team/teamTask/TeamTaskFragment.kt b/app/src/main/java/org/ole/planet/myplanet/ui/team/teamTask/TeamTaskFragment.kt index 21584fa0ba..a5bc292bd2 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/team/teamTask/TeamTaskFragment.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/team/teamTask/TeamTaskFragment.kt @@ -12,6 +12,7 @@ import android.widget.ArrayAdapter import android.widget.DatePicker import android.widget.TextView import android.widget.TimePicker +import android.widget.Toast import androidx.appcompat.app.AlertDialog import androidx.recyclerview.widget.LinearLayoutManager import com.google.gson.Gson @@ -254,13 +255,22 @@ class TeamTaskFragment : BaseTeamFragment(), OnCompletedListener { val alertUsersSpinnerBinding = AlertUsersSpinnerBinding.inflate(LayoutInflater.from(requireActivity())) val userList: List = getJoinedMember(teamId, mRealm) val filteredUserList = userList.filter { user -> user.getFullName().isNotBlank() } + if (filteredUserList.isEmpty()) { + Toast.makeText(context, R.string.no_members_task, Toast.LENGTH_SHORT).show() + return + } val adapter: ArrayAdapter = UserListArrayAdapter(requireActivity(), android.R.layout.simple_list_item_1, filteredUserList) alertUsersSpinnerBinding.spnUser.adapter = adapter AlertDialog.Builder(requireActivity(), R.style.AlertDialogTheme) .setTitle(R.string.select_member) .setView(alertUsersSpinnerBinding.root).setCancelable(false) .setPositiveButton(R.string.ok) { _: DialogInterface?, _: Int -> - val user = alertUsersSpinnerBinding.spnUser.selectedItem as RealmUserModel + val selectedItem = alertUsersSpinnerBinding.spnUser.selectedItem + if (selectedItem == null) { + Toast.makeText(context, R.string.no_member_selected, Toast.LENGTH_SHORT).show() + return@setPositiveButton + } + val user = selectedItem as RealmUserModel val userId = user.id if (!mRealm.isInTransaction) { mRealm.beginTransaction() diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 4255e61eaa..fa24f18972 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -180,6 +180,8 @@ عرض الرد على: تاريخ الافتتاح استطلاعي + لا يوجد أعضاء فريق لتكليف المهام + لم يتم اختيار أي عضو. يرجى المحاولة مرة أخرى مبتدئ diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 10ab059bc5..b4c871390c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -180,6 +180,8 @@ mostrando la respuesta de: Fecha de apertura miEncuesta + No hay miembros del equipo presentes para asignar tareas + No se seleccionó ningún miembro. Por favor, inténtalo de nuevo Principiante diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index aedd7ae30c..5e9de63f9d 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -180,6 +180,8 @@ Affichage de la réponse de : Date d\'ouverture Mon sondage + Aucun membre de l\'équipe présent pour attribuer des tâches + Aucun membre sélectionné. Veuillez réessayer Débutant diff --git a/app/src/main/res/values-ne/strings.xml b/app/src/main/res/values-ne/strings.xml index 817fd9b87d..8d536a9510 100644 --- a/app/src/main/res/values-ne/strings.xml +++ b/app/src/main/res/values-ne/strings.xml @@ -180,6 +180,8 @@ उत्तर देखाउँदै: खोल्ने मिति मेरो सर्वेक्षण + कार्य सौंपन टोली सदस्यहरू उपस्थित छैनन् + कुनै सदस्य चयन गरिएको छैन। कृपया फेरि प्रयास गर्नुहोस् प्रारम्भिक diff --git a/app/src/main/res/values-so/strings.xml b/app/src/main/res/values-so/strings.xml index c3dd039e5e..801bbde26d 100644 --- a/app/src/main/res/values-so/strings.xml +++ b/app/src/main/res/values-so/strings.xml @@ -180,6 +180,8 @@ muujinaya jawaabta: Taariikhda Furan Galmadaayda + Wax xubno koox ah looma hayo in shaqo loo xil saaro + Ma jiro xubin la doortay. Fadlan isku day mar kale Bilow diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5e87de0dce..d5599c2597 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -180,7 +180,8 @@ Showing reply of: Open Date mySurvey - + No Team members present to assign tasks + No member selected. Please try again Beginner Intermediate