Skip to content

Commit

Permalink
renamed variables
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppp15 committed Jan 6, 2025
1 parent 4aaa76a commit 0053420
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ class AdapterTeamResource(
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolderTeamResource {
val binding = RowTeamResourceBinding.inflate(LayoutInflater.from(context), parent, false)
return ViewHolderTeamResource(binding)
val rowTeamResourceBinding = RowTeamResourceBinding.inflate(LayoutInflater.from(context), parent, false)
return ViewHolderTeamResource(rowTeamResourceBinding)
}

override fun onBindViewHolder(holder: ViewHolderTeamResource, position: Int) {
val resource = list[position]

holder.binding.tvTitle.text = resource.title
holder.binding.tvDescription.text = resource.description
holder.rowTeamResourceBinding.tvTitle.text = resource.title
holder.rowTeamResourceBinding.tvDescription.text = resource.description

holder.itemView.setOnClickListener {
listener?.openLibraryDetailFragment(resource)
}

holder.binding.ivRemove.setOnClickListener {
holder.rowTeamResourceBinding.ivRemove.setOnClickListener {
removeResource(resource, position)
}

holder.binding.ivRemove.visibility = if (settings.getString("userId", "--") == teamCreator) {
holder.rowTeamResourceBinding.ivRemove.visibility = if (settings.getString("userId", "--") == teamCreator) {
View.VISIBLE
} else {
View.GONE
Expand All @@ -73,5 +73,5 @@ class AdapterTeamResource(
notifyItemRemoved(position)
}

class ViewHolderTeamResource(val binding: RowTeamResourceBinding) : RecyclerView.ViewHolder(binding.root)
class ViewHolderTeamResource(val rowTeamResourceBinding: RowTeamResourceBinding) : RecyclerView.ViewHolder(rowTeamResourceBinding.root)
}

0 comments on commit 0053420

Please sign in to comment.