Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Commit

Permalink
Merge branch 'style/updateReadme' of https://github.com/Ph0tonic/SDP_…
Browse files Browse the repository at this point in the history
…Projet into style/updateReadme
  • Loading branch information
Nchappui committed Jun 5, 2020
2 parents 6aea3c4 + f3e4040 commit 3f352a1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import ch.epfl.sdp.MainApplication
import ch.epfl.sdp.R
import ch.epfl.sdp.database.data.Role
import ch.epfl.sdp.database.data.SearchGroupData
Expand Down Expand Up @@ -69,6 +70,10 @@ class SearchGroupEditionActivity : AppCompatActivity() {

val userRemovedListener = object : OnItemClickListener<UserData> {
override fun onItemClicked(user: UserData) {
if (user.role == Role.OPERATOR && operatorsRecyclerView.adapter!!.itemCount <= 1) {
Toast.makeText(MainApplication.applicationContext(), getString(R.string.last_operator_cannot_be_removed), Toast.LENGTH_LONG).show()
return
}
searchGroupManager.removeUserOfSearchGroup(groupId!!, user.uuid!!)
}
}
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 @@ -91,4 +91,5 @@
<string name="drone_pause_success">Mission mise en pause</string>
<string name="camera">Caméra</string>
<string name="add">Ajouter</string>
<string name="last_operator_cannot_be_removed">Impossible d\'enlever tous les opérateurs</string>
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,7 @@
<string name="camera">Camera</string>
<string name="add">Add</string>

<!-- Strings automatically added land here, clean them up -->
<string name="last_operator_cannot_be_removed">You cannot remove all operators</string>

</resources>

0 comments on commit 3f352a1

Please sign in to comment.