Skip to content

Commit

Permalink
teams: smoother tasks assigning (fixes #4787) (#4798)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
deeppp15 and dogi authored Nov 25, 2024
1 parent aa2d236 commit 1c4cf4c
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -254,13 +255,22 @@ class TeamTaskFragment : BaseTeamFragment(), OnCompletedListener {
val alertUsersSpinnerBinding = AlertUsersSpinnerBinding.inflate(LayoutInflater.from(requireActivity()))
val userList: List<RealmUserModel> = 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<RealmUserModel> = 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()
Expand Down
2 changes: 2 additions & 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,8 @@
<string name="showing_reply_of">عرض الرد على:</string>
<string name="open_date">تاريخ الافتتاح</string>
<string name="my_survey">استطلاعي</string>
<string name="no_members_task">لا يوجد أعضاء فريق لتكليف المهام</string>
<string name="no_member_selected">لم يتم اختيار أي عضو. يرجى المحاولة مرة أخرى</string>

<string-array name="level">
<item>مبتدئ</item>
Expand Down
2 changes: 2 additions & 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,8 @@
<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="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>

<string-array name="level">
<item>Principiante</item>
Expand Down
2 changes: 2 additions & 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,8 @@
<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="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>

<string-array name="level">
<item>Débutant</item>
Expand Down
2 changes: 2 additions & 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,8 @@
<string name="showing_reply_of">उत्तर देखाउँदै:</string>
<string name="open_date">खोल्ने मिति</string>
<string name="my_survey">मेरो सर्वेक्षण</string>
<string name="no_members_task">कार्य सौंपन टोली सदस्यहरू उपस्थित छैनन्</string>
<string name="no_member_selected">कुनै सदस्य चयन गरिएको छैन। कृपया फेरि प्रयास गर्नुहोस्</string>

<string-array name="level">
<item>प्रारम्भिक</item>
Expand Down
2 changes: 2 additions & 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,8 @@
<string name="showing_reply_of">muujinaya jawaabta:</string>
<string name="open_date">Taariikhda Furan</string>
<string name="my_survey">Galmadaayda</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>

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

0 comments on commit 1c4cf4c

Please sign in to comment.