@@ -1,6 +1,5 @@
|
||||
package eu.kanade.tachiyomi.source
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import androidx.preference.PreferenceScreen
|
||||
@@ -15,7 +14,7 @@ interface ConfigurableSource : Source {
|
||||
* @since extensions-lib 1.5
|
||||
*/
|
||||
fun getSourcePreferences(): SharedPreferences =
|
||||
Injekt.get<Application>().getSharedPreferences(preferenceKey(), Context.MODE_PRIVATE)
|
||||
Injekt.get<Context>().getSharedPreferences(preferenceKey(), Context.MODE_PRIVATE)
|
||||
|
||||
fun setupPreferenceScreen(screen: PreferenceScreen)
|
||||
}
|
||||
@@ -24,7 +23,7 @@ fun ConfigurableSource.preferenceKey(): String = "source_$id"
|
||||
|
||||
// TODO: use getSourcePreferences once all extensions are on ext-lib 1.5
|
||||
fun ConfigurableSource.sourcePreferences(): SharedPreferences =
|
||||
Injekt.get<Application>().getSharedPreferences(preferenceKey(), Context.MODE_PRIVATE)
|
||||
Injekt.get<Context>().getSharedPreferences(preferenceKey(), Context.MODE_PRIVATE)
|
||||
|
||||
fun sourcePreferences(key: String): SharedPreferences =
|
||||
Injekt.get<Application>().getSharedPreferences(key, Context.MODE_PRIVATE)
|
||||
Injekt.get<Context>().getSharedPreferences(key, Context.MODE_PRIVATE)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package eu.kanade.tachiyomi.util
|
||||
|
||||
import rx.Observable
|
||||
import tachiyomi.core.common.util.lang.awaitSingle
|
||||
|
||||
suspend fun <T> Observable<T>.awaitSingle(): T = awaitSingle()
|
||||
Reference in New Issue
Block a user