Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to Android subtitle settings in client settings #905

Merged
merged 2 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions app/src/main/java/org/jellyfin/mobile/settings/SettingsFragment.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.jellyfin.mobile.settings

import android.content.Intent
import android.os.Bundle
import android.provider.Settings
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Expand All @@ -11,7 +13,9 @@ import de.Maxr1998.modernpreferences.PreferencesAdapter
import de.Maxr1998.modernpreferences.helpers.categoryHeader
import de.Maxr1998.modernpreferences.helpers.checkBox
import de.Maxr1998.modernpreferences.helpers.defaultOnCheckedChange
import de.Maxr1998.modernpreferences.helpers.defaultOnClick
import de.Maxr1998.modernpreferences.helpers.defaultOnSelectionChange
import de.Maxr1998.modernpreferences.helpers.pref
import de.Maxr1998.modernpreferences.helpers.screen
import de.Maxr1998.modernpreferences.helpers.singleChoice
import de.Maxr1998.modernpreferences.preferences.CheckBoxPreference
Expand Down Expand Up @@ -164,6 +168,16 @@ class SettingsFragment : Fragment() {
titleRes = R.string.external_player_app
enabled = appPreferences.videoPlayerType == VideoPlayerType.EXTERNAL_PLAYER
}
val subtitleSettingsIntent = Intent(Settings.ACTION_CAPTIONING_SETTINGS)
if (subtitleSettingsIntent.resolveActivity(requireContext().packageManager) != null) {
pref(Constants.PREF_SUBTITLE_STYLE) {
titleRes = R.string.pref_subtitle_style
summaryRes = R.string.pref_subtitle_style_summary
defaultOnClick {
startActivity(subtitleSettingsIntent)
}
}
}
categoryHeader(PREF_CATEGORY_DOWNLOADS) {
titleRes = R.string.pref_category_downloads
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/org/jellyfin/mobile/utils/Constants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ object Constants {
const val PREF_EXOPLAYER_ALLOW_BACKGROUND_AUDIO = "pref_exoplayer_allow_background_audio"
const val PREF_EXOPLAYER_DIRECT_PLAY_ASS = "pref_exoplayer_direct_play_ass"
const val PREF_EXTERNAL_PLAYER_APP = "pref_external_player_app"
const val PREF_SUBTITLE_STYLE = "pref_subtitle_style"
const val PREF_DOWNLOAD_LOCATION = "pref_download_location"

// InputManager commands
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@
<string name="external_player_system_default">System default</string>
<string name="external_player_system_default_description">Let the system handle the player choice, some players may not be fully compatible.</string>

<string name="pref_subtitle_style">Customize subtitle style</string>
<string name="pref_subtitle_style_summary">You can change the subtitle style in the Android settings</string>

<string name="pref_category_downloads">Downloads</string>
<string name="pref_download_location">Download location</string>
</resources>