Skip to content

Commit

Permalink
teams: smoother joining (fixes #4788) (#4789)
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 21, 2024
1 parent ab3532a commit 1ef8874
Show file tree
Hide file tree
Showing 2 changed files with 14 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 2102
versionName "0.21.2"
versionCode 2103
versionName "0.21.3"
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 @@ -23,16 +23,25 @@ class AdapterMemberRequest(private val context: Context, private val list: Mutab
}

override fun onBindViewHolder(holder: ViewHolderUser, position: Int) {
rowMemberRequestBinding.tvName.text = list[position].name ?: list[position].toString()
val currentItem = list.getOrNull(position) ?: return
rowMemberRequestBinding.tvName.text = currentItem.name ?: currentItem.toString()

if (isTeamLeader) {
rowMemberRequestBinding.btnAccept.isEnabled = true
rowMemberRequestBinding.btnReject.isEnabled = true

rowMemberRequestBinding.btnAccept.setOnClickListener {
acceptReject(list[position], true, position)
val adapterPosition = holder.bindingAdapterPosition
if (adapterPosition != RecyclerView.NO_POSITION && adapterPosition < list.size) {
acceptReject(list[adapterPosition], true, adapterPosition)
}
}

rowMemberRequestBinding.btnReject.setOnClickListener {
acceptReject(list[position], false, position)
val adapterPosition = holder.bindingAdapterPosition
if (adapterPosition != RecyclerView.NO_POSITION && adapterPosition < list.size) {
acceptReject(list[adapterPosition], false, adapterPosition)
}
}
} else {
rowMemberRequestBinding.btnAccept.isEnabled = false
Expand Down

0 comments on commit 1ef8874

Please sign in to comment.