Hide top row of favorites in favorites widget if it is directly below the clock widget favorites part

This commit is contained in:
MM20
2023-03-11 13:16:29 +01:00
parent 6424bf7b92
commit 824ae9bba2
4 changed files with 32 additions and 3 deletions
@@ -24,6 +24,8 @@ interface WidgetRepository {
fun isCalendarWidgetEnabled(): Flow<Boolean>
fun isFavoritesWidgetEnabled(): Flow<Boolean>
fun isFavoritesWidgetFirst(): Flow<Boolean>
suspend fun export(toDir: File)
suspend fun import(fromDir: File)
}
@@ -105,6 +107,10 @@ internal class WidgetRepositoryImpl(
return database.widgetDao().exists("internal", "favorites")
}
override fun isFavoritesWidgetFirst(): Flow<Boolean> {
return database.widgetDao().getFirst().map { it?.type == "internal" && it.data == "favorites" }
}
override suspend fun export(toDir: File) = withContext(Dispatchers.IO) {
val dao = database.backupDao()
var page = 0