Split the rest of the preferences in PreferencesHelper (#8074)
* Split the reset of the preferences in PreferencesHelper
* Capitalize ThemeMode
(cherry picked from commit 29fa93e829)
# Conflicts:
# app/build.gradle.kts
# app/src/main/java/eu/kanade/domain/manga/model/Manga.kt
# app/src/main/java/eu/kanade/tachiyomi/App.kt
# app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
# app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt
# app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceValues.kt
# app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt
# app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/base/delegate/SecureActivityDelegate.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchController.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/SearchPresenter.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/browse/source/SourcesPresenter.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaPresenter.kt
# app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsAdvancedController.kt
This commit is contained in:
@@ -9,6 +9,7 @@ import eu.kanade.data.DatabaseHandler
|
||||
import eu.kanade.data.category.categoryMapper
|
||||
import eu.kanade.data.chapter.chapterMapper
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.chapter.interactor.DeleteChapters
|
||||
import eu.kanade.domain.chapter.interactor.UpdateChapter
|
||||
import eu.kanade.domain.chapter.model.ChapterUpdate
|
||||
@@ -21,14 +22,15 @@ import eu.kanade.domain.manga.model.MangaUpdate
|
||||
import eu.kanade.domain.source.interactor.InsertFeedSavedSearch
|
||||
import eu.kanade.domain.source.interactor.InsertSavedSearch
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.core.preference.PreferenceStore
|
||||
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
||||
import eu.kanade.tachiyomi.data.backup.BackupCreatorJob
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
|
||||
import eu.kanade.tachiyomi.data.preference.MANGA_NON_COMPLETED
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceValues
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
import eu.kanade.tachiyomi.data.updater.AppUpdateJob
|
||||
import eu.kanade.tachiyomi.extension.ExtensionUpdateJob
|
||||
@@ -95,7 +97,9 @@ object EXHMigrations {
|
||||
*/
|
||||
fun upgrade(
|
||||
context: Context,
|
||||
preferences: PreferencesHelper,
|
||||
preferenceStore: PreferenceStore,
|
||||
basePreferences: BasePreferences,
|
||||
uiPreferences: UiPreferences,
|
||||
networkPreferences: NetworkPreferences,
|
||||
sourcePreferences: SourcePreferences,
|
||||
securityPreferences: SecurityPreferences,
|
||||
@@ -103,10 +107,11 @@ object EXHMigrations {
|
||||
readerPreferences: ReaderPreferences,
|
||||
backupPreferences: BackupPreferences,
|
||||
): Boolean {
|
||||
val oldVersion = preferences.ehLastVersionCode().get()
|
||||
val lastVersionCode = preferenceStore.getInt("eh_last_version_code", 0)
|
||||
val oldVersion = lastVersionCode.get()
|
||||
try {
|
||||
if (oldVersion < BuildConfig.VERSION_CODE) {
|
||||
preferences.ehLastVersionCode().set(BuildConfig.VERSION_CODE)
|
||||
lastVersionCode.set(BuildConfig.VERSION_CODE)
|
||||
|
||||
if (BuildConfig.INCLUDE_UPDATER) {
|
||||
AppUpdateJob.setupTask(context)
|
||||
@@ -363,8 +368,8 @@ object EXHMigrations {
|
||||
if (oldSecureScreen) {
|
||||
securityPreferences.secureScreen().set(SecurityPreferences.SecureScreenMode.ALWAYS)
|
||||
}
|
||||
if (DeviceUtil.isMiui && preferences.extensionInstaller().get() == PreferenceValues.ExtensionInstaller.PACKAGEINSTALLER) {
|
||||
preferences.extensionInstaller().set(PreferenceValues.ExtensionInstaller.LEGACY)
|
||||
if (DeviceUtil.isMiui && basePreferences.extensionInstaller().get() == PreferenceValues.ExtensionInstaller.PACKAGEINSTALLER) {
|
||||
basePreferences.extensionInstaller().set(PreferenceValues.ExtensionInstaller.LEGACY)
|
||||
}
|
||||
}
|
||||
if (oldVersion under 28) {
|
||||
@@ -492,6 +497,14 @@ object EXHMigrations {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (oldVersion under 42) {
|
||||
if (uiPreferences.themeMode().isSet()) {
|
||||
prefs.edit {
|
||||
val themeMode = prefs.getString(uiPreferences.themeMode().key(), null) ?: return@edit
|
||||
putString(uiPreferences.themeMode().key(), themeMode.uppercase())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (oldVersion under 1) { } (1 is current release version)
|
||||
// do stuff here when releasing changed crap
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.app.Application
|
||||
import androidx.work.WorkManager
|
||||
import eu.kanade.data.DatabaseHandler
|
||||
import eu.kanade.domain.backup.service.BackupPreferences
|
||||
import eu.kanade.domain.base.BasePreferences
|
||||
import eu.kanade.domain.library.service.LibraryPreferences
|
||||
import eu.kanade.domain.manga.interactor.GetAllManga
|
||||
import eu.kanade.domain.manga.interactor.GetExhFavoriteMangaWithMetadata
|
||||
@@ -13,8 +14,9 @@ import eu.kanade.domain.manga.interactor.GetSearchMetadata
|
||||
import eu.kanade.domain.manga.interactor.InsertFlatMetadata
|
||||
import eu.kanade.domain.manga.interactor.UpdateManga
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.domain.ui.UiPreferences
|
||||
import eu.kanade.tachiyomi.core.preference.PreferenceStore
|
||||
import eu.kanade.tachiyomi.core.security.SecurityPreferences
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.network.NetworkPreferences
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.online.all.NHentai
|
||||
@@ -35,7 +37,9 @@ import java.util.UUID
|
||||
object DebugFunctions {
|
||||
val app: Application by injectLazy()
|
||||
val handler: DatabaseHandler by injectLazy()
|
||||
val prefs: PreferencesHelper by injectLazy()
|
||||
val prefsStore: PreferenceStore by injectLazy()
|
||||
val basePrefs: BasePreferences by injectLazy()
|
||||
val uiPrefs: UiPreferences by injectLazy()
|
||||
val networkPrefs: NetworkPreferences by injectLazy()
|
||||
val sourcePrefs: SourcePreferences by injectLazy()
|
||||
val securityPrefs: SecurityPreferences by injectLazy()
|
||||
@@ -52,13 +56,15 @@ object DebugFunctions {
|
||||
val getAllManga: GetAllManga by injectLazy()
|
||||
|
||||
fun forceUpgradeMigration() {
|
||||
prefs.ehLastVersionCode().set(1)
|
||||
EXHMigrations.upgrade(app, prefs, networkPrefs, sourcePrefs, securityPrefs, libraryPrefs, readerPrefs, backupPrefs)
|
||||
val lastVersionCode = prefsStore.getInt("eh_last_version_code", 0)
|
||||
lastVersionCode.set(1)
|
||||
EXHMigrations.upgrade(app, prefsStore, basePrefs, uiPrefs, networkPrefs, sourcePrefs, securityPrefs, libraryPrefs, readerPrefs, backupPrefs)
|
||||
}
|
||||
|
||||
fun forceSetupJobs() {
|
||||
prefs.ehLastVersionCode().set(0)
|
||||
EXHMigrations.upgrade(app, prefs, networkPrefs, sourcePrefs, securityPrefs, libraryPrefs, readerPrefs, backupPrefs)
|
||||
val lastVersionCode = prefsStore.getInt("eh_last_version_code", 0)
|
||||
lastVersionCode.set(0)
|
||||
EXHMigrations.upgrade(app, prefsStore, basePrefs, uiPrefs, networkPrefs, sourcePrefs, securityPrefs, libraryPrefs, readerPrefs, backupPrefs)
|
||||
}
|
||||
|
||||
fun resetAgedFlagInEXHManga() {
|
||||
|
||||
@@ -11,6 +11,7 @@ import androidx.work.WorkManager
|
||||
import androidx.work.WorkerParameters
|
||||
import com.elvishew.xlog.Logger
|
||||
import com.elvishew.xlog.XLog
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.domain.chapter.interactor.GetChapterByMangaId
|
||||
import eu.kanade.domain.chapter.interactor.SyncChaptersWithSource
|
||||
import eu.kanade.domain.chapter.model.Chapter
|
||||
@@ -22,7 +23,6 @@ import eu.kanade.domain.manga.model.Manga
|
||||
import eu.kanade.tachiyomi.data.library.LibraryUpdateNotifier
|
||||
import eu.kanade.tachiyomi.data.preference.DEVICE_CHARGING
|
||||
import eu.kanade.tachiyomi.data.preference.DEVICE_ONLY_ON_WIFI
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.online.all.EHentai
|
||||
import eu.kanade.tachiyomi.util.system.isConnectedToWifi
|
||||
@@ -45,7 +45,7 @@ import kotlin.time.Duration.Companion.days
|
||||
|
||||
class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerParameters) :
|
||||
CoroutineWorker(context, workerParams) {
|
||||
private val prefs: PreferencesHelper by injectLazy()
|
||||
private val preferences: UnsortedPreferences by injectLazy()
|
||||
private val sourceManager: SourceManager by injectLazy()
|
||||
private val updateHelper: EHentaiUpdateHelper by injectLazy()
|
||||
private val logger: Logger = xLog()
|
||||
@@ -60,7 +60,6 @@ class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerPara
|
||||
|
||||
override suspend fun doWork(): Result {
|
||||
return try {
|
||||
val preferences = Injekt.get<PreferencesHelper>()
|
||||
if (requiresWifiConnection(preferences) && !context.isConnectedToWifi()) {
|
||||
Result.failure()
|
||||
} else {
|
||||
@@ -179,7 +178,7 @@ class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerPara
|
||||
updatedThisIteration++
|
||||
}
|
||||
} finally {
|
||||
prefs.exhAutoUpdateStats().set(
|
||||
preferences.exhAutoUpdateStats().set(
|
||||
Json.encodeToString(
|
||||
EHentaiUpdaterStats(
|
||||
startTime,
|
||||
@@ -237,7 +236,7 @@ class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerPara
|
||||
}
|
||||
|
||||
fun scheduleBackground(context: Context, prefInterval: Int? = null) {
|
||||
val preferences = Injekt.get<PreferencesHelper>()
|
||||
val preferences = Injekt.get<UnsortedPreferences>()
|
||||
val interval = prefInterval ?: preferences.exhAutoUpdateFrequency().get()
|
||||
if (interval > 0) {
|
||||
val restrictions = preferences.exhAutoUpdateRequirements().get()
|
||||
@@ -270,7 +269,7 @@ class EHentaiUpdateWorker(private val context: Context, workerParams: WorkerPara
|
||||
}
|
||||
}
|
||||
|
||||
fun requiresWifiConnection(preferences: PreferencesHelper): Boolean {
|
||||
fun requiresWifiConnection(preferences: UnsortedPreferences): Boolean {
|
||||
val restrictions = preferences.exhAutoUpdateRequirements().get()
|
||||
return DEVICE_ONLY_ON_WIFI in restrictions
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@ package exh.favorites
|
||||
import android.content.Context
|
||||
import androidx.core.text.HtmlCompat
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class FavoritesIntroDialog {
|
||||
private val prefs: PreferencesHelper by injectLazy()
|
||||
private val prefs: UnsortedPreferences by injectLazy()
|
||||
|
||||
fun show(context: Context) = MaterialAlertDialogBuilder(context)
|
||||
.setTitle(R.string.favorites_sync_notes)
|
||||
|
||||
@@ -3,6 +3,7 @@ package exh.favorites
|
||||
import android.content.Context
|
||||
import android.net.wifi.WifiManager
|
||||
import android.os.PowerManager
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.domain.category.interactor.CreateCategoryWithName
|
||||
import eu.kanade.domain.category.interactor.GetCategories
|
||||
import eu.kanade.domain.category.interactor.SetMangaCategories
|
||||
@@ -15,7 +16,6 @@ import eu.kanade.domain.manga.interactor.UpdateManga
|
||||
import eu.kanade.domain.manga.model.Manga
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.toDomainManga
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.network.POST
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
@@ -56,7 +56,7 @@ class FavoritesSyncHelper(val context: Context) {
|
||||
private val createCategoryWithName: CreateCategoryWithName by injectLazy()
|
||||
private val updateCategory: UpdateCategory by injectLazy()
|
||||
|
||||
private val prefs: PreferencesHelper by injectLazy()
|
||||
private val prefs: UnsortedPreferences by injectLazy()
|
||||
|
||||
private val exh by lazy {
|
||||
Injekt.get<SourceManager>().get(EXH_SOURCE_ID) as? EHentai
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package exh.md.utils
|
||||
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.domain.track.service.TrackPreferences
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.data.track.mdlist.MdList
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.model.SChapter
|
||||
@@ -339,7 +339,7 @@ class MdUtil {
|
||||
"Bearer " + (sessionToken(preferences, mdList) ?: throw NoSessionException()),
|
||||
).build()
|
||||
|
||||
fun getEnabledMangaDex(preferences: PreferencesHelper, sourcePreferences: SourcePreferences = Injekt.get(), sourceManager: SourceManager = Injekt.get()): MangaDex? {
|
||||
fun getEnabledMangaDex(preferences: UnsortedPreferences, sourcePreferences: SourcePreferences = Injekt.get(), sourceManager: SourceManager = Injekt.get()): MangaDex? {
|
||||
return getEnabledMangaDexs(sourcePreferences, sourceManager).let { mangadexs ->
|
||||
preferences.preferredMangaDexId().get().toLongOrNull()?.nullIfZero()
|
||||
?.let { preferredMangaDexId ->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package exh.patch
|
||||
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
import okhttp3.Response
|
||||
@@ -20,7 +20,7 @@ fun OkHttpClient.Builder.injectPatches(sourceIdProducer: () -> Long): OkHttpClie
|
||||
|
||||
fun findAndApplyPatches(sourceId: Long): EHInterceptor {
|
||||
// TODO make it so captcha doesnt auto open in manga eden while applying universal interceptors
|
||||
return if (Injekt.get<PreferencesHelper>().autoSolveCaptcha().get()) {
|
||||
return if (Injekt.get<UnsortedPreferences>().autoSolveCaptcha().get()) {
|
||||
(EH_INTERCEPTORS[sourceId].orEmpty() + EH_INTERCEPTORS[EH_UNIVERSAL_INTERCEPTOR].orEmpty()).merge()
|
||||
} else {
|
||||
EH_INTERCEPTORS[sourceId].orEmpty().merge()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package exh.uconfig
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.network.await
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
import eu.kanade.tachiyomi.source.online.all.EHentai
|
||||
@@ -18,7 +18,7 @@ import uy.kohesive.injekt.injectLazy
|
||||
import java.util.Locale
|
||||
|
||||
class EHConfigurator(val context: Context) {
|
||||
private val prefs: PreferencesHelper by injectLazy()
|
||||
private val prefs: UnsortedPreferences by injectLazy()
|
||||
private val sources: SourceManager by injectLazy()
|
||||
|
||||
private val configuratorClient = OkHttpClient.Builder()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package exh.uconfig
|
||||
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import okhttp3.FormBody
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.util.Locale
|
||||
|
||||
class EhUConfigBuilder {
|
||||
private val preferences: PreferencesHelper by injectLazy()
|
||||
private val preferences: UnsortedPreferences by injectLazy()
|
||||
|
||||
fun build(hathPerks: EHHathPerksResponse): FormBody {
|
||||
val configItems = mutableListOf<ConfigItem>()
|
||||
|
||||
@@ -4,15 +4,15 @@ import android.app.Dialog
|
||||
import android.os.Bundle
|
||||
import com.bluelinelabs.conductor.Router
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class WarnConfigureDialogController : DialogController() {
|
||||
private val prefs: PreferencesHelper by injectLazy()
|
||||
private val prefs: UnsortedPreferences by injectLazy()
|
||||
override fun onCreateDialog(savedViewState: Bundle?): Dialog {
|
||||
return MaterialAlertDialogBuilder(activity!!)
|
||||
.setTitle(R.string.settings_profile_note)
|
||||
@@ -27,7 +27,7 @@ class WarnConfigureDialogController : DialogController() {
|
||||
|
||||
companion object {
|
||||
fun uploadSettings(router: Router) {
|
||||
if (Injekt.get<PreferencesHelper>().exhShowSettingsUploadWarning().get()) {
|
||||
if (Injekt.get<UnsortedPreferences>().exhShowSettingsUploadWarning().get()) {
|
||||
WarnConfigureDialogController().showDialog(router)
|
||||
} else {
|
||||
ConfiguringDialogController().showDialog(router)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package exh.ui.batchadd
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
||||
import eu.kanade.tachiyomi.util.lang.withIOContext
|
||||
import exh.GalleryAddEvent
|
||||
import exh.GalleryAdder
|
||||
import exh.log.xLogE
|
||||
import exh.ui.base.CoroutinePresenter
|
||||
import exh.util.trimOrNull
|
||||
import kotlinx.coroutines.CoroutineExceptionHandler
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -17,8 +17,8 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
class BatchAddPresenter : CoroutinePresenter<BatchAddController>() {
|
||||
private val preferences: PreferencesHelper by injectLazy()
|
||||
class BatchAddPresenter : BasePresenter<BatchAddController>() {
|
||||
private val preferences: UnsortedPreferences by injectLazy()
|
||||
|
||||
private val galleryAdder by lazy { GalleryAdder() }
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ import android.webkit.WebChromeClient
|
||||
import android.webkit.WebView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.databinding.EhActivityCaptchaBinding
|
||||
import eu.kanade.tachiyomi.network.NetworkHelper
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
@@ -48,7 +48,7 @@ import java.util.UUID
|
||||
|
||||
class BrowserActionActivity : AppCompatActivity() {
|
||||
private val sourceManager: SourceManager by injectLazy()
|
||||
private val preferencesHelper: PreferencesHelper by injectLazy()
|
||||
private val preferencesHelper: UnsortedPreferences by injectLazy()
|
||||
private val networkHelper: NetworkHelper by injectLazy()
|
||||
|
||||
val httpClient = networkHelper.client
|
||||
|
||||
@@ -8,9 +8,9 @@ import android.webkit.CookieManager
|
||||
import android.webkit.WebView
|
||||
import android.widget.Toast
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.presentation.webview.EhLoginWebViewScreen
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.ui.base.activity.BaseActivity
|
||||
import eu.kanade.tachiyomi.util.system.WebViewUtil
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
@@ -25,7 +25,7 @@ import java.util.Locale
|
||||
* LoginController
|
||||
*/
|
||||
class EhLoginActivity : BaseActivity() {
|
||||
private val preferenceManager: PreferencesHelper by injectLazy()
|
||||
private val preferenceManager: UnsortedPreferences by injectLazy()
|
||||
|
||||
private var igneous: String? = null
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
import com.bluelinelabs.conductor.ControllerChangeType
|
||||
import com.dd.processbutton.iml.ActionProcessButton
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||
import eu.kanade.domain.UnsortedPreferences
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
import eu.kanade.tachiyomi.databinding.PrefSiteLoginTwoFactorAuthBinding
|
||||
import eu.kanade.tachiyomi.source.Source
|
||||
import eu.kanade.tachiyomi.source.SourceManager
|
||||
@@ -34,7 +34,7 @@ class MangadexLoginDialog(bundle: Bundle? = null) : DialogController(bundle) {
|
||||
|
||||
val source = Injekt.get<SourceManager>().get(args.getLong("key", 0))?.getMainSource() as LoginSource
|
||||
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
val preferences: UnsortedPreferences by injectLazy()
|
||||
|
||||
val scope = CoroutineScope(Job() + Dispatchers.Main)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user