From 1467287dff4f03d4e6589e9390acf8b5ea1c7c11 Mon Sep 17 00:00:00 2001 From: Arnau Mora Date: Wed, 10 Apr 2024 13:47:15 +0200 Subject: [PATCH] Fixed deprecations Signed-off-by: Arnau Mora Gras --- app/src/main/java/at/bitfire/icsdroid/Settings.kt | 2 +- app/src/main/java/at/bitfire/icsdroid/SyncWorker.kt | 2 +- .../java/at/bitfire/icsdroid/db/dao/SubscriptionsDao.kt | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/at/bitfire/icsdroid/Settings.kt b/app/src/main/java/at/bitfire/icsdroid/Settings.kt index 7ed8035f..d541803b 100644 --- a/app/src/main/java/at/bitfire/icsdroid/Settings.kt +++ b/app/src/main/java/at/bitfire/icsdroid/Settings.kt @@ -24,7 +24,7 @@ class Settings(context: Context) { @Deprecated( message = "Replace LiveData by Flows", - replaceWith = ReplaceWith("forceDarkModeFlow") + replaceWith = ReplaceWith("forceDarkModeFlow()") ) fun forceDarkModeLive(): LiveData = object: LiveData() { val listener = SharedPreferences.OnSharedPreferenceChangeListener { prefs, key -> diff --git a/app/src/main/java/at/bitfire/icsdroid/SyncWorker.kt b/app/src/main/java/at/bitfire/icsdroid/SyncWorker.kt index 6f2ecc99..022278e9 100644 --- a/app/src/main/java/at/bitfire/icsdroid/SyncWorker.kt +++ b/app/src/main/java/at/bitfire/icsdroid/SyncWorker.kt @@ -88,7 +88,7 @@ class SyncWorker( @Deprecated( message = "Replace LiveData by Flows", - replaceWith = ReplaceWith("statusFlow") + replaceWith = ReplaceWith("statusFlow(context)") ) fun liveStatus(context: Context) = WorkManager.getInstance(context).getWorkInfosForUniqueWorkLiveData(NAME) diff --git a/app/src/main/java/at/bitfire/icsdroid/db/dao/SubscriptionsDao.kt b/app/src/main/java/at/bitfire/icsdroid/db/dao/SubscriptionsDao.kt index 21e06d4b..a8b5487a 100644 --- a/app/src/main/java/at/bitfire/icsdroid/db/dao/SubscriptionsDao.kt +++ b/app/src/main/java/at/bitfire/icsdroid/db/dao/SubscriptionsDao.kt @@ -24,7 +24,7 @@ interface SubscriptionsDao { @Deprecated( message = "Replace LiveData by Flows", - replaceWith = ReplaceWith("getAllFlow") + replaceWith = ReplaceWith("getAllFlow()") ) @Query("SELECT * FROM subscriptions") fun getAllLive(): LiveData> @@ -46,7 +46,7 @@ interface SubscriptionsDao { @Deprecated( message = "Replace LiveData by Flows", - replaceWith = ReplaceWith("getWithCredentialsByIdFlow") + replaceWith = ReplaceWith("getWithCredentialsByIdFlow(id)") ) @Query("SELECT * FROM subscriptions WHERE id=:id") fun getWithCredentialsByIdLive(id: Long): LiveData @@ -56,7 +56,7 @@ interface SubscriptionsDao { @Deprecated( message = "Replace LiveData by Flows", - replaceWith = ReplaceWith("getErrorMessageFlow") + replaceWith = ReplaceWith("getErrorMessageFlow(id)") ) @Query("SELECT errorMessage FROM subscriptions WHERE id=:id") fun getErrorMessageLive(id: Long): LiveData