Move some more filters to kmp

pull/2922/head
Alex Baker 5 months ago
parent e78d452d7b
commit 17af8ab373

@ -2,7 +2,7 @@ package com.todoroo.astrid.adapter
import com.natpryce.makeiteasy.MakeItEasy.with
import com.natpryce.makeiteasy.PropertyValue
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.service.TaskMover
import dagger.hilt.android.testing.HiltAndroidTest

@ -2,7 +2,7 @@ package com.todoroo.astrid.service
import com.natpryce.makeiteasy.MakeItEasy.with
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.dao.TaskDao
import dagger.hilt.android.testing.HiltAndroidTest
import dagger.hilt.android.testing.UninstallModules

@ -1,7 +1,7 @@
package org.tasks.data
import com.natpryce.makeiteasy.MakeItEasy.with
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.dao.TaskDao
import dagger.hilt.android.testing.HiltAndroidTest
import dagger.hilt.android.testing.UninstallModules

@ -9,8 +9,8 @@ import androidx.lifecycle.viewModelScope
import com.todoroo.astrid.activity.MainActivity.Companion.LOAD_FILTER
import com.todoroo.astrid.activity.MainActivity.Companion.OPEN_FILTER
import com.todoroo.astrid.api.CustomFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf

@ -61,8 +61,8 @@ import com.todoroo.astrid.adapter.TaskAdapterProvider
import com.todoroo.astrid.api.AstridApiConstants.EXTRAS_OLD_DUE_DATE
import com.todoroo.astrid.api.AstridApiConstants.EXTRAS_TASK_ID
import com.todoroo.astrid.api.CustomFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import com.todoroo.astrid.core.BuiltInFilterExposer
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.repeats.RepeatTaskHelper

@ -9,8 +9,8 @@ import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.CustomFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import org.tasks.R
import org.tasks.billing.Inventory
import org.tasks.databinding.FilterAdapterRowBinding

@ -2,8 +2,8 @@ package com.todoroo.astrid.adapter
import android.content.Context
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import com.todoroo.astrid.core.BuiltInFilterExposer
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.service.TaskMover

@ -13,7 +13,7 @@ import android.view.ViewGroup
import androidx.compose.ui.platform.ComposeView
import androidx.lifecycle.lifecycleScope
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import net.fortuna.ical4j.model.Recur

@ -2,7 +2,7 @@ package com.todoroo.astrid.service
import com.todoroo.andlib.utility.DateUtilities
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.api.PermaSql
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.gcal.GCalHelper

@ -2,7 +2,7 @@ package com.todoroo.astrid.service
import android.content.Context
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import dagger.hilt.android.qualifiers.ApplicationContext
import org.tasks.BuildConfig
import org.tasks.LocalBroadcastManager

@ -6,7 +6,7 @@ import androidx.annotation.ColorRes
import com.google.common.collect.ImmutableListMultimap
import com.google.common.collect.ListMultimap
import com.google.common.collect.Multimaps
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.dao.TaskDao
import dagger.Lazy
import dagger.hilt.android.qualifiers.ApplicationContext

@ -13,7 +13,7 @@ import com.google.android.material.textfield.TextInputEditText
import com.google.api.services.tasks.model.TaskList
import com.todoroo.astrid.activity.MainActivity
import com.todoroo.astrid.activity.TaskListFragment
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.service.TaskDeleter
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.NonCancellable

@ -20,8 +20,8 @@ import com.todoroo.astrid.adapter.FilterViewHolder
import com.todoroo.astrid.adapter.NavigationDrawerAdapter
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.CustomFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch
import org.tasks.LocalBroadcastManager

@ -15,7 +15,7 @@ import com.google.android.material.textfield.TextInputEditText
import com.google.android.material.textfield.TextInputLayout
import com.todoroo.astrid.activity.MainActivity
import com.todoroo.astrid.activity.TaskListFragment
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.TagFilter
import dagger.hilt.android.AndroidEntryPoint
import org.tasks.LocalBroadcastManager
import org.tasks.R

@ -33,7 +33,7 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import org.tasks.compose.CheckBox
import org.tasks.compose.ClearButton
import org.tasks.compose.DisabledText

