|
|
@ -20,7 +20,6 @@ import androidx.appcompat.widget.SearchView
|
|
|
|
import androidx.appcompat.widget.Toolbar
|
|
|
|
import androidx.appcompat.widget.Toolbar
|
|
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
|
|
import androidx.coordinatorlayout.widget.CoordinatorLayout
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
import androidx.fragment.app.Fragment
|
|
|
|
import androidx.fragment.app.activityViewModels
|
|
|
|
|
|
|
|
import androidx.fragment.app.viewModels
|
|
|
|
import androidx.fragment.app.viewModels
|
|
|
|
import androidx.lifecycle.Observer
|
|
|
|
import androidx.lifecycle.Observer
|
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
|
import androidx.lifecycle.lifecycleScope
|
|
|
@ -41,10 +40,7 @@ import com.todoroo.astrid.api.*
|
|
|
|
import com.todoroo.astrid.core.BuiltInFilterExposer
|
|
|
|
import com.todoroo.astrid.core.BuiltInFilterExposer
|
|
|
|
import com.todoroo.astrid.dao.TaskDao
|
|
|
|
import com.todoroo.astrid.dao.TaskDao
|
|
|
|
import com.todoroo.astrid.data.Task
|
|
|
|
import com.todoroo.astrid.data.Task
|
|
|
|
import com.todoroo.astrid.service.TaskCreator
|
|
|
|
import com.todoroo.astrid.service.*
|
|
|
|
import com.todoroo.astrid.service.TaskDeleter
|
|
|
|
|
|
|
|
import com.todoroo.astrid.service.TaskDuplicator
|
|
|
|
|
|
|
|
import com.todoroo.astrid.service.TaskMover
|
|
|
|
|
|
|
|
import com.todoroo.astrid.timers.TimerPlugin
|
|
|
|
import com.todoroo.astrid.timers.TimerPlugin
|
|
|
|
import com.todoroo.astrid.utility.Flags
|
|
|
|
import com.todoroo.astrid.utility.Flags
|
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
|
|
import dagger.hilt.android.AndroidEntryPoint
|
|
|
@ -111,6 +107,7 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
|
|
|
|
@Inject lateinit var colorProvider: ColorProvider
|
|
|
|
@Inject lateinit var colorProvider: ColorProvider
|
|
|
|
@Inject lateinit var notificationManager: NotificationManager
|
|
|
|
@Inject lateinit var notificationManager: NotificationManager
|
|
|
|
@Inject lateinit var shortcutManager: ShortcutManager
|
|
|
|
@Inject lateinit var shortcutManager: ShortcutManager
|
|
|
|
|
|
|
|
@Inject lateinit var taskCompleter: TaskCompleter
|
|
|
|
|
|
|
|
|
|
|
|
@BindView(R.id.swipe_layout)
|
|
|
|
@BindView(R.id.swipe_layout)
|
|
|
|
lateinit var swipeRefreshLayout: SwipeRefreshLayout
|
|
|
|
lateinit var swipeRefreshLayout: SwipeRefreshLayout
|
|
|
@ -753,9 +750,12 @@ class TaskListFragment : Fragment(), OnRefreshListener, Toolbar.OnMenuItemClickL
|
|
|
|
fun clearCollapsed() = taskAdapter.clearCollapsed()
|
|
|
|
fun clearCollapsed() = taskAdapter.clearCollapsed()
|
|
|
|
|
|
|
|
|
|
|
|
override fun onCompletedTask(task: TaskContainer, newState: Boolean) {
|
|
|
|
override fun onCompletedTask(task: TaskContainer, newState: Boolean) {
|
|
|
|
|
|
|
|
lifecycleScope.launch {
|
|
|
|
|
|
|
|
taskCompleter.setComplete(task.getTask(), newState)
|
|
|
|
taskAdapter.onCompletedTask(task, newState)
|
|
|
|
taskAdapter.onCompletedTask(task, newState)
|
|
|
|
loadTaskListContent()
|
|
|
|
loadTaskListContent()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
override fun onClick(taskViewHolder: TaskViewHolder) {
|
|
|
|
override fun onClick(taskViewHolder: TaskViewHolder) {
|
|
|
|
if (isActionModeActive) {
|
|
|
|
if (isActionModeActive) {
|
|
|
|