Redesign settings to two pane layout (#90)

* Redesign settings to two pane layout

* Add downloads settings

* Suppress unused settings fragments warnings

* Fix download icon in other places

Also removes the filled download drawable
This commit is contained in:
Jarne Demeulemeester 2022-02-19 17:33:58 +01:00 committed by GitHub
parent 786e4d21a0
commit ebdb00f311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 338 additions and 164 deletions

View file

@ -54,7 +54,7 @@ class MainActivity : AppCompatActivity() {
navController.addOnDestinationChangedListener { _, destination, _ ->
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
}
if (destination.id == R.id.about_libraries_dest) binding.mainToolbar.title = getString(R.string.app_info)

View file

@ -1,5 +1,6 @@
package dev.jdtech.jellyfin.fragments
import android.content.res.ColorStateList
import android.os.Bundle
import android.util.TypedValue
import android.view.LayoutInflater
@ -108,9 +109,12 @@ class EpisodeBottomSheetFragment : BottomSheetDialogFragment() {
binding.downloadButton.setOnClickListener {
binding.downloadButton.isEnabled = false
viewModel.loadDownloadRequestItem(episodeId)
binding.downloadButton.setImageResource(R.drawable.ic_download_filled)
//binding.downloadButton.setImageResource(android.R.color.transparent)
//binding.progressDownload.isVisible = true
binding.downloadButton.imageTintList = ColorStateList.valueOf(
resources.getColor(
R.color.red,
requireActivity().theme
)
)
}
viewModel.loadEpisode(episodeId)
@ -174,12 +178,12 @@ class EpisodeBottomSheetFragment : BottomSheetDialogFragment() {
binding.downloadButtonWrapper.isVisible = true
binding.downloadButton.isEnabled = !downloaded
// Download icon
val downloadDrawable = when (downloaded) {
true -> R.drawable.ic_download_filled
false -> R.drawable.ic_download
}
binding.downloadButton.setImageResource(downloadDrawable)
if (downloaded) binding.downloadButton.imageTintList = ColorStateList.valueOf(
resources.getColor(
R.color.red,
requireActivity().theme
)
)
}
false -> {
binding.downloadButtonWrapper.isVisible = false

View file

@ -1,6 +1,7 @@
package dev.jdtech.jellyfin.fragments
import android.content.Intent
import android.content.res.ColorStateList
import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
@ -75,7 +76,7 @@ class MediaInfoFragment : Fragment() {
}
}
if(args.itemType != "Movie") {
if (args.itemType != "Movie") {
binding.downloadButton.visibility = View.GONE
}
@ -112,7 +113,11 @@ class MediaInfoFragment : Fragment() {
if (uuid != null) {
navigateToPersonDetail(uuid)
} 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.isEnabled = false
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 {
@ -216,12 +226,12 @@ class MediaInfoFragment : Fragment() {
binding.downloadButton.isVisible = true
binding.downloadButton.isEnabled = !downloaded
// Download icon
val downloadDrawable = when (downloaded) {
true -> R.drawable.ic_download_filled
false -> R.drawable.ic_download
}
binding.downloadButton.setImageResource(downloadDrawable)
if (downloaded) binding.downloadButton.imageTintList = ColorStateList.valueOf(
resources.getColor(
R.color.red,
requireActivity().theme
)
)
}
false -> {
binding.downloadButton.isVisible = false
@ -251,7 +261,12 @@ class MediaInfoFragment : Fragment() {
binding.writers.text = writersString
binding.description.text = item.overview
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()
val seasonsAdapter = binding.seasonsRecyclerView.adapter as ViewItemListAdapter
seasonsAdapter.submitList(seasons)

View file

@ -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
}
}
}

View file

@ -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
}
}
}

View file

@ -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
}
}
}

View file

@ -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)
}
}

View file

