toggle files checkbox when clicking them and add more space before checkbox

This commit is contained in:
Torsten Grote 2024-07-03 11:41:03 -03:00
parent 118b2c0be0
commit 431e5ba8f5
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF
2 changed files with 5 additions and 4 deletions

View file

@ -80,12 +80,12 @@ internal class FilesAdapter(
R.drawable.ic_chevron_right
}
expandView.setImageResource(res)
itemView.setOnClickListener {
onExpandClicked(item)
}
} else if (item is FileItem) {
expandView.setImageResource(getDrawableResource(item))
itemView.setOnClickListener(null)
}
itemView.setOnClickListener {
if (item is FolderItem) onExpandClicked(item)
else checkBox.toggle()
}
itemView.updatePadding(left = indentPadding * item.level)
nameView.text = item.name

View file

@ -25,6 +25,7 @@
android:id="@+id/nameView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:textAppearance="?android:attr/textAppearanceListItem"
app:layout_constraintEnd_toStartOf="@+id/checkBox"
app:layout_constraintStart_toEndOf="@+id/expandView"