Skip to content

Commit

Permalink
Merge pull request #113 from jellyfin/dependency-updates-and-fixes
Browse files Browse the repository at this point in the history
Dependency updates and settings fixes
  • Loading branch information
nielsvanvelzen authored Sep 11, 2020
2 parents 9b22759 + 3b5dbd9 commit 51140d3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
16 changes: 11 additions & 5 deletions app/src/main/java/org/jellyfin/mobile/settings/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
val kotlinVersion: String by project
classpath("com.android.tools.build:gradle:4.0.1")
classpath(kotlin("gradle-plugin", kotlinVersion))
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.3.2.0")
classpath("de.mannodermaus.gradle.plugins:android-junit5:1.6.2.0")
}
}

Expand All @@ -26,4 +26,4 @@ tasks.wrapper {

tasks.create<Delete>("clean") {
delete(rootProject.buildDir)
}
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Kotlin version for this project
kotlinVersion=1.4.0
kotlinVersion=1.4.10

0 comments on commit 51140d3

Please sign in to comment.