@ -3,40 +3,17 @@ package dev.jdtech.jellyfin.fragments
import android.content.Intent
import android.net.Uri
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.preference.EditTextPreference
import androidx.preference.ListPreference
import androidx.preference.Preference
import androidx.preference.PreferenceFragmentCompat
import dagger.hilt.android.AndroidEntryPoint
import dev.jdtech.jellyfin.R
import dev.jdtech.jellyfin.viewmodels.SettingsViewModel
@AndroidEntryPoint
class SettingsFragment: PreferenceFragmentCompat() {
private val viewModel: SettingsViewModel by viewModels()
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
setPreferencesFromResource(R.xml.fragment_settings, rootKey)
findPreference<Preference>("switchServer")?.setOnPreferenceClickListener {
findNavController().navigate(SettingsFragmentDirections.actionNavigationSettingsToServerSelectFragment2())
true
}
findPreference<ListPreference>("theme")?.setOnPreferenceChangeListener { _, newValue ->
when (newValue) {
"system" -> setDefaultNightMode(MODE_NIGHT_FOLLOW_SYSTEM)
"light" -> setDefaultNightMode(MODE_NIGHT_NO)
"dark" -> setDefaultNightMode(MODE_NIGHT_YES)
}
findNavController().navigate(TwoPaneSettingsFragmentDirections.actionNavigationSettingsToServerSelectFragment())
true
}
@ -50,16 +27,7 @@ class SettingsFragment: PreferenceFragmentCompat() {
}
findPreference<Preference>("appInfo")?.setOnPreferenceClickListener {
findNavController().navigate(SettingsFragmentDirections.actionSettingsFragmentToAboutLibraries())
true
}
findPreference<EditTextPreference>("image_cache_size")?.setOnBindEditTextListener { editText ->
editText.inputType = InputType.TYPE_CLASS_NUMBER
}
findPreference<EditTextPreference>("deviceName")?.setOnPreferenceChangeListener { _, name ->
viewModel.updateDeviceName(name.toString())
findNavController().navigate(TwoPaneSettingsFragmentDirections.actionSettingsFragmentToAboutLibraries())
true
}
}

View file

@ -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)
}
}

View file

@ -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)
}
}

View file

@ -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()
}
}

View file