@ -1,6 +1,6 @@
package org.tasks.data
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
fun GoogleTaskFilters.toGtasksFilter(): GtasksFilter = GtasksFilter(
list = googleTaskList,

@ -1,6 +1,6 @@
package org.tasks.data
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.TagFilter
fun TagFilters.toTagFilter(): TagFilter = TagFilter(
tagData = tagData,

@ -1,7 +1,7 @@
package org.tasks.data
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.api.PermaSql
import com.todoroo.astrid.core.SortHelper
import org.tasks.data.dao.TaskDao.TaskCriteria.activeAndVisible

@ -6,7 +6,7 @@ import com.google.api.client.util.DateTime
import com.google.api.services.tasks.model.Task
import com.google.api.services.tasks.model.TaskList
import com.google.api.services.tasks.model.Tasks
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.gtasks.GtasksListService
import com.todoroo.astrid.gtasks.api.GtasksApiUtilities

@ -3,8 +3,8 @@ package org.tasks.preferences
import android.content.Context
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.CustomFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import com.todoroo.astrid.core.BuiltInFilterExposer
import com.todoroo.astrid.core.BuiltInFilterExposer.Companion.getMyTasksFilter
import dagger.hilt.android.qualifiers.ApplicationContext

@ -15,8 +15,8 @@ import androidx.compose.ui.unit.dp
import androidx.recyclerview.widget.RecyclerView
import com.todoroo.andlib.utility.DateUtilities
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import com.todoroo.astrid.core.SortHelper.SORT_DUE
import com.todoroo.astrid.core.SortHelper.SORT_LIST
import com.todoroo.astrid.core.SortHelper.SORT_START

@ -1,6 +1,6 @@
package org.tasks.ui
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.TagFilter
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach

@ -10,7 +10,7 @@ import androidx.lifecycle.viewModelScope
import com.todoroo.astrid.activity.TaskEditFragment
import com.todoroo.astrid.alarms.AlarmService
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import org.tasks.filters.GtasksFilter
import com.todoroo.astrid.dao.TaskDao
import com.todoroo.astrid.gcal.GCalHelper
import com.todoroo.astrid.service.TaskCompleter

@ -6,8 +6,8 @@ import android.content.Context
import android.content.Intent
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.todoroo.astrid.api.EmptyFilter
import com.todoroo.astrid.api.SearchFilter
import org.tasks.filters.EmptyFilter
import org.tasks.filters.SearchFilter
import com.todoroo.astrid.core.BuiltInFilterExposer
import com.todoroo.astrid.service.TaskDeleter
import dagger.hilt.android.lifecycle.HiltViewModel

@ -5,8 +5,8 @@ import android.widget.RemoteViews
import androidx.annotation.ColorInt
import com.todoroo.andlib.utility.DateUtilities
import org.tasks.filters.CaldavFilter
import com.todoroo.astrid.api.GtasksFilter
import com.todoroo.astrid.api.TagFilter
import org.tasks.filters.GtasksFilter
import org.tasks.filters.TagFilter
import dagger.hilt.android.qualifiers.ApplicationContext
import org.tasks.BuildConfig
import org.tasks.R

@ -1,10 +1,8 @@
package com.todoroo.astrid.api
package org.tasks.filters
import kotlinx.parcelize.Parcelize
import org.tasks.filters.Filter
import org.tasks.filters.FilterListItem
import org.tasks.CommonParcelize
@Parcelize
@CommonParcelize
class EmptyFilter(
override val sql: String? = "WHERE 0",
override val title: String? = null

@ -1,21 +1,17 @@
package com.todoroo.astrid.api
package org.tasks.filters
import org.tasks.data.sql.Criterion.Companion.and
import org.tasks.data.sql.Join.Companion.left
import org.tasks.data.sql.QueryTemplate
import com.todoroo.andlib.utility.AndroidUtilities
import org.tasks.data.entity.Task
import kotlinx.parcelize.Parcelize
import org.tasks.data.entity.CaldavCalendar
import org.tasks.data.entity.CaldavTask
import org.tasks.CommonParcelize
import org.tasks.data.GoogleTask
import org.tasks.data.NO_COUNT
import org.tasks.data.dao.TaskDao.TaskCriteria.activeAndVisible
import org.tasks.filters.Filter
import org.tasks.filters.FilterListItem
import org.tasks.filters.mapToSerializedString
import org.tasks.data.entity.CaldavCalendar
import org.tasks.data.entity.CaldavTask
import org.tasks.data.entity.Task
import org.tasks.data.sql.Criterion.Companion.and
import org.tasks.data.sql.Join.Companion.left
import org.tasks.data.sql.QueryTemplate
@Parcelize
@CommonParcelize
data class GtasksFilter(
val list: CaldavCalendar,
override val count: Int = NO_COUNT,

@ -1,6 +1,6 @@
package com.todoroo.astrid.api
package org.tasks.filters
import kotlinx.parcelize.Parcelize
import org.tasks.CommonParcelize
import org.tasks.data.entity.CaldavCalendar
import org.tasks.data.entity.CaldavTask
import org.tasks.data.entity.Geofence
@ -12,10 +12,8 @@ import org.tasks.data.sql.Criterion
import org.tasks.data.sql.Join
import org.tasks.data.sql.Query
import org.tasks.data.sql.QueryTemplate
import org.tasks.filters.Filter
import org.tasks.filters.FilterListItem
@Parcelize
@CommonParcelize
data class SearchFilter(
override val title: String,
val query: String,

@ -1,7 +1,6 @@
package com.todoroo.astrid.api
package org.tasks.filters
import com.todoroo.andlib.utility.AndroidUtilities
import kotlinx.parcelize.Parcelize
import org.tasks.CommonParcelize
import org.tasks.data.NO_COUNT
import org.tasks.data.dao.TaskDao.TaskCriteria.activeAndVisible
import org.tasks.data.entity.Tag
@ -10,11 +9,8 @@ import org.tasks.data.entity.Task
import org.tasks.data.sql.Criterion.Companion.and
import org.tasks.data.sql.Join.Companion.inner
import org.tasks.data.sql.QueryTemplate
import org.tasks.filters.AstridOrderingFilter
import org.tasks.filters.FilterListItem
import org.tasks.filters.mapToSerializedString
@Parcelize
@CommonParcelize
data class TagFilter(
val tagData: TagData,
override val count: Int = NO_COUNT,
Loading…
Cancel
Save