Merge pull request #1193 from KryptKode/ref/viewholder-methods

change ViewHolder's viewClicked and viewLongClicked to public methods
This commit is contained in:
Tibor Kaputa 2021-11-10 21:57:52 +01:00 committed by GitHub
commit f0b56ece9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -313,7 +313,7 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc
}
}
private fun viewClicked(any: Any) {
fun viewClicked(any: Any) {
if (actModeCallback.isSelectable) {
val currentPosition = adapterPosition - positionOffset
val isSelected = selectedKeys.contains(getItemSelectionKey(currentPosition))
@ -324,7 +324,7 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc
lastLongPressedItem = -1
}
private fun viewLongClicked() {
fun viewLongClicked() {
val currentPosition = adapterPosition - positionOffset
if (!actModeCallback.isSelectable) {
activity.startSupportActionMode(actModeCallback)