Merge branch 'main' into material3
This commit is contained in:
commit
939a14abfe
35 changed files with 367 additions and 195 deletions
|
@ -9,17 +9,15 @@ plugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdk = 31
|
compileSdk = 32
|
||||||
buildToolsVersion = "32.0.0"
|
buildToolsVersion = "32.0.0"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "dev.jdtech.jellyfin"
|
applicationId = "dev.jdtech.jellyfin"
|
||||||
minSdk = 24
|
minSdk = 26
|
||||||
targetSdk = 31
|
targetSdk = 32
|
||||||
versionCode = 8
|
versionCode = 8
|
||||||
versionName = "0.3.2"
|
versionName = "0.3.2"
|
||||||
|
|
||||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
@ -47,7 +45,6 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
isCoreLibraryDesugaringEnabled = true
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
@ -92,7 +89,7 @@ dependencies {
|
||||||
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
|
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
|
||||||
|
|
||||||
// Room
|
// Room
|
||||||
val roomVersion = "2.4.1"
|
val roomVersion = "2.4.2"
|
||||||
implementation("androidx.room:room-runtime:$roomVersion")
|
implementation("androidx.room:room-runtime:$roomVersion")
|
||||||
kapt("androidx.room:room-compiler:$roomVersion")
|
kapt("androidx.room:room-compiler:$roomVersion")
|
||||||
implementation("androidx.room:room-ktx:$roomVersion")
|
implementation("androidx.room:room-ktx:$roomVersion")
|
||||||
|
@ -106,12 +103,12 @@ dependencies {
|
||||||
implementation("org.jellyfin.sdk:jellyfin-core:$jellyfinVersion")
|
implementation("org.jellyfin.sdk:jellyfin-core:$jellyfinVersion")
|
||||||
|
|
||||||
// Glide
|
// Glide
|
||||||
val glideVersion = "4.13.0"
|
val glideVersion = "4.13.1"
|
||||||
implementation("com.github.bumptech.glide:glide:$glideVersion")
|
implementation("com.github.bumptech.glide:glide:$glideVersion")
|
||||||
kapt("com.github.bumptech.glide:compiler:$glideVersion")
|
kapt("com.github.bumptech.glide:compiler:$glideVersion")
|
||||||
|
|
||||||
// Hilt
|
// Hilt
|
||||||
val hiltVersion = "2.40.5"
|
val hiltVersion = "2.41"
|
||||||
implementation("com.google.dagger:hilt-android:$hiltVersion")
|
implementation("com.google.dagger:hilt-android:$hiltVersion")
|
||||||
kapt("com.google.dagger:hilt-compiler:$hiltVersion")
|
kapt("com.google.dagger:hilt-compiler:$hiltVersion")
|
||||||
|
|
||||||
|
@ -128,14 +125,7 @@ dependencies {
|
||||||
val timberVersion = "5.0.1"
|
val timberVersion = "5.0.1"
|
||||||
implementation("com.jakewharton.timber:timber:$timberVersion")
|
implementation("com.jakewharton.timber:timber:$timberVersion")
|
||||||
|
|
||||||
val aboutLibrariesVersion = "8.9.4"
|
val aboutLibrariesVersion = "10.0.0"
|
||||||
implementation("com.mikepenz:aboutlibraries-core:$aboutLibrariesVersion")
|
implementation("com.mikepenz:aboutlibraries-core:$aboutLibrariesVersion")
|
||||||
implementation("com.mikepenz:aboutlibraries:$aboutLibrariesVersion")
|
implementation("com.mikepenz:aboutlibraries:$aboutLibrariesVersion")
|
||||||
|
|
||||||
// Testing
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
|
||||||
androidTestImplementation("androidx.test.ext:junit:1.1.3")
|
|
||||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
|
|
||||||
|
|
||||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
|
|
||||||
}
|
}
|
|
@ -54,7 +54,7 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
navController.addOnDestinationChangedListener { _, destination, _ ->
|
navController.addOnDestinationChangedListener { _, destination, _ ->
|
||||||
binding.navView.visibility = when (destination.id) {
|
binding.navView.visibility = when (destination.id) {
|
||||||
R.id.settingsFragment, R.id.serverSelectFragment, R.id.addServerFragment, R.id.loginFragment, R.id.about_libraries_dest -> View.GONE
|
R.id.twoPaneSettingsFragment, R.id.serverSelectFragment, R.id.addServerFragment, R.id.loginFragment, R.id.about_libraries_dest -> View.GONE
|
||||||
else -> View.VISIBLE
|
else -> View.VISIBLE
|
||||||
}
|
}
|
||||||
if (destination.id == R.id.about_libraries_dest) binding.mainToolbar.title = getString(R.string.app_info)
|
if (destination.id == R.id.about_libraries_dest) binding.mainToolbar.title = getString(R.string.app_info)
|
||||||
|
|
|
@ -135,6 +135,8 @@ class PlayerActivity : BasePlayerActivity() {
|
||||||
this, resources.getString(R.string.select_subtile_track),
|
this, resources.getString(R.string.select_subtile_track),
|
||||||
viewModel.trackSelector, subtitleRenderer
|
viewModel.trackSelector, subtitleRenderer
|
||||||
)
|
)
|
||||||
|
trackSelectionDialogBuilder.setShowDisableOption(true)
|
||||||
|
|
||||||
val trackSelectionDialog = trackSelectionDialogBuilder.build()
|
val trackSelectionDialog = trackSelectionDialogBuilder.build()
|
||||||
trackSelectionDialog.show()
|
trackSelectionDialog.show()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package dev.jdtech.jellyfin.fragments
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -108,9 +109,12 @@ class EpisodeBottomSheetFragment : BottomSheetDialogFragment() {
|
||||||
binding.downloadButton.setOnClickListener {
|
binding.downloadButton.setOnClickListener {
|
||||||
binding.downloadButton.isEnabled = false
|
binding.downloadButton.isEnabled = false
|
||||||
viewModel.loadDownloadRequestItem(episodeId)
|
viewModel.loadDownloadRequestItem(episodeId)
|
||||||
binding.downloadButton.setImageResource(R.drawable.ic_download_filled)
|
binding.downloadButton.imageTintList = ColorStateList.valueOf(
|
||||||
//binding.downloadButton.setImageResource(android.R.color.transparent)
|
resources.getColor(
|
||||||
//binding.progressDownload.isVisible = true
|
R.color.red,
|
||||||
|
requireActivity().theme
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
viewModel.loadEpisode(episodeId)
|
viewModel.loadEpisode(episodeId)
|
||||||
|
@ -174,12 +178,12 @@ class EpisodeBottomSheetFragment : BottomSheetDialogFragment() {
|
||||||
binding.downloadButtonWrapper.isVisible = true
|
binding.downloadButtonWrapper.isVisible = true
|
||||||
binding.downloadButton.isEnabled = !downloaded
|
binding.downloadButton.isEnabled = !downloaded
|
||||||
|
|
||||||
// Download icon
|
if (downloaded) binding.downloadButton.imageTintList = ColorStateList.valueOf(
|
||||||
val downloadDrawable = when (downloaded) {
|
resources.getColor(
|
||||||
true -> R.drawable.ic_download_filled
|
R.color.red,
|
||||||
false -> R.drawable.ic_download
|
requireActivity().theme
|
||||||
}
|
)
|
||||||
binding.downloadButton.setImageResource(downloadDrawable)
|
)
|
||||||
}
|
}
|
||||||
false -> {
|
false -> {
|
||||||
binding.downloadButtonWrapper.isVisible = false
|
binding.downloadButtonWrapper.isVisible = false
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package dev.jdtech.jellyfin.fragments
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.content.res.ColorStateList
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
@ -75,7 +76,7 @@ class MediaInfoFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(args.itemType != "Movie") {
|
if (args.itemType != "Movie") {
|
||||||
binding.downloadButton.visibility = View.GONE
|
binding.downloadButton.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +113,11 @@ class MediaInfoFragment : Fragment() {
|
||||||
if (uuid != null) {
|
if (uuid != null) {
|
||||||
navigateToPersonDetail(uuid)
|
navigateToPersonDetail(uuid)
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(requireContext(), R.string.error_getting_person_id, Toast.LENGTH_SHORT).show()
|
Toast.makeText(
|
||||||
|
requireContext(),
|
||||||
|
R.string.error_getting_person_id,
|
||||||
|
Toast.LENGTH_SHORT
|
||||||
|
).show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +172,12 @@ class MediaInfoFragment : Fragment() {
|
||||||
binding.downloadButton.setOnClickListener {
|
binding.downloadButton.setOnClickListener {
|
||||||
binding.downloadButton.isEnabled = false
|
binding.downloadButton.isEnabled = false
|
||||||
viewModel.loadDownloadRequestItem(args.itemId)
|
viewModel.loadDownloadRequestItem(args.itemId)
|
||||||
binding.downloadButton.setImageResource(R.drawable.ic_download_filled)
|
binding.downloadButton.imageTintList = ColorStateList.valueOf(
|
||||||
|
resources.getColor(
|
||||||
|
R.color.red,
|
||||||
|
requireActivity().theme
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -216,12 +226,12 @@ class MediaInfoFragment : Fragment() {
|
||||||
binding.downloadButton.isVisible = true
|
binding.downloadButton.isVisible = true
|
||||||
binding.downloadButton.isEnabled = !downloaded
|
binding.downloadButton.isEnabled = !downloaded
|
||||||
|
|
||||||
// Download icon
|
if (downloaded) binding.downloadButton.imageTintList = ColorStateList.valueOf(
|
||||||
val downloadDrawable = when (downloaded) {
|
resources.getColor(
|
||||||
true -> R.drawable.ic_download_filled
|
R.color.red,
|
||||||
false -> R.drawable.ic_download
|
requireActivity().theme
|
||||||
}
|
)
|
||||||
binding.downloadButton.setImageResource(downloadDrawable)
|
)
|
||||||
}
|
}
|
||||||
false -> {
|
false -> {
|
||||||
binding.downloadButton.isVisible = false
|
binding.downloadButton.isVisible = false
|
||||||
|
@ -251,7 +261,12 @@ class MediaInfoFragment : Fragment() {
|
||||||
binding.writers.text = writersString
|
binding.writers.text = writersString
|
||||||
binding.description.text = item.overview
|
binding.description.text = item.overview
|
||||||
binding.nextUpLayout.isVisible = nextUp != null
|
binding.nextUpLayout.isVisible = nextUp != null
|
||||||
binding.nextUpName.text = String.format(getString(R.string.episode_name_extended), nextUp?.parentIndexNumber, nextUp?.indexNumber, nextUp?.name)
|
binding.nextUpName.text = String.format(
|
||||||
|
getString(R.string.episode_name_extended),
|
||||||
|
nextUp?.parentIndexNumber,
|
||||||
|
nextUp?.indexNumber,
|
||||||
|
nextUp?.name
|
||||||
|
)
|
||||||
binding.seasonsLayout.isVisible = seasons.isNotEmpty()
|
binding.seasonsLayout.isVisible = seasons.isNotEmpty()
|
||||||
val seasonsAdapter = binding.seasonsRecyclerView.adapter as ViewItemListAdapter
|
val seasonsAdapter = binding.seasonsRecyclerView.adapter as ViewItemListAdapter
|
||||||
seasonsAdapter.submitList(seasons)
|
seasonsAdapter.submitList(seasons)
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
|
import androidx.preference.ListPreference
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import dev.jdtech.jellyfin.R
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
class SettingsAppearanceFragment : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.fragment_settings_appearance, rootKey)
|
||||||
|
|
||||||
|
findPreference<ListPreference>("theme")?.setOnPreferenceChangeListener { _, newValue ->
|
||||||
|
when (newValue) {
|
||||||
|
"system" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||||
|
"light" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
|
||||||
|
"dark" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
|
||||||
|
}
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.InputType
|
||||||
|
import androidx.preference.EditTextPreference
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import dev.jdtech.jellyfin.R
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
class SettingsCacheFragment : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.fragment_settings_cache, rootKey)
|
||||||
|
|
||||||
|
findPreference<EditTextPreference>("image_cache_size")?.setOnBindEditTextListener { editText ->
|
||||||
|
editText.inputType = InputType.TYPE_CLASS_NUMBER
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.fragment.app.viewModels
|
||||||
|
import androidx.preference.EditTextPreference
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
|
import dev.jdtech.jellyfin.R
|
||||||
|
import dev.jdtech.jellyfin.viewmodels.SettingsDeviceViewModel
|
||||||
|
|
||||||
|
@AndroidEntryPoint
|
||||||
|
@Suppress("unused")
|
||||||
|
class SettingsDeviceFragment : PreferenceFragmentCompat() {
|
||||||
|
|
||||||
|
private val viewModel: SettingsDeviceViewModel by viewModels()
|
||||||
|
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.fragment_settings_device, rootKey)
|
||||||
|
|
||||||
|
findPreference<EditTextPreference>("deviceName")?.setOnPreferenceChangeListener { _, name ->
|
||||||
|
viewModel.updateDeviceName(name.toString())
|
||||||
|
true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import dev.jdtech.jellyfin.R
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
class SettingsDownloadsFragment : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.fragment_settings_downloads, rootKey)
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,40 +3,17 @@ package dev.jdtech.jellyfin.fragments
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.text.InputType
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode
|
|
||||||
import androidx.fragment.app.viewModels
|
|
||||||
import androidx.navigation.fragment.findNavController
|
import androidx.navigation.fragment.findNavController
|
||||||
import androidx.preference.EditTextPreference
|
|
||||||
import androidx.preference.ListPreference
|
|
||||||
import androidx.preference.Preference
|
import androidx.preference.Preference
|
||||||
import androidx.preference.PreferenceFragmentCompat
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
|
||||||
import dev.jdtech.jellyfin.R
|
import dev.jdtech.jellyfin.R
|
||||||
import dev.jdtech.jellyfin.viewmodels.SettingsViewModel
|
|
||||||
|
|
||||||
@AndroidEntryPoint
|
|
||||||
class SettingsFragment: PreferenceFragmentCompat() {
|
class SettingsFragment: PreferenceFragmentCompat() {
|
||||||
|
|
||||||
private val viewModel: SettingsViewModel by viewModels()
|
|
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
setPreferencesFromResource(R.xml.fragment_settings, rootKey)
|
setPreferencesFromResource(R.xml.fragment_settings, rootKey)
|
||||||
|
|
||||||
findPreference<Preference>("switchServer")?.setOnPreferenceClickListener {
|
findPreference<Preference>("switchServer")?.setOnPreferenceClickListener {
|
||||||
findNavController().navigate(SettingsFragmentDirections.actionNavigationSettingsToServerSelectFragment2())
|
findNavController().navigate(TwoPaneSettingsFragmentDirections.actionNavigationSettingsToServerSelectFragment())
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
findPreference<ListPreference>("theme")?.setOnPreferenceChangeListener { _, newValue ->
|
|
||||||
when (newValue) {
|
|
||||||
"system" -> setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM)
|
|
||||||
"light" -> setDefaultNightMode(MODE_NIGHT_NO)
|
|
||||||
"dark" -> setDefaultNightMode(MODE_NIGHT_YES)
|
|
||||||
}
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,16 +27,7 @@ class SettingsFragment: PreferenceFragmentCompat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
findPreference<Preference>("appInfo")?.setOnPreferenceClickListener {
|
findPreference<Preference>("appInfo")?.setOnPreferenceClickListener {
|
||||||
findNavController().navigate(SettingsFragmentDirections.actionSettingsFragmentToAboutLibraries())
|
findNavController().navigate(TwoPaneSettingsFragmentDirections.actionSettingsFragmentToAboutLibraries())
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
findPreference<EditTextPreference>("image_cache_size")?.setOnBindEditTextListener { editText ->
|
|
||||||
editText.inputType = InputType.TYPE_CLASS_NUMBER
|
|
||||||
}
|
|
||||||
|
|
||||||
findPreference<EditTextPreference>("deviceName")?.setOnPreferenceChangeListener { _, name ->
|
|
||||||
viewModel.updateDeviceName(name.toString())
|
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import dev.jdtech.jellyfin.R
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
class SettingsLanguageFragment : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.fragment_settings_language, rootKey)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import dev.jdtech.jellyfin.R
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
|
class SettingsPlayerFragment : PreferenceFragmentCompat() {
|
||||||
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
|
setPreferencesFromResource(R.xml.fragment_settings_player, rootKey)
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package dev.jdtech.jellyfin.fragments
|
||||||
|
|
||||||
|
import androidx.preference.PreferenceFragmentCompat
|
||||||
|
import androidx.preference.PreferenceHeaderFragmentCompat
|
||||||
|
|
||||||
|
class TwoPaneSettingsFragment : PreferenceHeaderFragmentCompat() {
|
||||||
|
override fun onCreatePreferenceHeader(): PreferenceFragmentCompat {
|
||||||
|
return SettingsFragment()
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import android.content.Context
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Environment
|
import android.os.Environment
|
||||||
import androidx.core.content.getSystemService
|
import androidx.core.content.getSystemService
|
||||||
|
import androidx.preference.PreferenceManager
|
||||||
import dev.jdtech.jellyfin.database.DownloadDatabaseDao
|
import dev.jdtech.jellyfin.database.DownloadDatabaseDao
|
||||||
import dev.jdtech.jellyfin.models.DownloadItem
|
import dev.jdtech.jellyfin.models.DownloadItem
|
||||||
import dev.jdtech.jellyfin.models.DownloadRequestItem
|
import dev.jdtech.jellyfin.models.DownloadRequestItem
|
||||||
|
@ -50,9 +51,13 @@ fun requestDownload(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun downloadFile(request: DownloadManager.Request, context: Context): Long {
|
private fun downloadFile(request: DownloadManager.Request, context: Context): Long {
|
||||||
|
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
|
||||||
|
val downloadOverData = preferences.getBoolean("download_mobile_data", false)
|
||||||
|
val downloadWhenRoaming = preferences.getBoolean("download_roaming", false)
|
||||||
|
|
||||||
request.apply {
|
request.apply {
|
||||||
setAllowedOverMetered(false)
|
setAllowedOverMetered(downloadOverData)
|
||||||
setAllowedOverRoaming(false)
|
setAllowedOverRoaming(downloadWhenRoaming)
|
||||||
}
|
}
|
||||||
return context.getSystemService<DownloadManager>()!!.enqueue(request)
|
return context.getSystemService<DownloadManager>()!!.enqueue(request)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package dev.jdtech.jellyfin.viewmodels
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
|
||||||
import androidx.lifecycle.*
|
import androidx.lifecycle.*
|
||||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||||
import dev.jdtech.jellyfin.database.DownloadDatabaseDao
|
import dev.jdtech.jellyfin.database.DownloadDatabaseDao
|
||||||
|
@ -180,13 +179,8 @@ constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getDateString(item: BaseItemDto): String {
|
private fun getDateString(item: BaseItemDto): String {
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
val instant = item.premiereDate?.toInstant(ZoneOffset.UTC)
|
val instant = item.premiereDate?.toInstant(ZoneOffset.UTC)
|
||||||
val date = Date.from(instant)
|
val date = Date.from(instant)
|
||||||
DateFormat.getDateInstance(DateFormat.SHORT).format(date)
|
return DateFormat.getDateInstance(DateFormat.SHORT).format(date)
|
||||||
} else {
|
|
||||||
// TODO: Implement a way to get the year from LocalDateTime in Android < O
|
|
||||||
item.premiereDate.toString()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,7 +2,6 @@ package dev.jdtech.jellyfin.viewmodels
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Build
|
|
||||||
import androidx.lifecycle.LifecycleCoroutineScope
|
import androidx.lifecycle.LifecycleCoroutineScope
|
||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
|
@ -249,17 +248,11 @@ constructor(
|
||||||
return when (item.status) {
|
return when (item.status) {
|
||||||
"Continuing" -> dateString.plus(" - Present")
|
"Continuing" -> dateString.plus(" - Present")
|
||||||
"Ended" -> {
|
"Ended" -> {
|
||||||
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
return if (item.productionYear == item.endDate?.year) {
|
return if (item.productionYear == item.endDate?.year) {
|
||||||
dateString
|
dateString
|
||||||
} else {
|
} else {
|
||||||
dateString.plus(" - ${item.endDate?.year}")
|
dateString.plus(" - ${item.endDate?.year}")
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// TODO: Implement a way to get the year from LocalDateTime in Android < O
|
|
||||||
dateString
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else -> dateString
|
else -> dateString
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import org.jellyfin.sdk.model.api.DeviceOptions
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
@HiltViewModel
|
@HiltViewModel
|
||||||
internal class SettingsViewModel @Inject internal constructor(
|
internal class SettingsDeviceViewModel @Inject internal constructor(
|
||||||
private val api: JellyfinApi
|
private val api: JellyfinApi
|
||||||
) : ViewModel() {
|
) : ViewModel() {
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
<path
|
<path
|
||||||
android:pathData="M21,15v4a2,2 0,0 1,-2 2H5a2,2 0,0 1,-2 -2v-4"
|
android:pathData="M21,15v4a2,2 0,0 1,-2 2H5a2,2 0,0 1,-2 -2v-4"
|
||||||
android:strokeLineJoin="round"
|
android:strokeLineJoin="round"
|
||||||
|
|
49
app/src/main/res/drawable/ic_languages.xml
Normal file
49
app/src/main/res/drawable/ic_languages.xml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<path
|
||||||
|
android:pathData="M5,8l6,6"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="@android:color/white"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M4,14l6,-6 2,-3"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="@android:color/white"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M2,5h12"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="@android:color/white"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M7,2h1"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="@android:color/white"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M22,22l-5,-10 -5,10"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="@android:color/white"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M14,18h6"
|
||||||
|
android:strokeLineJoin="round"
|
||||||
|
android:strokeWidth="2"
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:strokeColor="@android:color/white"
|
||||||
|
android:strokeLineCap="round"/>
|
||||||
|
</vector>
|
|
@ -2,7 +2,8 @@
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
<path
|
<path
|
||||||
android:pathData="M5,3l14,9l-14,9l0,-18z"
|
android:pathData="M5,3l14,9l-14,9l0,-18z"
|
||||||
android:strokeLineJoin="round"
|
android:strokeLineJoin="round"
|
||||||
|
|
|
@ -2,26 +2,20 @@
|
||||||
android:width="24dp"
|
android:width="24dp"
|
||||||
android:height="24dp"
|
android:height="24dp"
|
||||||
android:viewportWidth="24"
|
android:viewportWidth="24"
|
||||||
android:viewportHeight="24">
|
android:viewportHeight="24"
|
||||||
|
android:tint="?attr/colorControlNormal">
|
||||||
<path
|
<path
|
||||||
android:pathData="M21,15v4a2,2 0,0 1,-2 2H5a2,2 0,0 1,-2 -2v-4"
|
android:pathData="M7,2L17,2A2,2 0,0 1,19 4L19,20A2,2 0,0 1,17 22L7,22A2,2 0,0 1,5 20L5,4A2,2 0,0 1,7 2z"
|
||||||
android:strokeLineJoin="round"
|
android:strokeLineJoin="round"
|
||||||
android:strokeWidth="2"
|
android:strokeWidth="2"
|
||||||
android:fillColor="#00000000"
|
android:fillColor="#00000000"
|
||||||
android:strokeColor="@color/red"
|
android:strokeColor="@android:color/white"
|
||||||
android:strokeLineCap="round"/>
|
android:strokeLineCap="round"/>
|
||||||
<path
|
<path
|
||||||
android:pathData="M7,10l5,5l5,-5"
|
android:pathData="M12,18h0.01"
|
||||||
android:strokeLineJoin="round"
|
android:strokeLineJoin="round"
|
||||||
android:strokeWidth="2"
|
android:strokeWidth="2"
|
||||||
android:fillColor="#00000000"
|
android:fillColor="#00000000"
|
||||||
android:strokeColor="@color/red"
|
android:strokeColor="@android:color/white"
|
||||||
android:strokeLineCap="round"/>
|
|
||||||
<path
|
|
||||||
android:pathData="M12,15L12,3"
|
|
||||||
android:strokeLineJoin="round"
|
|
||||||
android:strokeWidth="2"
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:strokeColor="@color/red"
|
|
||||||
android:strokeLineCap="round"/>
|
android:strokeLineCap="round"/>
|
||||||
</vector>
|
</vector>
|
|
@ -148,7 +148,8 @@
|
||||||
android:foreground="@drawable/ripple_background"
|
android:foreground="@drawable/ripple_background"
|
||||||
android:paddingHorizontal="24dp"
|
android:paddingHorizontal="24dp"
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:src="@drawable/ic_play" />
|
android:src="@drawable/ic_play"
|
||||||
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress_circular"
|
android:id="@+id/progress_circular"
|
||||||
|
@ -195,7 +196,8 @@
|
||||||
android:background="@drawable/button_accent_background"
|
android:background="@drawable/button_accent_background"
|
||||||
android:contentDescription="@string/download_button_description"
|
android:contentDescription="@string/download_button_description"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:src="@drawable/ic_download" />
|
android:src="@drawable/ic_download"
|
||||||
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress_download"
|
android:id="@+id/progress_download"
|
||||||
|
|
|
@ -132,7 +132,8 @@
|
||||||
android:foreground="@drawable/ripple_background"
|
android:foreground="@drawable/ripple_background"
|
||||||
android:paddingHorizontal="24dp"
|
android:paddingHorizontal="24dp"
|
||||||
android:paddingVertical="12dp"
|
android:paddingVertical="12dp"
|
||||||
android:src="@drawable/ic_play" />
|
android:src="@drawable/ic_play"
|
||||||
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress_circular"
|
android:id="@+id/progress_circular"
|
||||||
|
@ -184,7 +185,8 @@
|
||||||
android:contentDescription="@string/download_button_description"
|
android:contentDescription="@string/download_button_description"
|
||||||
android:padding="12dp"
|
android:padding="12dp"
|
||||||
android:src="@drawable/ic_download"
|
android:src="@drawable/ic_download"
|
||||||
android:visibility="gone" />
|
android:visibility="gone"
|
||||||
|
app:tint="@android:color/white" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/delete_button"
|
android:id="@+id/delete_button"
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
app:destination="@id/episodeBottomSheetFragment" />
|
app:destination="@id/episodeBottomSheetFragment" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_navigation_home_to_navigation_settings"
|
android:id="@+id/action_navigation_home_to_navigation_settings"
|
||||||
app:destination="@id/settingsFragment"
|
app:destination="@id/twoPaneSettingsFragment"
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
app:enterAnim="@anim/nav_default_enter_anim"
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
app:exitAnim="@anim/nav_default_exit_anim"
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||||
|
@ -59,16 +59,20 @@
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/settingsFragment"
|
android:id="@+id/twoPaneSettingsFragment"
|
||||||
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment"
|
android:name="dev.jdtech.jellyfin.fragments.TwoPaneSettingsFragment"
|
||||||
android:label="@string/title_settings">
|
android:label="@string/title_settings">
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_navigation_settings_to_serverSelectFragment2"
|
android:id="@+id/action_navigation_settings_to_serverSelectFragment"
|
||||||
app:destination="@id/serverSelectFragment" />
|
app:destination="@id/serverSelectFragment" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_settingsFragment_to_about_libraries"
|
android:id="@+id/action_settingsFragment_to_about_libraries"
|
||||||
app:destination="@id/about_libraries" />
|
app:destination="@id/about_libraries" />
|
||||||
</fragment>
|
</fragment>
|
||||||
|
<fragment
|
||||||
|
android:id="@+id/settingsFragment"
|
||||||
|
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment">
|
||||||
|
</fragment>
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/libraryFragment"
|
android:id="@+id/libraryFragment"
|
||||||
android:name="dev.jdtech.jellyfin.fragments.LibraryFragment"
|
android:name="dev.jdtech.jellyfin.fragments.LibraryFragment"
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
app:destination="@id/mediaDetailFragment" />
|
app:destination="@id/mediaDetailFragment" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_navigation_home_to_settings"
|
android:id="@+id/action_navigation_home_to_settings"
|
||||||
app:destination="@id/settingsFragment"
|
app:destination="@id/twoPaneSettingsFragment"
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
app:enterAnim="@anim/nav_default_enter_anim"
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
app:exitAnim="@anim/nav_default_exit_anim"
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
||||||
<fragment
|
<fragment
|
||||||
android:id="@+id/settingsFragment"
|
android:id="@+id/twoPaneSettingsFragment"
|
||||||
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment"
|
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment"
|
||||||
android:label="@string/title_settings">
|
android:label="@string/title_settings">
|
||||||
</fragment>
|
</fragment>
|
||||||
|
|
|
@ -57,6 +57,7 @@
|
||||||
<string name="initializing">Initializing…</string>
|
<string name="initializing">Initializing…</string>
|
||||||
<string name="settings_category_servers">Servers</string>
|
<string name="settings_category_servers">Servers</string>
|
||||||
<string name="settings_category_player">Player</string>
|
<string name="settings_category_player">Player</string>
|
||||||
|
<string name="settings_category_download">Downloads</string>
|
||||||
<string name="manage_servers">Manage servers</string>
|
<string name="manage_servers">Manage servers</string>
|
||||||
<string name="settings_category_appearance">Appearance</string>
|
<string name="settings_category_appearance">Appearance</string>
|
||||||
<string name="device_name">Device name</string>
|
<string name="device_name">Device name</string>
|
||||||
|
@ -80,6 +81,8 @@
|
||||||
<string name="select_subtile_track">Select subtitle track</string>
|
<string name="select_subtile_track">Select subtitle track</string>
|
||||||
<string name="select_playback_speed">Select playback speed</string>
|
<string name="select_playback_speed">Select playback speed</string>
|
||||||
<string name="mpv_player">MPV Player</string>
|
<string name="mpv_player">MPV Player</string>
|
||||||
|
<string name="download_mobile_data">Download using mobile data</string>
|
||||||
|
<string name="download_roaming">Download when roaming</string>
|
||||||
<string name="mpv_player_summary">Use the experimental MPV Player to play videos. MPV has support for more video, audio and subtitle codecs.</string>
|
<string name="mpv_player_summary">Use the experimental MPV Player to play videos. MPV has support for more video, audio and subtitle codecs.</string>
|
||||||
<string name="force_software_decoding">Force software decoding</string>
|
<string name="force_software_decoding">Force software decoding</string>
|
||||||
<string name="force_software_decoding_summary">Disable hardware decoding and use software decoding. Can be useful if hardware decoding gives weird artifacts.</string>
|
<string name="force_software_decoding_summary">Disable hardware decoding and use software decoding. Can be useful if hardware decoding gives weird artifacts.</string>
|
||||||
|
|
|
@ -1,84 +1,39 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/settings_category_language">
|
<Preference
|
||||||
|
app:fragment="dev.jdtech.jellyfin.fragments.SettingsLanguageFragment"
|
||||||
<ListPreference
|
app:title="@string/settings_category_language"
|
||||||
app:defaultValue="null"
|
app:icon="@drawable/ic_languages"/>
|
||||||
app:entries="@array/languages"
|
|
||||||
app:entryValues="@array/languages_values"
|
|
||||||
app:icon="@drawable/ic_speaker"
|
|
||||||
app:key="audio_language"
|
|
||||||
app:title="@string/settings_preferred_audio_language"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
|
|
||||||
<ListPreference
|
|
||||||
app:defaultValue="null"
|
|
||||||
app:entries="@array/languages"
|
|
||||||
app:entryValues="@array/languages_values"
|
|
||||||
app:icon="@drawable/ic_closed_caption"
|
|
||||||
app:key="subtitle_language"
|
|
||||||
app:title="@string/settings_preferred_subtitle_language"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/settings_category_servers">
|
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
app:icon="@drawable/ic_server"
|
app:icon="@drawable/ic_server"
|
||||||
app:key="switchServer"
|
app:key="switchServer"
|
||||||
app:title="@string/manage_servers" />
|
app:title="@string/manage_servers" />
|
||||||
|
|
||||||
</PreferenceCategory>
|
<Preference
|
||||||
|
app:fragment="dev.jdtech.jellyfin.fragments.SettingsAppearanceFragment"
|
||||||
<PreferenceCategory app:title="@string/settings_category_appearance">
|
|
||||||
<ListPreference
|
|
||||||
app:defaultValue="system"
|
|
||||||
app:entries="@array/themes"
|
|
||||||
app:entryValues="@array/themes_value"
|
|
||||||
app:icon="@drawable/ic_palette"
|
app:icon="@drawable/ic_palette"
|
||||||
app:key="theme"
|
app:title="@string/settings_category_appearance" />
|
||||||
app:title="@string/theme"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/settings_category_player">
|
<Preference
|
||||||
<SwitchPreference
|
app:fragment="dev.jdtech.jellyfin.fragments.SettingsDownloadsFragment"
|
||||||
app:key="mpv_player"
|
app:icon="@drawable/ic_download"
|
||||||
app:summary="@string/mpv_player_summary"
|
app:title="@string/settings_category_download"/>
|
||||||
app:title="@string/mpv_player" />
|
|
||||||
<SwitchPreference
|
|
||||||
app:dependency="mpv_player"
|
|
||||||
app:key="mpv_disable_hwdec"
|
|
||||||
app:summary="@string/force_software_decoding_summary"
|
|
||||||
app:title="@string/force_software_decoding" />
|
|
||||||
<SwitchPreference
|
|
||||||
app:key="display_extended_title"
|
|
||||||
app:summary="@string/display_extended_title_summary"
|
|
||||||
app:title="@string/display_extended_title" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/settings_category_device">
|
<Preference
|
||||||
<EditTextPreference
|
app:fragment="dev.jdtech.jellyfin.fragments.SettingsPlayerFragment"
|
||||||
app:key="deviceName"
|
app:icon="@drawable/ic_play"
|
||||||
app:title="@string/device_name"
|
app:title="@string/settings_category_player" />
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/settings_category_cache">
|
<Preference
|
||||||
<SwitchPreference
|
app:fragment="dev.jdtech.jellyfin.fragments.SettingsDeviceFragment"
|
||||||
app:key="use_image_cache"
|
app:title="@string/settings_category_device"
|
||||||
app:summary="@string/settings_use_cache_summary"
|
app:icon="@drawable/ic_smartphone" />
|
||||||
app:title="@string/settings_use_cache_title" />
|
|
||||||
<EditTextPreference
|
<Preference
|
||||||
app:defaultValue="250"
|
app:fragment="dev.jdtech.jellyfin.fragments.SettingsCacheFragment"
|
||||||
app:dependency="use_image_cache"
|
app:title="@string/settings_category_cache" />
|
||||||
app:dialogMessage="@string/settings_cache_size_message"
|
|
||||||
app:key="image_cache_size"
|
|
||||||
app:title="@string/settings_cache_size"
|
|
||||||
app:useSimpleSummaryProvider="true" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory app:title="@string/about">
|
<PreferenceCategory app:title="@string/about">
|
||||||
|
|
||||||
|
|
10
app/src/main/res/xml/fragment_settings_appearance.xml
Normal file
10
app/src/main/res/xml/fragment_settings_appearance.xml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<ListPreference
|
||||||
|
app:defaultValue="system"
|
||||||
|
app:entries="@array/themes"
|
||||||
|
app:entryValues="@array/themes_value"
|
||||||
|
app:key="theme"
|
||||||
|
app:title="@string/theme"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
</PreferenceScreen>
|
14
app/src/main/res/xml/fragment_settings_cache.xml
Normal file
14
app/src/main/res/xml/fragment_settings_cache.xml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<SwitchPreference
|
||||||
|
app:key="use_image_cache"
|
||||||
|
app:summary="@string/settings_use_cache_summary"
|
||||||
|
app:title="@string/settings_use_cache_title" />
|
||||||
|
<EditTextPreference
|
||||||
|
app:defaultValue="250"
|
||||||
|
app:dependency="use_image_cache"
|
||||||
|
app:dialogMessage="@string/settings_cache_size_message"
|
||||||
|
app:key="image_cache_size"
|
||||||
|
app:title="@string/settings_cache_size"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
</PreferenceScreen>
|
7
app/src/main/res/xml/fragment_settings_device.xml
Normal file
7
app/src/main/res/xml/fragment_settings_device.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<EditTextPreference
|
||||||
|
app:key="deviceName"
|
||||||
|
app:title="@string/device_name"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
</PreferenceScreen>
|
12
app/src/main/res/xml/fragment_settings_downloads.xml
Normal file
12
app/src/main/res/xml/fragment_settings_downloads.xml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<SwitchPreference
|
||||||
|
app:key="download_mobile_data"
|
||||||
|
app:title="@string/download_mobile_data"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
<SwitchPreference
|
||||||
|
app:key="download_roaming"
|
||||||
|
app:title="@string/download_roaming"
|
||||||
|
android:defaultValue="false" />
|
||||||
|
</PreferenceScreen>
|
20
app/src/main/res/xml/fragment_settings_language.xml
Normal file
20
app/src/main/res/xml/fragment_settings_language.xml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<ListPreference
|
||||||
|
app:defaultValue="null"
|
||||||
|
app:entries="@array/languages"
|
||||||
|
app:entryValues="@array/languages_values"
|
||||||
|
app:icon="@drawable/ic_speaker"
|
||||||
|
app:key="audio_language"
|
||||||
|
app:title="@string/settings_preferred_audio_language"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
|
||||||
|
<ListPreference
|
||||||
|
app:defaultValue="null"
|
||||||
|
app:entries="@array/languages"
|
||||||
|
app:entryValues="@array/languages_values"
|
||||||
|
app:icon="@drawable/ic_closed_caption"
|
||||||
|
app:key="subtitle_language"
|
||||||
|
app:title="@string/settings_preferred_subtitle_language"
|
||||||
|
app:useSimpleSummaryProvider="true" />
|
||||||
|
</PreferenceScreen>
|
16
app/src/main/res/xml/fragment_settings_player.xml
Normal file
16
app/src/main/res/xml/fragment_settings_player.xml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<SwitchPreference
|
||||||
|
app:key="mpv_player"
|
||||||
|
app:summary="@string/mpv_player_summary"
|
||||||
|
app:title="@string/mpv_player" />
|
||||||
|
<SwitchPreference
|
||||||
|
app:dependency="mpv_player"
|
||||||
|
app:key="mpv_disable_hwdec"
|
||||||
|
app:summary="@string/force_software_decoding_summary"
|
||||||
|
app:title="@string/force_software_decoding" />
|
||||||
|
<SwitchPreference
|
||||||
|
app:key="display_extended_title"
|
||||||
|
app:summary="@string/display_extended_title_summary"
|
||||||
|
app:title="@string/display_extended_title" />
|
||||||
|
</PreferenceScreen>
|
|
@ -8,7 +8,7 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("com.android.tools.build:gradle:7.1.1")
|
classpath("com.android.tools.build:gradle:7.1.2")
|
||||||
|
|
||||||
val kotlinVersion = "1.6.10"
|
val kotlinVersion = "1.6.10"
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
||||||
|
@ -16,13 +16,12 @@ buildscript {
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle.kts files
|
// in the individual module build.gradle.kts files
|
||||||
val navVersion = "2.4.1"
|
val navVersion = "2.4.1"
|
||||||
// NOTE: 2.5.0-alpha01 is used because 2.4.0 is incompatible with AGP 7.1
|
|
||||||
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$navVersion")
|
classpath("androidx.navigation:navigation-safe-args-gradle-plugin:$navVersion")
|
||||||
|
|
||||||
val hiltVersion = "2.40.5"
|
val hiltVersion = "2.41"
|
||||||
classpath("com.google.dagger:hilt-android-gradle-plugin:$hiltVersion")
|
classpath("com.google.dagger:hilt-android-gradle-plugin:$hiltVersion")
|
||||||
|
|
||||||
val aboutLibrariesVersion = "8.9.4"
|
val aboutLibrariesVersion = "10.0.0"
|
||||||
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$aboutLibrariesVersion")
|
classpath("com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$aboutLibrariesVersion")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
#Sat May 29 10:38:39 CEST 2021
|
#Tue Mar 08 18:30:46 CET 2022
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|
Loading…
Reference in a new issue