Minor collapsible group changes

pull/996/head
Alex Baker 4 years ago
parent 22e5d2403e
commit e33b16b946

@ -239,7 +239,7 @@ class TaskListFragment : InjectingFragment(), OnRefreshListener, Toolbar.OnMenuI
} else if (recyclerAdapter !is DragAndDropRecyclerAdapter) {
setAdapter(
DragAndDropRecyclerAdapter(
taskAdapter, recyclerView, viewHolderFactory, this, tasks as MutableList, taskDao, preferences))
taskAdapter, recyclerView, viewHolderFactory, this, tasks, taskDao, preferences))
return
}
recyclerAdapter!!.submitList(tasks)

@ -8,6 +8,7 @@ package com.todoroo.astrid.adapter
import com.todoroo.astrid.data.Task
import org.tasks.data.TaskContainer
import java.util.*
import kotlin.collections.HashSet
open class TaskAdapter {
private val selected = HashSet<Long>()
@ -33,7 +34,7 @@ open class TaskAdapter {
fun clearSelections() = selected.clear()
fun getCollapsed(): ArrayList<Long> = ArrayList(collapsed)
fun getCollapsed(): MutableSet<Long> = HashSet(collapsed)
fun setCollapsed(groups: LongArray?) {
clearCollapsed()

@ -28,7 +28,7 @@ class DragAndDropRecyclerAdapter(
private val recyclerView: RecyclerView,
viewHolderFactory: ViewHolderFactory,
private val taskList: TaskListFragment,
tasks: MutableList<TaskContainer>,
tasks: List<TaskContainer>,
taskDao: TaskDao,
preferences: Preferences) : TaskListRecyclerAdapter(adapter, viewHolderFactory, taskList, taskDao, preferences) {
private var list: SectionedDataSource
@ -69,7 +69,7 @@ class DragAndDropRecyclerAdapter(
override fun submitList(list: List<TaskContainer>) {
disposables.add(
Single.fromCallable { SectionedDataSource(list as MutableList, disableHeaders, preferences.sortMode, adapter.getCollapsed().toMutableSet()) }
Single.fromCallable { SectionedDataSource(list, disableHeaders, preferences.sortMode, adapter.getCollapsed()) }
.subscribeOn(Schedulers.computation())
.subscribe(publishSubject::onNext))
}

Loading…
Cancel
Save