@ -10,7 +10,7 @@ import org.jellyfin.sdk.model.api.DeviceOptions
import javax.inject.Inject
@HiltViewModel
internal class SettingsViewModel @Inject internal constructor(
internal class SettingsDeviceViewModel @Inject internal constructor(
private val api: JellyfinApi
) : ViewModel() {

View file

@ -2,7 +2,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:pathData="M21,15v4a2,2 0,0 1,-2 2H5a2,2 0,0 1,-2 -2v-4"
android:strokeLineJoin="round"

View 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>

View file

@ -2,7 +2,8 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:pathData="M5,3l14,9l-14,9l0,-18z"
android:strokeLineJoin="round"

View file

@ -2,26 +2,20 @@
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<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:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="@color/red"
android:strokeColor="@android:color/white"
android:strokeLineCap="round"/>
<path
android:pathData="M7,10l5,5l5,-5"
android:pathData="M12,18h0.01"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="@color/red"
android:strokeLineCap="round"/>
<path
android:pathData="M12,15L12,3"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="@color/red"
android:strokeColor="@android:color/white"
android:strokeLineCap="round"/>
</vector>

View file

@ -148,7 +148,8 @@
android:foreground="@drawable/ripple_background"
android:paddingHorizontal="24dp"
android:paddingVertical="12dp"
android:src="@drawable/ic_play" />
android:src="@drawable/ic_play"
app:tint="@android:color/white" />
<ProgressBar
android:id="@+id/progress_circular"
@ -195,7 +196,8 @@
android:background="@drawable/button_accent_background"
android:contentDescription="@string/download_button_description"
android:padding="12dp"
android:src="@drawable/ic_download" />
android:src="@drawable/ic_download"
app:tint="@android:color/white" />
<ProgressBar
android:id="@+id/progress_download"

View file

@ -132,7 +132,8 @@
android:foreground="@drawable/ripple_background"
android:paddingHorizontal="24dp"
android:paddingVertical="12dp"
android:src="@drawable/ic_play" />
android:src="@drawable/ic_play"
app:tint="@android:color/white" />
<ProgressBar
android:id="@+id/progress_circular"
@ -184,7 +185,8 @@
android:contentDescription="@string/download_button_description"
android:padding="12dp"
android:src="@drawable/ic_download"
android:visibility="gone" />
android:visibility="gone"
app:tint="@android:color/white" />
<ImageButton
android:id="@+id/delete_button"

View file

@ -29,7 +29,7 @@
app:destination="@id/episodeBottomSheetFragment" />
<action
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:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
@ -59,16 +59,20 @@
</fragment>
<fragment
android:id="@+id/settingsFragment"
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment"
android:id="@+id/twoPaneSettingsFragment"
android:name="dev.jdtech.jellyfin.fragments.TwoPaneSettingsFragment"
android:label="@string/title_settings">
<action
android:id="@+id/action_navigation_settings_to_serverSelectFragment2"
android:id="@+id/action_navigation_settings_to_serverSelectFragment"
app:destination="@id/serverSelectFragment" />
<action
android:id="@+id/action_settingsFragment_to_about_libraries"
app:destination="@id/about_libraries" />
</fragment>
<fragment
android:id="@+id/settingsFragment"
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment">
</fragment>
<fragment
android:id="@+id/libraryFragment"
android:name="dev.jdtech.jellyfin.fragments.LibraryFragment"

View file

@ -15,7 +15,7 @@
app:destination="@id/mediaDetailFragment" />
<action
android:id="@+id/action_navigation_home_to_settings"
app:destination="@id/settingsFragment"
app:destination="@id/twoPaneSettingsFragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
@ -76,7 +76,7 @@
</fragment>
<fragment
android:id="@+id/settingsFragment"
android:id="@+id/twoPaneSettingsFragment"
android:name="dev.jdtech.jellyfin.fragments.SettingsFragment"
android:label="@string/title_settings">
</fragment>

View file

@ -1,96 +1,39 @@
<?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">
<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"
app:title="@string/settings_category_language"
app:icon="@drawable/ic_languages"/>
<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" />
<Preference
app:icon="@drawable/ic_server"
app:key="switchServer"
app:title="@string/manage_servers" />
<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" />
<Preference
app:fragment="dev.jdtech.jellyfin.fragments.SettingsAppearanceFragment"
app:icon="@drawable/ic_palette"
app:title="@string/settings_category_appearance" />
</PreferenceCategory>
<Preference
app:fragment="dev.jdtech.jellyfin.fragments.SettingsDownloadsFragment"
app:icon="@drawable/ic_download"
app:title="@string/settings_category_download"/>
<PreferenceCategory app:title="@string/settings_category_servers">
<Preference
app:fragment="dev.jdtech.jellyfin.fragments.SettingsPlayerFragment"
app:icon="@drawable/ic_play"
app:title="@string/settings_category_player" />
<Preference
app:icon="@drawable/ic_server"
app:key="switchServer"
app:title="@string/manage_servers" />
<Preference
app:fragment="dev.jdtech.jellyfin.fragments.SettingsDeviceFragment"
app:title="@string/settings_category_device"
app:icon="@drawable/ic_smartphone" />
</PreferenceCategory>
<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:key="theme"
app:title="@string/theme"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_category_download">
<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" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_category_player">
<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" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_category_device">
<EditTextPreference
app:key="deviceName"
app:title="@string/device_name"
app:useSimpleSummaryProvider="true" />
</PreferenceCategory>
<PreferenceCategory app:title="@string/settings_category_cache">
<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" />
</PreferenceCategory>
<Preference
app:fragment="dev.jdtech.jellyfin.fragments.SettingsCacheFragment"
app:title="@string/settings_category_cache" />
<PreferenceCategory app:title="@string/about">

View 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>

View 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>

View 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>

View 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>

View 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>

View 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>