From 17af8ab37310777734535fedcc97f7dfba247667 Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Sun, 16 Jun 2024 02:15:00 -0500 Subject: [PATCH] Move some more filters to kmp --- .../GoogleTaskManualSortAdapterTest.kt | 2 +- .../todoroo/astrid/service/TaskMoverTest.kt | 2 +- .../tasks/data/ManualGoogleTaskQueryTest.kt | 2 +- .../astrid/activity/MainActivityViewModel.kt | 4 ++-- .../astrid/activity/TaskListFragment.kt | 4 ++-- .../astrid/adapter/FilterViewHolder.kt | 4 ++-- .../astrid/adapter/TaskAdapterProvider.kt | 4 ++-- .../astrid/repeats/RepeatControlSet.kt | 2 +- .../com/todoroo/astrid/service/TaskCreator.kt | 2 +- .../com/todoroo/astrid/service/TaskMover.kt | 2 +- .../com/todoroo/astrid/service/Upgrader.kt | 2 +- .../GoogleTaskListSettingsActivity.kt | 2 +- .../NavigationDrawerCustomization.kt | 4 ++-- .../tasks/activities/TagSettingsActivity.kt | 2 +- .../java/org/tasks/compose/edit/SubtaskRow.kt | 2 +- .../tasks/data/GoogleTaskFiltersExtensions.kt | 2 +- .../org/tasks/data/TagFiltersExtensions.kt | 2 +- .../org/tasks/data/TaskListQueryRecursive.kt | 2 +- .../tasks/gtasks/GoogleTaskSynchronizer.kt | 2 +- .../preferences/DefaultFilterProvider.kt | 4 ++-- .../java/org/tasks/tasklist/TaskViewHolder.kt | 4 ++-- .../main/java/org/tasks/ui/ChipListCache.kt | 2 +- .../java/org/tasks/ui/TaskEditViewModel.kt | 2 +- .../java/org/tasks/ui/TaskListViewModel.kt | 4 ++-- .../org/tasks/widget/WidgetChipProvider.kt | 4 ++-- .../kotlin/org/tasks/filters}/EmptyFilter.kt | 8 +++---- .../kotlin/org/tasks/filters}/GtasksFilter.kt | 22 ++++++++----------- .../kotlin/org/tasks/filters}/SearchFilter.kt | 8 +++---- .../kotlin/org/tasks/filters}/TagFilter.kt | 10 +++------ 29 files changed, 52 insertions(+), 64 deletions(-) rename {app/src/main/java/com/todoroo/astrid/api => kmp/src/commonMain/kotlin/org/tasks/filters}/EmptyFilter.kt (55%) rename {app/src/main/java/com/todoroo/astrid/api => kmp/src/commonMain/kotlin/org/tasks/filters}/GtasksFilter.kt (85%) rename {app/src/main/java/com/todoroo/astrid/api => kmp/src/commonMain/kotlin/org/tasks/filters}/SearchFilter.kt (95%) rename {app/src/main/java/com/todoroo/astrid/api => kmp/src/commonMain/kotlin/org/tasks/filters}/TagFilter.kt (83%) diff --git a/app/src/androidTest/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapterTest.kt b/app/src/androidTest/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapterTest.kt index 80fb020c7..53e129fd1 100644 --- a/app/src/androidTest/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapterTest.kt +++ b/app/src/androidTest/java/com/todoroo/astrid/adapter/GoogleTaskManualSortAdapterTest.kt @@ -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 diff --git a/app/src/androidTest/java/com/todoroo/astrid/service/TaskMoverTest.kt b/app/src/androidTest/java/com/todoroo/astrid/service/TaskMoverTest.kt index 71120758b..c3d5ac20d 100644 --- a/app/src/androidTest/java/com/todoroo/astrid/service/TaskMoverTest.kt +++ b/app/src/androidTest/java/com/todoroo/astrid/service/TaskMoverTest.kt @@ -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 diff --git a/app/src/androidTest/java/org/tasks/data/ManualGoogleTaskQueryTest.kt b/app/src/androidTest/java/org/tasks/data/ManualGoogleTaskQueryTest.kt index c3ac99831..aef2a50a8 100644 --- a/app/src/androidTest/java/org/tasks/data/ManualGoogleTaskQueryTest.kt +++ b/app/src/androidTest/java/org/tasks/data/ManualGoogleTaskQueryTest.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/activity/MainActivityViewModel.kt b/app/src/main/java/com/todoroo/astrid/activity/MainActivityViewModel.kt index d092a8e24..7fbbe13cf 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/MainActivityViewModel.kt +++ b/app/src/main/java/com/todoroo/astrid/activity/MainActivityViewModel.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt b/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt index 162eeceb0..7b42ad937 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt +++ b/app/src/main/java/com/todoroo/astrid/activity/TaskListFragment.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/adapter/FilterViewHolder.kt b/app/src/main/java/com/todoroo/astrid/adapter/FilterViewHolder.kt index 105b74e94..4fbe67478 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/FilterViewHolder.kt +++ b/app/src/main/java/com/todoroo/astrid/adapter/FilterViewHolder.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapterProvider.kt b/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapterProvider.kt index 0ec56cb10..436a50712 100644 --- a/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapterProvider.kt +++ b/app/src/main/java/com/todoroo/astrid/adapter/TaskAdapterProvider.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.kt b/app/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.kt index 8325ccd84..80b1f8c0c 100644 --- a/app/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.kt +++ b/app/src/main/java/com/todoroo/astrid/repeats/RepeatControlSet.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/service/TaskCreator.kt b/app/src/main/java/com/todoroo/astrid/service/TaskCreator.kt index b2454de86..ec83b9e3d 100644 --- a/app/src/main/java/com/todoroo/astrid/service/TaskCreator.kt +++ b/app/src/main/java/com/todoroo/astrid/service/TaskCreator.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/service/TaskMover.kt b/app/src/main/java/com/todoroo/astrid/service/TaskMover.kt index 2628aa36b..d7e020492 100644 --- a/app/src/main/java/com/todoroo/astrid/service/TaskMover.kt +++ b/app/src/main/java/com/todoroo/astrid/service/TaskMover.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/service/Upgrader.kt b/app/src/main/java/com/todoroo/astrid/service/Upgrader.kt index 7b945070b..cd14a0141 100644 --- a/app/src/main/java/com/todoroo/astrid/service/Upgrader.kt +++ b/app/src/main/java/com/todoroo/astrid/service/Upgrader.kt @@ -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 diff --git a/app/src/main/java/org/tasks/activities/GoogleTaskListSettingsActivity.kt b/app/src/main/java/org/tasks/activities/GoogleTaskListSettingsActivity.kt index c848d6456..f697cdf20 100644 --- a/app/src/main/java/org/tasks/activities/GoogleTaskListSettingsActivity.kt +++ b/app/src/main/java/org/tasks/activities/GoogleTaskListSettingsActivity.kt @@ -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 diff --git a/app/src/main/java/org/tasks/activities/NavigationDrawerCustomization.kt b/app/src/main/java/org/tasks/activities/NavigationDrawerCustomization.kt index 3bdebb252..47fb9da02 100644 --- a/app/src/main/java/org/tasks/activities/NavigationDrawerCustomization.kt +++ b/app/src/main/java/org/tasks/activities/NavigationDrawerCustomization.kt @@ -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 diff --git a/app/src/main/java/org/tasks/activities/TagSettingsActivity.kt b/app/src/main/java/org/tasks/activities/TagSettingsActivity.kt index 1e9045199..51ea1c55c 100644 --- a/app/src/main/java/org/tasks/activities/TagSettingsActivity.kt +++ b/app/src/main/java/org/tasks/activities/TagSettingsActivity.kt @@ -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 diff --git a/app/src/main/java/org/tasks/compose/edit/SubtaskRow.kt b/app/src/main/java/org/tasks/compose/edit/SubtaskRow.kt index 9952e0e3d..b2d9108cb 100644 --- a/app/src/main/java/org/tasks/compose/edit/SubtaskRow.kt +++ b/app/src/main/java/org/tasks/compose/edit/SubtaskRow.kt @@ -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 diff --git a/app/src/main/java/org/tasks/data/GoogleTaskFiltersExtensions.kt b/app/src/main/java/org/tasks/data/GoogleTaskFiltersExtensions.kt index a574fa555..1658602d8 100644 --- a/app/src/main/java/org/tasks/data/GoogleTaskFiltersExtensions.kt +++ b/app/src/main/java/org/tasks/data/GoogleTaskFiltersExtensions.kt @@ -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, diff --git a/app/src/main/java/org/tasks/data/TagFiltersExtensions.kt b/app/src/main/java/org/tasks/data/TagFiltersExtensions.kt index a775734db..b127e10fb 100644 --- a/app/src/main/java/org/tasks/data/TagFiltersExtensions.kt +++ b/app/src/main/java/org/tasks/data/TagFiltersExtensions.kt @@ -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, diff --git a/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt b/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt index 1051f5cf7..7ea762657 100644 --- a/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt +++ b/app/src/main/java/org/tasks/data/TaskListQueryRecursive.kt @@ -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 diff --git a/app/src/main/java/org/tasks/gtasks/GoogleTaskSynchronizer.kt b/app/src/main/java/org/tasks/gtasks/GoogleTaskSynchronizer.kt index ff44cd60f..54bb95399 100644 --- a/app/src/main/java/org/tasks/gtasks/GoogleTaskSynchronizer.kt +++ b/app/src/main/java/org/tasks/gtasks/GoogleTaskSynchronizer.kt @@ -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 diff --git a/app/src/main/java/org/tasks/preferences/DefaultFilterProvider.kt b/app/src/main/java/org/tasks/preferences/DefaultFilterProvider.kt index ccd4247af..8e510c911 100644 --- a/app/src/main/java/org/tasks/preferences/DefaultFilterProvider.kt +++ b/app/src/main/java/org/tasks/preferences/DefaultFilterProvider.kt @@ -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 diff --git a/app/src/main/java/org/tasks/tasklist/TaskViewHolder.kt b/app/src/main/java/org/tasks/tasklist/TaskViewHolder.kt index 28c8ab7b0..335b57a1f 100644 --- a/app/src/main/java/org/tasks/tasklist/TaskViewHolder.kt +++ b/app/src/main/java/org/tasks/tasklist/TaskViewHolder.kt @@ -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 diff --git a/app/src/main/java/org/tasks/ui/ChipListCache.kt b/app/src/main/java/org/tasks/ui/ChipListCache.kt index 01993e7a8..1b5463612 100644 --- a/app/src/main/java/org/tasks/ui/ChipListCache.kt +++ b/app/src/main/java/org/tasks/ui/ChipListCache.kt @@ -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 diff --git a/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt b/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt index 58561e6c3..3da4fd0d9 100644 --- a/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt +++ b/app/src/main/java/org/tasks/ui/TaskEditViewModel.kt @@ -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 diff --git a/app/src/main/java/org/tasks/ui/TaskListViewModel.kt b/app/src/main/java/org/tasks/ui/TaskListViewModel.kt index 32e4bf810..c6044b627 100644 --- a/app/src/main/java/org/tasks/ui/TaskListViewModel.kt +++ b/app/src/main/java/org/tasks/ui/TaskListViewModel.kt @@ -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 diff --git a/app/src/main/java/org/tasks/widget/WidgetChipProvider.kt b/app/src/main/java/org/tasks/widget/WidgetChipProvider.kt index 631cd9953..73c6ec0af 100644 --- a/app/src/main/java/org/tasks/widget/WidgetChipProvider.kt +++ b/app/src/main/java/org/tasks/widget/WidgetChipProvider.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/api/EmptyFilter.kt b/kmp/src/commonMain/kotlin/org/tasks/filters/EmptyFilter.kt similarity index 55% rename from app/src/main/java/com/todoroo/astrid/api/EmptyFilter.kt rename to kmp/src/commonMain/kotlin/org/tasks/filters/EmptyFilter.kt index 5b3e68a6e..8a86f405a 100644 --- a/app/src/main/java/com/todoroo/astrid/api/EmptyFilter.kt +++ b/kmp/src/commonMain/kotlin/org/tasks/filters/EmptyFilter.kt @@ -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 diff --git a/app/src/main/java/com/todoroo/astrid/api/GtasksFilter.kt b/kmp/src/commonMain/kotlin/org/tasks/filters/GtasksFilter.kt similarity index 85% rename from app/src/main/java/com/todoroo/astrid/api/GtasksFilter.kt rename to kmp/src/commonMain/kotlin/org/tasks/filters/GtasksFilter.kt index d9ad4824a..496e3065b 100644 --- a/app/src/main/java/com/todoroo/astrid/api/GtasksFilter.kt +++ b/kmp/src/commonMain/kotlin/org/tasks/filters/GtasksFilter.kt @@ -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, diff --git a/app/src/main/java/com/todoroo/astrid/api/SearchFilter.kt b/kmp/src/commonMain/kotlin/org/tasks/filters/SearchFilter.kt similarity index 95% rename from app/src/main/java/com/todoroo/astrid/api/SearchFilter.kt rename to kmp/src/commonMain/kotlin/org/tasks/filters/SearchFilter.kt index c901e9a22..e7f755d0b 100644 --- a/app/src/main/java/com/todoroo/astrid/api/SearchFilter.kt +++ b/kmp/src/commonMain/kotlin/org/tasks/filters/SearchFilter.kt @@ -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, diff --git a/app/src/main/java/com/todoroo/astrid/api/TagFilter.kt b/kmp/src/commonMain/kotlin/org/tasks/filters/TagFilter.kt similarity index 83% rename from app/src/main/java/com/todoroo/astrid/api/TagFilter.kt rename to kmp/src/commonMain/kotlin/org/tasks/filters/TagFilter.kt index 67235c0ef..84fe2f91d 100644 --- a/app/src/main/java/com/todoroo/astrid/api/TagFilter.kt +++ b/kmp/src/commonMain/kotlin/org/tasks/filters/TagFilter.kt @@ -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,