Skip to content

Commit

Permalink
teams: smoother members remove (fixes #4800) (#4801)
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 1c4cf4c commit 2a21f84
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 5 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 2108
versionName "0.21.8"
versionCode 2109
versionName "0.21.9"
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 @@ -6,6 +6,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
Expand Down Expand Up @@ -90,10 +91,14 @@ class AdapterJoinedMember(private val context: Context, private val list: List<R
}
}
builder.setAdapter(adapter) { _, i ->
if (i == 0) {
reject(list[position], position)
if (i >= 0 && i < list.size) {
if (i == 0) {
reject(list[i], i)
} else {
makeLeader(list[i])
}
} else {
makeLeader(list[position])
Toast.makeText(context, R.string.cannot_remove_user, Toast.LENGTH_SHORT).show()
}
}.setNegativeButton(R.string.dismiss, null).show()
}
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="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 @@ -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="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 @@ -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="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 @@ -180,6 +180,7 @@
<string name="showing_reply_of">उत्तर देखाउँदै:</string>
<string name="open_date">खोल्ने मिति</string>
<string name="my_survey">मेरो सर्वेक्षण</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 @@ -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="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 @@ -180,6 +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="cannot_remove_user">User couldnot 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>
<string-array name="level">
Expand Down

0 comments on commit 2a21f84

Please sign in to comment.