imported more settings
This commit is contained in:
parent
922ccdfb27
commit
c242fedfee
21 changed files with 90 additions and 52 deletions
|
@ -355,7 +355,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
viewPager.setCurrentItem(selected, false)
|
||||
|
||||
if (model.continueMedia == null && media.cameFromContinue) {
|
||||
model.continueMedia = loadData("continue_media") ?: true
|
||||
model.continueMedia = PrefWrapper.getVal(PrefName.ContinueMedia, true)
|
||||
selected = 1
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ import ani.dantotsu.parsers.ShowResponse
|
|||
import ani.dantotsu.parsers.VideoExtractor
|
||||
import ani.dantotsu.parsers.WatchSources
|
||||
import ani.dantotsu.saveData
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import ani.dantotsu.snackString
|
||||
import ani.dantotsu.tryWithSuspend
|
||||
import com.bumptech.glide.load.resource.bitmap.BitmapTransformation
|
||||
|
@ -48,7 +50,7 @@ class MediaDetailsViewModel : ViewModel() {
|
|||
fun loadSelected(media: Media, isDownload: Boolean = false): Selected {
|
||||
val data = loadData<Selected>("${media.id}-select") ?: Selected().let {
|
||||
it.sourceIndex = 0
|
||||
it.preferDub = loadData("settings_prefer_dub") ?: false
|
||||
it.preferDub = PrefWrapper.getVal(PrefName.SettingsPreferDub, false)
|
||||
saveSelected(media.id, it)
|
||||
it
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@ import ani.dantotsu.connections.anilist.Anilist
|
|||
import ani.dantotsu.connections.anilist.AnilistSearch
|
||||
import ani.dantotsu.connections.anilist.SearchResults
|
||||
import ani.dantotsu.databinding.ActivitySearchBinding
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -51,7 +53,7 @@ class SearchActivity : AppCompatActivity() {
|
|||
bottom = navBarHeight + 80f.px
|
||||
)
|
||||
|
||||
style = loadData<Int>("searchStyle") ?: 0
|
||||
style = PrefWrapper.getVal(PrefName.SearchStyle,0)
|
||||
var listOnly: Boolean? = intent.getBooleanExtra("listOnly", false)
|
||||
if (!listOnly!!) listOnly = null
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import ani.dantotsu.R
|
|||
import ani.dantotsu.connections.anilist.Anilist
|
||||
import ani.dantotsu.databinding.ItemChipBinding
|
||||
import ani.dantotsu.databinding.ItemSearchHeaderBinding
|
||||
import ani.dantotsu.saveData
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import com.google.android.material.checkbox.MaterialCheckBox.*
|
||||
|
@ -149,14 +148,14 @@ class SearchAdapter(private val activity: SearchActivity, private val type: Stri
|
|||
it.alpha = 1f
|
||||
binding.searchResultList.alpha = 0.33f
|
||||
activity.style = 0
|
||||
saveData("searchStyle", 0)
|
||||
PrefWrapper.setVal(PrefName.SearchStyle, 0)
|
||||
activity.recycler()
|
||||
}
|
||||
binding.searchResultList.setOnClickListener {
|
||||
it.alpha = 1f
|
||||
binding.searchResultGrid.alpha = 0.33f
|
||||
activity.style = 1
|
||||
saveData("searchStyle", 1)
|
||||
PrefWrapper.setVal(PrefName.SearchStyle, 1)
|
||||
activity.recycler()
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,8 @@ import ani.dantotsu.others.Download.download
|
|||
import ani.dantotsu.parsers.Subtitle
|
||||
import ani.dantotsu.parsers.VideoExtractor
|
||||
import ani.dantotsu.parsers.VideoType
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -299,7 +301,7 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
|
|||
extractor.server.name
|
||||
media!!.anime!!.episodes!![media!!.anime!!.selectedEpisode!!]!!.selectedVideo =
|
||||
position
|
||||
if ((loadData<Int>("settings_download_manager") ?: 0) != 0) {
|
||||
if (PrefWrapper.getVal(PrefName.DownloadManager, 0) != 0) {
|
||||
download(
|
||||
requireActivity(),
|
||||
media!!.anime!!.episodes!![media!!.anime!!.selectedEpisode!!]!!,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue