Loading build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.0.5' propVersionName = '3.0.6' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewAdapter.kt +16 −0 Original line number Diff line number Diff line Loading @@ -215,6 +215,22 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc holder.itemView.tag = holder } fun removeSelectedItems() { selectedPositions.sortedDescending().forEach { notifyItemRemoved(it) itemViews.put(it, null) } val newItems = SparseArray<View>() (0 until itemViews.size()) .filter { itemViews[it] != null } .forEachIndexed { curIndex, i -> newItems.put(curIndex, itemViews[i]) } itemViews = newItems selectableItemCount = itemCount finishActMode() } class ViewHolder(view: View, val adapterListener: MyAdapterListener, val activity: BaseSimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, val multiSelector: MultiSelector, val itemClick: (Any) -> (Unit)) : SwappingHolder(view, multiSelector) { fun bindView(any: Any, allowLongClick: Boolean = true, callback: (itemView: View, layoutPosition: Int) -> Unit): View { Loading Loading
build.gradle +1 −1 Original line number Diff line number Diff line Loading @@ -7,7 +7,7 @@ buildscript { propMinSdkVersion = 16 propTargetSdkVersion = propCompileSdkVersion propVersionCode = 1 propVersionName = '3.0.5' propVersionName = '3.0.6' kotlin_version = '1.2.0' support_libs = '27.0.2' } Loading
commons/src/main/kotlin/com/simplemobiletools/commons/adapters/MyRecyclerViewAdapter.kt +16 −0 Original line number Diff line number Diff line Loading @@ -215,6 +215,22 @@ abstract class MyRecyclerViewAdapter(val activity: BaseSimpleActivity, val recyc holder.itemView.tag = holder } fun removeSelectedItems() { selectedPositions.sortedDescending().forEach { notifyItemRemoved(it) itemViews.put(it, null) } val newItems = SparseArray<View>() (0 until itemViews.size()) .filter { itemViews[it] != null } .forEachIndexed { curIndex, i -> newItems.put(curIndex, itemViews[i]) } itemViews = newItems selectableItemCount = itemCount finishActMode() } class ViewHolder(view: View, val adapterListener: MyAdapterListener, val activity: BaseSimpleActivity, val multiSelectorCallback: ModalMultiSelectorCallback, val multiSelector: MultiSelector, val itemClick: (Any) -> (Unit)) : SwappingHolder(view, multiSelector) { fun bindView(any: Any, allowLongClick: Boolean = true, callback: (itemView: View, layoutPosition: Int) -> Unit): View { Loading