Refresh widgets in widget view model after widgets have been changed
This commit is contained in:
MM20
2022-02-07 18:35:08 +01:00
parent fb407afe21
commit e8a5c1f24b
3 changed files with 11 additions and 8 deletions
@@ -3,11 +3,12 @@ package de.mm20.launcher2.database
import androidx.lifecycle.LiveData
import androidx.room.*
import de.mm20.launcher2.database.entities.WidgetEntity
import kotlinx.coroutines.flow.Flow
@Dao
interface WidgetDao {
@Query("SELECT * FROM Widget ORDER BY position ASC")
fun getWidgets(): List<WidgetEntity>
fun getWidgets(): Flow<List<WidgetEntity>>
@Transaction
fun updateWidgets(widgets: List<WidgetEntity>) {