Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab290073 authored by tibbi's avatar tibbi
Browse files

simplify the way of getting selected recyclerview items

parent 9281d407
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ buildscript {
        propMinSdkVersion = 21
        propTargetSdkVersion = propCompileSdkVersion
        propVersionCode = 1
        propVersionName = '5.0.22'
        propVersionName = '5.1.0'
        kotlin_version = '1.2.71'
    }

+2 −1
Original line number Diff line number Diff line
@@ -147,8 +147,9 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc

    protected fun isKeySelected(key: Int) = selectedKeys.contains(key)

    protected fun getSelectedItemPositions(keys: List<Int>, sortDescending: Boolean = true): ArrayList<Int> {
    protected fun getSelectedItemPositions(sortDescending: Boolean = true): ArrayList<Int> {
        val positions = ArrayList<Int>()
        val keys = selectedKeys.toList()
        keys.forEach {
            val position = getItemKeyPosition(it)
            if (position != -1) {