Restructure calendar widget settings

This commit is contained in:
MM20
2024-08-16 23:26:26 +02:00
parent bf29ce6f08
commit cc9bff436a
8 changed files with 157 additions and 87 deletions
@@ -6,6 +6,7 @@ import android.provider.CalendarContract
import androidx.core.database.getStringOrNull
import de.mm20.launcher2.permissions.PermissionGroup
import de.mm20.launcher2.search.CalendarEvent
import de.mm20.launcher2.search.calendar.CalendarListType
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import java.util.Calendar
@@ -201,6 +202,7 @@ class AndroidCalendarProvider(
name = cursor.getStringOrNull(5) ?: cursor.getStringOrNull(1) ?: "",
owner = cursor.getStringOrNull(2),
color = cursor.getInt(3),
types = listOf(CalendarListType.Calendar),
providerId = "local",
)
)
@@ -15,6 +15,9 @@ data class CalendarWidgetConfig(
val legacyExcludedCalendarIds: List<Long>? = null,
@SerialName("excludedCalendars")
val excludedCalendarIds: List<String>? = null,
val completedTasks: Boolean = true,
val upcomingEventsCount: Int = 3,
val upcomingTaskCount: Int = 3,
)
data class CalendarWidget(
override val id: UUID,