mirror of
https://github.com/jellyfin/jellyfin-android.git
synced 2026-09-03 05:10:27 +03:00
Update MAP, make background audio preference depend on player
This commit is contained in:
@@ -3,18 +3,20 @@ package org.jellyfin.mobile.settings
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import de.Maxr1998.modernpreferences.Preference
|
||||
import de.Maxr1998.modernpreferences.PreferencesAdapter
|
||||
import de.Maxr1998.modernpreferences.helpers.categoryHeader
|
||||
import de.Maxr1998.modernpreferences.helpers.checkBox
|
||||
import de.Maxr1998.modernpreferences.helpers.screen
|
||||
import de.Maxr1998.modernpreferences.helpers.singleChoice
|
||||
import de.Maxr1998.modernpreferences.helpers.*
|
||||
import de.Maxr1998.modernpreferences.preferences.choice.SelectionItem
|
||||
import org.jellyfin.mobile.AppPreferences
|
||||
import org.jellyfin.mobile.R
|
||||
import org.jellyfin.mobile.utils.Constants
|
||||
import org.koin.android.ext.android.inject
|
||||
|
||||
class SettingsActivity : AppCompatActivity() {
|
||||
|
||||
private val appPreferences: AppPreferences by inject()
|
||||
private val settingsAdapter: PreferencesAdapter by lazy { PreferencesAdapter(buildSettingsScreen()) }
|
||||
private lateinit var backgroundAudioPreference: Preference
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@@ -50,9 +52,13 @@ class SettingsActivity : AppCompatActivity() {
|
||||
singleChoice(Constants.PREF_VIDEO_PLAYER_TYPE, videoPlayerOptions) {
|
||||
titleRes = R.string.pref_video_player_type_title
|
||||
initialSelection = VideoPlayerType.WEB_PLAYER
|
||||
defaultOnSelectionChange { selection ->
|
||||
backgroundAudioPreference.enabled = selection == VideoPlayerType.EXO_PLAYER
|
||||
}
|
||||
}
|
||||
checkBox(Constants.PREF_EXOPLAYER_ALLOW_BACKGROUND_AUDIO) {
|
||||
backgroundAudioPreference = checkBox(Constants.PREF_EXOPLAYER_ALLOW_BACKGROUND_AUDIO) {
|
||||
titleRes = R.string.pref_exoplayer_allow_background_audio
|
||||
enabled = appPreferences.videoPlayerType == VideoPlayerType.EXO_PLAYER
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ object Dependencies {
|
||||
const val constraintLayout = "1.1.3"
|
||||
const val material = "1.2.1"
|
||||
const val webkitX = "1.2.0"
|
||||
const val modernAndroidPreferences = "1.1.0-alpha2"
|
||||
const val modernAndroidPreferences = "1.1.0-alpha3"
|
||||
|
||||
// Network
|
||||
const val apiClient = "0.7.2"
|
||||
|
||||
Reference in New Issue
Block a user