feat(subtitles): color picker. Clear data after this. (#547)
* feat(subtitle): custom color picker * can't have two of the same buttons smh * It was a misinput * Too much
This commit is contained in:
parent
01a64c25fd
commit
6f1bb10dec
5 changed files with 286 additions and 413 deletions
|
@ -327,36 +327,10 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setupSubFormatting(playerView: PlayerView) {
|
private fun setupSubFormatting(playerView: PlayerView) {
|
||||||
val primaryColor = when (PrefManager.getVal<Int>(PrefName.PrimaryColor)) {
|
val primaryColor = PrefManager.getVal<Int>(PrefName.PrimaryColor)
|
||||||
0 -> Color.BLACK
|
|
||||||
1 -> Color.DKGRAY
|
val secondaryColor = PrefManager.getVal<Int>(PrefName.SecondaryColor)
|
||||||
2 -> Color.GRAY
|
|
||||||
3 -> Color.LTGRAY
|
|
||||||
4 -> Color.WHITE
|
|
||||||
5 -> Color.RED
|
|
||||||
6 -> Color.YELLOW
|
|
||||||
7 -> Color.GREEN
|
|
||||||
8 -> Color.CYAN
|
|
||||||
9 -> Color.BLUE
|
|
||||||
10 -> Color.MAGENTA
|
|
||||||
11 -> Color.TRANSPARENT
|
|
||||||
else -> Color.WHITE
|
|
||||||
}
|
|
||||||
val secondaryColor = when (PrefManager.getVal<Int>(PrefName.SecondaryColor)) {
|
|
||||||
0 -> Color.BLACK
|
|
||||||
1 -> Color.DKGRAY
|
|
||||||
2 -> Color.GRAY
|
|
||||||
3 -> Color.LTGRAY
|
|
||||||
4 -> Color.WHITE
|
|
||||||
5 -> Color.RED
|
|
||||||
6 -> Color.YELLOW
|
|
||||||
7 -> Color.GREEN
|
|
||||||
8 -> Color.CYAN
|
|
||||||
9 -> Color.BLUE
|
|
||||||
10 -> Color.MAGENTA
|
|
||||||
11 -> Color.TRANSPARENT
|
|
||||||
else -> Color.BLACK
|
|
||||||
}
|
|
||||||
val outline = when (PrefManager.getVal<Int>(PrefName.Outline)) {
|
val outline = when (PrefManager.getVal<Int>(PrefName.Outline)) {
|
||||||
0 -> EDGE_TYPE_OUTLINE // Normal
|
0 -> EDGE_TYPE_OUTLINE // Normal
|
||||||
1 -> EDGE_TYPE_DEPRESSED // Shine
|
1 -> EDGE_TYPE_DEPRESSED // Shine
|
||||||
|
@ -364,36 +338,11 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
3 -> EDGE_TYPE_NONE // No outline
|
3 -> EDGE_TYPE_NONE // No outline
|
||||||
else -> EDGE_TYPE_OUTLINE // Normal
|
else -> EDGE_TYPE_OUTLINE // Normal
|
||||||
}
|
}
|
||||||
val subBackground = when (PrefManager.getVal<Int>(PrefName.SubBackground)) {
|
|
||||||
0 -> Color.TRANSPARENT
|
val subBackground = PrefManager.getVal<Int>(PrefName.SubBackground)
|
||||||
1 -> Color.BLACK
|
|
||||||
2 -> Color.DKGRAY
|
val subWindow = PrefManager.getVal<Int>(PrefName.SubWindow)
|
||||||
3 -> Color.GRAY
|
|
||||||
4 -> Color.LTGRAY
|
|
||||||
5 -> Color.WHITE
|
|
||||||
6 -> Color.RED
|
|
||||||
7 -> Color.YELLOW
|
|
||||||
8 -> Color.GREEN
|
|
||||||
9 -> Color.CYAN
|
|
||||||
10 -> Color.BLUE
|
|
||||||
11 -> Color.MAGENTA
|
|
||||||
else -> Color.TRANSPARENT
|
|
||||||
}
|
|
||||||
val subWindow = when (PrefManager.getVal<Int>(PrefName.SubWindow)) {
|
|
||||||
0 -> Color.TRANSPARENT
|
|
||||||
1 -> Color.BLACK
|
|
||||||
2 -> Color.DKGRAY
|
|
||||||
3 -> Color.GRAY
|
|
||||||
4 -> Color.LTGRAY
|
|
||||||
5 -> Color.WHITE
|
|
||||||
6 -> Color.RED
|
|
||||||
7 -> Color.YELLOW
|
|
||||||
8 -> Color.GREEN
|
|
||||||
9 -> Color.CYAN
|
|
||||||
10 -> Color.BLUE
|
|
||||||
11 -> Color.MAGENTA
|
|
||||||
else -> Color.TRANSPARENT
|
|
||||||
}
|
|
||||||
val font = when (PrefManager.getVal<Int>(PrefName.Font)) {
|
val font = when (PrefManager.getVal<Int>(PrefName.Font)) {
|
||||||
0 -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
|
0 -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
|
||||||
1 -> ResourcesCompat.getFont(this, R.font.poppins_bold)
|
1 -> ResourcesCompat.getFont(this, R.font.poppins_bold)
|
||||||
|
@ -432,37 +381,15 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun applySubtitleStyles(textView: Xubtitle) {
|
private fun applySubtitleStyles(textView: Xubtitle) {
|
||||||
val primaryColor = when (PrefManager.getVal<Int>(PrefName.PrimaryColor)) {
|
val primaryColor = PrefManager.getVal<Int>(PrefName.PrimaryColor)
|
||||||
0 -> Color.BLACK
|
|
||||||
1 -> Color.DKGRAY
|
|
||||||
2 -> Color.GRAY
|
|
||||||
3 -> Color.LTGRAY
|
|
||||||
4 -> Color.WHITE
|
|
||||||
5 -> Color.RED
|
|
||||||
6 -> Color.YELLOW
|
|
||||||
7 -> Color.GREEN
|
|
||||||
8 -> Color.CYAN
|
|
||||||
9 -> Color.BLUE
|
|
||||||
10 -> Color.MAGENTA
|
|
||||||
11 -> Color.TRANSPARENT
|
|
||||||
else -> Color.WHITE
|
|
||||||
}
|
|
||||||
|
|
||||||
val subBackground = when (PrefManager.getVal<Int>(PrefName.SubBackground)) {
|
val subBackground = PrefManager.getVal<Int>(PrefName.SubBackground)
|
||||||
0 -> Color.TRANSPARENT
|
|
||||||
1 -> Color.BLACK
|
val secondaryColor = PrefManager.getVal<Int>(PrefName.SecondaryColor)
|
||||||
2 -> Color.DKGRAY
|
|
||||||
3 -> Color.GRAY
|
val subStroke = PrefManager.getVal<Float>(PrefName.SubStroke)
|
||||||
4 -> Color.LTGRAY
|
|
||||||
5 -> Color.WHITE
|
val fontSize = PrefManager.getVal<Int>(PrefName.FontSize).toFloat()
|
||||||
6 -> Color.RED
|
|
||||||
7 -> Color.YELLOW
|
|
||||||
8 -> Color.GREEN
|
|
||||||
9 -> Color.CYAN
|
|
||||||
10 -> Color.BLUE
|
|
||||||
11 -> Color.MAGENTA
|
|
||||||
else -> Color.TRANSPARENT
|
|
||||||
}
|
|
||||||
|
|
||||||
val font = when (PrefManager.getVal<Int>(PrefName.Font)) {
|
val font = when (PrefManager.getVal<Int>(PrefName.Font)) {
|
||||||
0 -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
|
0 -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
|
||||||
|
@ -475,31 +402,11 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
else -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
|
else -> ResourcesCompat.getFont(this, R.font.poppins_semi_bold)
|
||||||
}
|
}
|
||||||
|
|
||||||
val fontSize = PrefManager.getVal<Int>(PrefName.FontSize).toFloat()
|
|
||||||
|
|
||||||
textView.setBackgroundColor(subBackground)
|
textView.setBackgroundColor(subBackground)
|
||||||
textView.setTextColor(primaryColor)
|
textView.setTextColor(primaryColor)
|
||||||
textView.typeface = font
|
textView.typeface = font
|
||||||
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize)
|
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, fontSize)
|
||||||
|
|
||||||
val secondaryColor = when (PrefManager.getVal<Int>(PrefName.SecondaryColor)) {
|
|
||||||
0 -> Color.BLACK
|
|
||||||
1 -> Color.DKGRAY
|
|
||||||
2 -> Color.GRAY
|
|
||||||
3 -> Color.LTGRAY
|
|
||||||
4 -> Color.WHITE
|
|
||||||
5 -> Color.RED
|
|
||||||
6 -> Color.YELLOW
|
|
||||||
7 -> Color.GREEN
|
|
||||||
8 -> Color.CYAN
|
|
||||||
9 -> Color.BLUE
|
|
||||||
10 -> Color.MAGENTA
|
|
||||||
11 -> Color.TRANSPARENT
|
|
||||||
else -> Color.BLACK
|
|
||||||
}
|
|
||||||
|
|
||||||
val subStroke = PrefManager.getVal<Float>(PrefName.SubStroke)
|
|
||||||
|
|
||||||
textView.apply {
|
textView.apply {
|
||||||
when (PrefManager.getVal<Int>(PrefName.Outline)) {
|
when (PrefManager.getVal<Int>(PrefName.Outline)) {
|
||||||
0 -> applyOutline(secondaryColor, subStroke)
|
0 -> applyOutline(secondaryColor, subStroke)
|
||||||
|
@ -516,7 +423,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
||||||
false -> 0f
|
false -> 0f
|
||||||
}
|
}
|
||||||
|
|
||||||
val textElevation = PrefManager.getVal<Float>(PrefName.SubBottomMargin) / 30 * resources.displayMetrics.heightPixels
|
val textElevation = PrefManager.getVal<Float>(PrefName.SubBottomMargin) / 50 * resources.displayMetrics.heightPixels
|
||||||
textView.translationY = -textElevation
|
textView.translationY = -textElevation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package ani.dantotsu.settings
|
package ani.dantotsu.settings
|
||||||
|
|
||||||
import android.app.AlertDialog
|
|
||||||
import android.app.Dialog
|
|
||||||
import android.content.res.Resources
|
import android.content.res.Resources
|
||||||
import android.graphics.Color
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
|
@ -31,9 +28,19 @@ import ani.dantotsu.themes.ThemeManager
|
||||||
import ani.dantotsu.toast
|
import ani.dantotsu.toast
|
||||||
import ani.dantotsu.util.customAlertDialog
|
import ani.dantotsu.util.customAlertDialog
|
||||||
import com.google.android.material.slider.Slider.OnChangeListener
|
import com.google.android.material.slider.Slider.OnChangeListener
|
||||||
|
import eltos.simpledialogfragment.SimpleDialog
|
||||||
|
import eltos.simpledialogfragment.color.SimpleColorWheelDialog
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
class PlayerSettingsActivity : AppCompatActivity() {
|
class PlayerSettingsActivity :
|
||||||
|
AppCompatActivity(),
|
||||||
|
SimpleDialog.OnDialogResultListener {
|
||||||
|
interface ColorPickerCallback {
|
||||||
|
fun onColorSelected(color: Int)
|
||||||
|
}
|
||||||
|
|
||||||
|
private var colorPickerCallback: ColorPickerCallback? = null
|
||||||
|
|
||||||
lateinit var binding: ActivityPlayerSettingsBinding
|
lateinit var binding: ActivityPlayerSettingsBinding
|
||||||
private val player = "player_settings"
|
private val player = "player_settings"
|
||||||
|
|
||||||
|
@ -41,9 +48,12 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
var subtitle: Subtitle? = null
|
var subtitle: Subtitle? = null
|
||||||
|
|
||||||
private val Int.toSP
|
private val Int.toSP
|
||||||
get() = TypedValue.applyDimension(
|
get() =
|
||||||
TypedValue.COMPLEX_UNIT_SP, this.toFloat(), Resources.getSystem().displayMetrics
|
TypedValue.applyDimension(
|
||||||
)
|
TypedValue.COMPLEX_UNIT_SP,
|
||||||
|
this.toFloat(),
|
||||||
|
Resources.getSystem().displayMetrics,
|
||||||
|
)
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -70,12 +80,11 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
bottomMargin = navBarHeight
|
bottomMargin = navBarHeight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
binding.playerSettingsBack.setOnClickListener {
|
binding.playerSettingsBack.setOnClickListener {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
//Video
|
// Video
|
||||||
|
|
||||||
val speeds =
|
val speeds =
|
||||||
arrayOf(
|
arrayOf(
|
||||||
|
@ -91,7 +100,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
1.5f,
|
1.5f,
|
||||||
1.66f,
|
1.66f,
|
||||||
1.75f,
|
1.75f,
|
||||||
2f
|
2f,
|
||||||
)
|
)
|
||||||
val cursedSpeeds = arrayOf(1f, 1.25f, 1.5f, 1.75f, 2f, 2.5f, 3f, 4f, 5f, 10f, 25f, 50f)
|
val cursedSpeeds = arrayOf(1f, 1.25f, 1.5f, 1.75f, 2f, 2.5f, 3f, 4f, 5f, 10f, 25f, 50f)
|
||||||
var curSpeedArr = if (PrefManager.getVal(PrefName.CursedSpeeds)) cursedSpeeds else speeds
|
var curSpeedArr = if (PrefManager.getVal(PrefName.CursedSpeeds)) cursedSpeeds else speeds
|
||||||
|
@ -99,14 +108,14 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
binding.playerSettingsSpeed.text =
|
binding.playerSettingsSpeed.text =
|
||||||
getString(
|
getString(
|
||||||
R.string.default_playback_speed,
|
R.string.default_playback_speed,
|
||||||
speedsName[PrefManager.getVal(PrefName.DefaultSpeed)]
|
speedsName[PrefManager.getVal(PrefName.DefaultSpeed)],
|
||||||
)
|
)
|
||||||
binding.playerSettingsSpeed.setOnClickListener {
|
binding.playerSettingsSpeed.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
customAlertDialog().apply {
|
||||||
setTitle(getString(R.string.default_speed))
|
setTitle(getString(R.string.default_speed))
|
||||||
singleChoiceItems(
|
singleChoiceItems(
|
||||||
speedsName,
|
speedsName,
|
||||||
PrefManager.getVal(PrefName.DefaultSpeed)
|
PrefManager.getVal(PrefName.DefaultSpeed),
|
||||||
) { i ->
|
) { i ->
|
||||||
PrefManager.setVal(PrefName.DefaultSpeed, i)
|
PrefManager.setVal(PrefName.DefaultSpeed, i)
|
||||||
binding.playerSettingsSpeed.text =
|
binding.playerSettingsSpeed.text =
|
||||||
|
@ -126,11 +135,10 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
binding.playerSettingsSpeed.text =
|
binding.playerSettingsSpeed.text =
|
||||||
getString(
|
getString(
|
||||||
R.string.default_playback_speed,
|
R.string.default_playback_speed,
|
||||||
speedsName[PrefManager.getVal(PrefName.DefaultSpeed)]
|
speedsName[PrefManager.getVal(PrefName.DefaultSpeed)],
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Time Stamp
|
// Time Stamp
|
||||||
binding.playerSettingsTimeStamps.isChecked = PrefManager.getVal(PrefName.TimeStampsEnabled)
|
binding.playerSettingsTimeStamps.isChecked = PrefManager.getVal(PrefName.TimeStampsEnabled)
|
||||||
binding.playerSettingsTimeStamps.setOnCheckedChangeListener { _, isChecked ->
|
binding.playerSettingsTimeStamps.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
@ -182,7 +190,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
PrefManager.setVal(PrefName.AutoSkipFiller, isChecked)
|
PrefManager.setVal(PrefName.AutoSkipFiller, isChecked)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update Progress
|
// Update Progress
|
||||||
binding.playerSettingsAskUpdateProgress.isChecked =
|
binding.playerSettingsAskUpdateProgress.isChecked =
|
||||||
PrefManager.getVal(PrefName.AskIndividualPlayer)
|
PrefManager.getVal(PrefName.AskIndividualPlayer)
|
||||||
binding.playerSettingsAskUpdateProgress.setOnCheckedChangeListener { _, isChecked ->
|
binding.playerSettingsAskUpdateProgress.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
@ -208,7 +216,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
PrefManager.setVal(PrefName.WatchPercentage, value / 100)
|
PrefManager.setVal(PrefName.WatchPercentage, value / 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Behaviour
|
// Behaviour
|
||||||
binding.playerSettingsAlwaysContinue.isChecked = PrefManager.getVal(PrefName.AlwaysContinue)
|
binding.playerSettingsAlwaysContinue.isChecked = PrefManager.getVal(PrefName.AlwaysContinue)
|
||||||
binding.playerSettingsAlwaysContinue.setOnCheckedChangeListener { _, isChecked ->
|
binding.playerSettingsAlwaysContinue.setOnCheckedChangeListener { _, isChecked ->
|
||||||
PrefManager.setVal(PrefName.AlwaysContinue, isChecked)
|
PrefManager.setVal(PrefName.AlwaysContinue, isChecked)
|
||||||
|
@ -245,13 +253,16 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
binding.exoSkipTime.addTextChangedListener {
|
binding.exoSkipTime.addTextChangedListener {
|
||||||
val time = binding.exoSkipTime.text.toString().toIntOrNull()
|
val time =
|
||||||
|
binding.exoSkipTime.text
|
||||||
|
.toString()
|
||||||
|
.toIntOrNull()
|
||||||
if (time != null) {
|
if (time != null) {
|
||||||
PrefManager.setVal(PrefName.SkipTime, time)
|
PrefManager.setVal(PrefName.SkipTime, time)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Other
|
// Other
|
||||||
binding.playerSettingsPiP.apply {
|
binding.playerSettingsPiP.apply {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
visibility = View.VISIBLE
|
visibility = View.VISIBLE
|
||||||
|
@ -259,7 +270,9 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
setOnCheckedChangeListener { _, isChecked ->
|
setOnCheckedChangeListener { _, isChecked ->
|
||||||
PrefManager.setVal(PrefName.Pip, isChecked)
|
PrefManager.setVal(PrefName.Pip, isChecked)
|
||||||
}
|
}
|
||||||
} else visibility = View.GONE
|
} else {
|
||||||
|
visibility = View.GONE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.playerSettingsCast.isChecked = PrefManager.getVal(PrefName.Cast)
|
binding.playerSettingsCast.isChecked = PrefManager.getVal(PrefName.Cast)
|
||||||
|
@ -288,7 +301,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
setTitle(getString(R.string.default_resize_mode))
|
setTitle(getString(R.string.default_resize_mode))
|
||||||
singleChoiceItems(
|
singleChoiceItems(
|
||||||
resizeModes,
|
resizeModes,
|
||||||
PrefManager.getVal<Int>(PrefName.Resize)
|
PrefManager.getVal<Int>(PrefName.Resize),
|
||||||
) { count ->
|
) { count ->
|
||||||
PrefManager.setVal(PrefName.Resize, count)
|
PrefManager.setVal(PrefName.Resize, count)
|
||||||
}
|
}
|
||||||
|
@ -310,13 +323,14 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
binding.subtitleFontSizeText,
|
binding.subtitleFontSizeText,
|
||||||
binding.subtitleFontSize,
|
binding.subtitleFontSize,
|
||||||
binding.videoSubLanguage,
|
binding.videoSubLanguage,
|
||||||
binding.subTextSwitch
|
binding.subTextSwitch,
|
||||||
).forEach {
|
).forEach {
|
||||||
it.isEnabled = isChecked
|
it.isEnabled = isChecked
|
||||||
it.alpha = when (isChecked) {
|
it.alpha =
|
||||||
true -> 1f
|
when (isChecked) {
|
||||||
false -> 0.5f
|
true -> 1f
|
||||||
}
|
false -> 0.5f
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,13 +339,14 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
binding.videoSubStrokeButton,
|
binding.videoSubStrokeButton,
|
||||||
binding.videoSubStroke,
|
binding.videoSubStroke,
|
||||||
binding.videoSubBottomMarginButton,
|
binding.videoSubBottomMarginButton,
|
||||||
binding.videoSubBottomMargin
|
binding.videoSubBottomMargin,
|
||||||
).forEach {
|
).forEach {
|
||||||
it.isEnabled = isChecked
|
it.isEnabled = isChecked
|
||||||
it.alpha = when (isChecked) {
|
it.alpha =
|
||||||
true -> 1f
|
when (isChecked) {
|
||||||
false -> 0.5f
|
true -> 1f
|
||||||
}
|
false -> 0.5f
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,122 +365,100 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
toggleExpSubOptions(binding.subTextSwitch.isChecked)
|
toggleExpSubOptions(binding.subTextSwitch.isChecked)
|
||||||
|
|
||||||
val subLanguages = arrayOf(
|
val subLanguages =
|
||||||
"Albanian",
|
arrayOf(
|
||||||
"Arabic",
|
"Albanian",
|
||||||
"Bosnian",
|
"Arabic",
|
||||||
"Bulgarian",
|
"Bosnian",
|
||||||
"Chinese",
|
"Bulgarian",
|
||||||
"Croatian",
|
"Chinese",
|
||||||
"Czech",
|
"Croatian",
|
||||||
"Danish",
|
"Czech",
|
||||||
"Dutch",
|
"Danish",
|
||||||
"English",
|
"Dutch",
|
||||||
"Estonian",
|
"English",
|
||||||
"Finnish",
|
"Estonian",
|
||||||
"French",
|
"Finnish",
|
||||||
"Georgian",
|
"French",
|
||||||
"German",
|
"Georgian",
|
||||||
"Greek",
|
"German",
|
||||||
"Hebrew",
|
"Greek",
|
||||||
"Hindi",
|
"Hebrew",
|
||||||
"Indonesian",
|
"Hindi",
|
||||||
"Irish",
|
"Indonesian",
|
||||||
"Italian",
|
"Irish",
|
||||||
"Japanese",
|
"Italian",
|
||||||
"Korean",
|
"Japanese",
|
||||||
"Lithuanian",
|
"Korean",
|
||||||
"Luxembourgish",
|
"Lithuanian",
|
||||||
"Macedonian",
|
"Luxembourgish",
|
||||||
"Mongolian",
|
"Macedonian",
|
||||||
"Norwegian",
|
"Mongolian",
|
||||||
"Polish",
|
"Norwegian",
|
||||||
"Portuguese",
|
"Polish",
|
||||||
"Punjabi",
|
"Portuguese",
|
||||||
"Romanian",
|
"Punjabi",
|
||||||
"Russian",
|
"Romanian",
|
||||||
"Serbian",
|
"Russian",
|
||||||
"Slovak",
|
"Serbian",
|
||||||
"Slovenian",
|
"Slovak",
|
||||||
"Spanish",
|
"Slovenian",
|
||||||
"Turkish",
|
"Spanish",
|
||||||
"Ukrainian",
|
"Turkish",
|
||||||
"Urdu",
|
"Ukrainian",
|
||||||
"Vietnamese",
|
"Urdu",
|
||||||
)
|
"Vietnamese",
|
||||||
|
)
|
||||||
binding.videoSubLanguage.setOnClickListener {
|
binding.videoSubLanguage.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
customAlertDialog().apply {
|
||||||
setTitle(getString(R.string.subtitle_langauge))
|
setTitle(getString(R.string.subtitle_langauge))
|
||||||
singleChoiceItems(
|
singleChoiceItems(
|
||||||
subLanguages,
|
subLanguages,
|
||||||
PrefManager.getVal(PrefName.SubLanguage)
|
PrefManager.getVal(PrefName.SubLanguage),
|
||||||
) { count ->
|
) { count ->
|
||||||
PrefManager.setVal(PrefName.SubLanguage, count)
|
PrefManager.setVal(PrefName.SubLanguage, count)
|
||||||
}
|
}
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val colorsPrimary =
|
|
||||||
arrayOf(
|
|
||||||
"Black",
|
|
||||||
"Dark Gray",
|
|
||||||
"Gray",
|
|
||||||
"Light Gray",
|
|
||||||
"White",
|
|
||||||
"Red",
|
|
||||||
"Yellow",
|
|
||||||
"Green",
|
|
||||||
"Cyan",
|
|
||||||
"Blue",
|
|
||||||
"Magenta"
|
|
||||||
)
|
|
||||||
binding.videoSubColorPrimary.setOnClickListener {
|
binding.videoSubColorPrimary.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
val color = PrefManager.getVal<Int>(PrefName.PrimaryColor)
|
||||||
setTitle(getString(R.string.primary_sub_color))
|
val title = getString(R.string.primary_sub_color)
|
||||||
singleChoiceItems(
|
showColorPicker(
|
||||||
colorsPrimary,
|
color,
|
||||||
PrefManager.getVal(PrefName.PrimaryColor)
|
title,
|
||||||
) { count ->
|
object : ColorPickerCallback {
|
||||||
PrefManager.setVal(PrefName.PrimaryColor, count)
|
override fun onColorSelected(color: Int) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.PrimaryColor, color)
|
||||||
}
|
updateSubPreview()
|
||||||
show()
|
}
|
||||||
}
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
val colorsSecondary = arrayOf(
|
|
||||||
"Black",
|
|
||||||
"Dark Gray",
|
|
||||||
"Gray",
|
|
||||||
"Light Gray",
|
|
||||||
"White",
|
|
||||||
"Red",
|
|
||||||
"Yellow",
|
|
||||||
"Green",
|
|
||||||
"Cyan",
|
|
||||||
"Blue",
|
|
||||||
"Magenta",
|
|
||||||
"Transparent"
|
|
||||||
)
|
|
||||||
binding.videoSubColorSecondary.setOnClickListener {
|
binding.videoSubColorSecondary.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
val color = PrefManager.getVal<Int>(PrefName.SecondaryColor)
|
||||||
setTitle(getString(R.string.outline_sub_color))
|
val title = getString(R.string.outline_sub_color)
|
||||||
singleChoiceItems(
|
showColorPicker(
|
||||||
colorsSecondary,
|
color,
|
||||||
PrefManager.getVal(PrefName.SecondaryColor)
|
title,
|
||||||
) { count ->
|
object : ColorPickerCallback {
|
||||||
PrefManager.setVal(PrefName.SecondaryColor, count)
|
override fun onColorSelected(color: Int) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.SecondaryColor, color)
|
||||||
}
|
updateSubPreview()
|
||||||
show()
|
}
|
||||||
}
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val typesOutline = arrayOf("Outline", "Shine", "Drop Shadow", "None")
|
val typesOutline = arrayOf("Outline", "Shine", "Drop Shadow", "None")
|
||||||
binding.videoSubOutline.setOnClickListener {
|
binding.videoSubOutline.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
customAlertDialog().apply {
|
||||||
setTitle(getString(R.string.outline_type))
|
setTitle(getString(R.string.outline_type))
|
||||||
singleChoiceItems(
|
singleChoiceItems(
|
||||||
typesOutline,
|
typesOutline,
|
||||||
PrefManager.getVal(PrefName.Outline)
|
PrefManager.getVal(PrefName.Outline),
|
||||||
) { count ->
|
) { count ->
|
||||||
PrefManager.setVal(PrefName.Outline, count)
|
PrefManager.setVal(PrefName.Outline, count)
|
||||||
updateSubPreview()
|
updateSubPreview()
|
||||||
|
@ -473,101 +466,83 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
show()
|
show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val colorsSubBackground = arrayOf(
|
|
||||||
"Transparent",
|
|
||||||
"Black",
|
|
||||||
"Dark Gray",
|
|
||||||
"Gray",
|
|
||||||
"Light Gray",
|
|
||||||
"White",
|
|
||||||
"Red",
|
|
||||||
"Yellow",
|
|
||||||
"Green",
|
|
||||||
"Cyan",
|
|
||||||
"Blue",
|
|
||||||
"Magenta"
|
|
||||||
)
|
|
||||||
binding.videoSubColorBackground.setOnClickListener {
|
binding.videoSubColorBackground.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
val color = PrefManager.getVal<Int>(PrefName.SubBackground)
|
||||||
setTitle(getString(R.string.sub_background_color_select))
|
val title = getString(R.string.sub_background_color_select)
|
||||||
singleChoiceItems(
|
showColorPicker(
|
||||||
colorsSubBackground,
|
color,
|
||||||
PrefManager.getVal(PrefName.SubBackground)
|
title,
|
||||||
) { count ->
|
object : ColorPickerCallback {
|
||||||
PrefManager.setVal(PrefName.SubBackground, count)
|
override fun onColorSelected(color: Int) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.SubBackground, color)
|
||||||
}
|
updateSubPreview()
|
||||||
show()
|
}
|
||||||
}
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
val colorsSubWindow = arrayOf(
|
|
||||||
"Transparent",
|
|
||||||
"Black",
|
|
||||||
"Dark Gray",
|
|
||||||
"Gray",
|
|
||||||
"Light Gray",
|
|
||||||
"White",
|
|
||||||
"Red",
|
|
||||||
"Yellow",
|
|
||||||
"Green",
|
|
||||||
"Cyan",
|
|
||||||
"Blue",
|
|
||||||
"Magenta"
|
|
||||||
)
|
|
||||||
binding.videoSubColorWindow.setOnClickListener {
|
binding.videoSubColorWindow.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
val color = PrefManager.getVal<Int>(PrefName.SubWindow)
|
||||||
setTitle(getString(R.string.sub_window_color_select))
|
val title = getString(R.string.sub_window_color_select)
|
||||||
singleChoiceItems(
|
showColorPicker(
|
||||||
colorsSubWindow,
|
color,
|
||||||
PrefManager.getVal(PrefName.SubWindow)
|
title,
|
||||||
) { count ->
|
object : ColorPickerCallback {
|
||||||
PrefManager.setVal(PrefName.SubWindow, count)
|
override fun onColorSelected(color: Int) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.SubWindow, color)
|
||||||
}
|
updateSubPreview()
|
||||||
show()
|
}
|
||||||
}
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.videoSubAlpha.value = PrefManager.getVal(PrefName.SubAlpha)
|
binding.videoSubAlpha.value = PrefManager.getVal(PrefName.SubAlpha)
|
||||||
binding.videoSubAlpha.addOnChangeListener(OnChangeListener { _, value, fromUser ->
|
binding.videoSubAlpha.addOnChangeListener(
|
||||||
if (fromUser) {
|
OnChangeListener { _, value, fromUser ->
|
||||||
PrefManager.setVal(PrefName.SubAlpha, value)
|
if (fromUser) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.SubAlpha, value)
|
||||||
}
|
updateSubPreview()
|
||||||
})
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
binding.videoSubStroke.value = PrefManager.getVal(PrefName.SubStroke)
|
binding.videoSubStroke.value = PrefManager.getVal(PrefName.SubStroke)
|
||||||
binding.videoSubStroke.addOnChangeListener(OnChangeListener { _, value, fromUser ->
|
binding.videoSubStroke.addOnChangeListener(
|
||||||
if (fromUser) {
|
OnChangeListener { _, value, fromUser ->
|
||||||
PrefManager.setVal(PrefName.SubStroke, value)
|
if (fromUser) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.SubStroke, value)
|
||||||
}
|
updateSubPreview()
|
||||||
})
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
binding.videoSubBottomMargin.value = PrefManager.getVal(PrefName.SubBottomMargin)
|
binding.videoSubBottomMargin.value = PrefManager.getVal(PrefName.SubBottomMargin)
|
||||||
binding.videoSubBottomMargin.addOnChangeListener(OnChangeListener { _, value, fromUser ->
|
binding.videoSubBottomMargin.addOnChangeListener(
|
||||||
if (fromUser) {
|
OnChangeListener { _, value, fromUser ->
|
||||||
PrefManager.setVal(PrefName.SubBottomMargin, value)
|
if (fromUser) {
|
||||||
updateSubPreview()
|
PrefManager.setVal(PrefName.SubBottomMargin, value)
|
||||||
}
|
updateSubPreview()
|
||||||
})
|
}
|
||||||
|
},
|
||||||
val fonts = arrayOf(
|
|
||||||
"Poppins Semi Bold",
|
|
||||||
"Poppins Bold",
|
|
||||||
"Poppins",
|
|
||||||
"Poppins Thin",
|
|
||||||
"Century Gothic",
|
|
||||||
"Levenim MT Bold",
|
|
||||||
"Blocky"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val fonts =
|
||||||
|
arrayOf(
|
||||||
|
"Poppins Semi Bold",
|
||||||
|
"Poppins Bold",
|
||||||
|
"Poppins",
|
||||||
|
"Poppins Thin",
|
||||||
|
"Century Gothic",
|
||||||
|
"Levenim MT Bold",
|
||||||
|
"Blocky",
|
||||||
|
)
|
||||||
binding.videoSubFont.setOnClickListener {
|
binding.videoSubFont.setOnClickListener {
|
||||||
customAlertDialog().apply {
|
customAlertDialog().apply {
|
||||||
setTitle(getString(R.string.subtitle_font))
|
setTitle(getString(R.string.subtitle_font))
|
||||||
singleChoiceItems(
|
singleChoiceItems(
|
||||||
fonts,
|
fonts,
|
||||||
PrefManager.getVal(PrefName.Font)
|
PrefManager.getVal(PrefName.Font),
|
||||||
) { count ->
|
) { count ->
|
||||||
PrefManager.setVal(PrefName.Font, count)
|
PrefManager.setVal(PrefName.Font, count)
|
||||||
updateSubPreview()
|
updateSubPreview()
|
||||||
|
@ -583,89 +558,80 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
binding.subtitleFontSize.addTextChangedListener {
|
binding.subtitleFontSize.addTextChangedListener {
|
||||||
val size = binding.subtitleFontSize.text.toString().toIntOrNull()
|
val size =
|
||||||
|
binding.subtitleFontSize.text
|
||||||
|
.toString()
|
||||||
|
.toIntOrNull()
|
||||||
if (size != null) {
|
if (size != null) {
|
||||||
PrefManager.setVal(PrefName.FontSize, size)
|
PrefManager.setVal(PrefName.FontSize, size)
|
||||||
updateSubPreview()
|
updateSubPreview()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.subtitleTest.addOnChangeListener(object : Xpandable.OnChangeListener {
|
binding.subtitleTest.addOnChangeListener(
|
||||||
override fun onExpand() {
|
object : Xpandable.OnChangeListener {
|
||||||
updateSubPreview()
|
override fun onExpand() {
|
||||||
}
|
updateSubPreview()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onRetract() {}
|
override fun onRetract() {}
|
||||||
})
|
},
|
||||||
|
)
|
||||||
updateSubPreview()
|
updateSubPreview()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun showColorPicker(
|
||||||
|
originalColor: Int,
|
||||||
|
title: String,
|
||||||
|
callback: ColorPickerCallback,
|
||||||
|
) {
|
||||||
|
colorPickerCallback = callback
|
||||||
|
|
||||||
|
SimpleColorWheelDialog()
|
||||||
|
.title(title)
|
||||||
|
.color(originalColor)
|
||||||
|
.alpha(true)
|
||||||
|
.neg()
|
||||||
|
.theme(R.style.MyPopup)
|
||||||
|
.show(this, "colorPicker")
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onResult(
|
||||||
|
dialogTag: String,
|
||||||
|
which: Int,
|
||||||
|
extras: Bundle,
|
||||||
|
): Boolean {
|
||||||
|
if (dialogTag == "colorPicker" && which == SimpleDialog.OnDialogResultListener.BUTTON_POSITIVE) {
|
||||||
|
val color = extras.getInt(SimpleColorWheelDialog.COLOR)
|
||||||
|
colorPickerCallback?.onColorSelected(color)
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
private fun updateSubPreview() {
|
private fun updateSubPreview() {
|
||||||
binding.subtitleTestWindow.run {
|
binding.subtitleTestWindow.run {
|
||||||
alpha = PrefManager.getVal(PrefName.SubAlpha)
|
alpha = PrefManager.getVal(PrefName.SubAlpha)
|
||||||
setBackgroundColor(
|
setBackgroundColor(PrefManager.getVal(PrefName.SubWindow))
|
||||||
when (PrefManager.getVal<Int>(PrefName.SubWindow)) {
|
|
||||||
0 -> Color.TRANSPARENT
|
|
||||||
1 -> Color.BLACK
|
|
||||||
2 -> Color.DKGRAY
|
|
||||||
3 -> Color.GRAY
|
|
||||||
4 -> Color.LTGRAY
|
|
||||||
5 -> Color.WHITE
|
|
||||||
6 -> Color.RED
|
|
||||||
7 -> Color.YELLOW
|
|
||||||
8 -> Color.GREEN
|
|
||||||
9 -> Color.CYAN
|
|
||||||
10 -> Color.BLUE
|
|
||||||
11 -> Color.MAGENTA
|
|
||||||
else -> Color.TRANSPARENT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.subtitleTestText.run {
|
binding.subtitleTestText.run {
|
||||||
textSize = PrefManager.getVal<Int>(PrefName.FontSize).toSP
|
textSize = PrefManager.getVal<Int>(PrefName.FontSize).toSP
|
||||||
typeface = when (PrefManager.getVal<Int>(PrefName.Font)) {
|
typeface =
|
||||||
0 -> ResourcesCompat.getFont(this.context, R.font.poppins_semi_bold)
|
when (PrefManager.getVal<Int>(PrefName.Font)) {
|
||||||
1 -> ResourcesCompat.getFont(this.context, R.font.poppins_bold)
|
0 -> ResourcesCompat.getFont(this.context, R.font.poppins_semi_bold)
|
||||||
2 -> ResourcesCompat.getFont(this.context, R.font.poppins)
|
1 -> ResourcesCompat.getFont(this.context, R.font.poppins_bold)
|
||||||
3 -> ResourcesCompat.getFont(this.context, R.font.poppins_thin)
|
2 -> ResourcesCompat.getFont(this.context, R.font.poppins)
|
||||||
4 -> ResourcesCompat.getFont(this.context, R.font.century_gothic_regular)
|
3 -> ResourcesCompat.getFont(this.context, R.font.poppins_thin)
|
||||||
5 -> ResourcesCompat.getFont(this.context, R.font.levenim_mt_bold)
|
4 -> ResourcesCompat.getFont(this.context, R.font.century_gothic_regular)
|
||||||
6 -> ResourcesCompat.getFont(this.context, R.font.blocky)
|
5 -> ResourcesCompat.getFont(this.context, R.font.levenim_mt_bold)
|
||||||
else -> ResourcesCompat.getFont(this.context, R.font.poppins_semi_bold)
|
6 -> ResourcesCompat.getFont(this.context, R.font.blocky)
|
||||||
}
|
else -> ResourcesCompat.getFont(this.context, R.font.poppins_semi_bold)
|
||||||
setTextColor(
|
|
||||||
when (PrefManager.getVal<Int>(PrefName.PrimaryColor)) {
|
|
||||||
0 -> Color.BLACK
|
|
||||||
1 -> Color.DKGRAY
|
|
||||||
2 -> Color.GRAY
|
|
||||||
3 -> Color.LTGRAY
|
|
||||||
4 -> Color.WHITE
|
|
||||||
5 -> Color.RED
|
|
||||||
6 -> Color.YELLOW
|
|
||||||
7 -> Color.GREEN
|
|
||||||
8 -> Color.CYAN
|
|
||||||
9 -> Color.BLUE
|
|
||||||
10 -> Color.MAGENTA
|
|
||||||
11 -> Color.TRANSPARENT
|
|
||||||
else -> Color.WHITE
|
|
||||||
}
|
}
|
||||||
)
|
|
||||||
setBackgroundColor(
|
setTextColor(PrefManager.getVal<Int>(PrefName.PrimaryColor))
|
||||||
when (PrefManager.getVal<Int>(PrefName.SubBackground)) {
|
|
||||||
0 -> Color.TRANSPARENT
|
setBackgroundColor(PrefManager.getVal<Int>(PrefName.SubBackground))
|
||||||
1 -> Color.BLACK
|
|
||||||
2 -> Color.DKGRAY
|
|
||||||
3 -> Color.GRAY
|
|
||||||
4 -> Color.LTGRAY
|
|
||||||
5 -> Color.WHITE
|
|
||||||
6 -> Color.RED
|
|
||||||
7 -> Color.YELLOW
|
|
||||||
8 -> Color.GREEN
|
|
||||||
9 -> Color.CYAN
|
|
||||||
10 -> Color.BLUE
|
|
||||||
11 -> Color.MAGENTA
|
|
||||||
else -> Color.TRANSPARENT
|
|
||||||
}
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,14 +96,14 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
||||||
Subtitles(Pref(Location.Player, Boolean::class, true)),
|
Subtitles(Pref(Location.Player, Boolean::class, true)),
|
||||||
TextviewSubtitles(Pref(Location.Player, Boolean::class, false)),
|
TextviewSubtitles(Pref(Location.Player, Boolean::class, false)),
|
||||||
SubLanguage(Pref(Location.Player, Int::class, 9)),
|
SubLanguage(Pref(Location.Player, Int::class, 9)),
|
||||||
PrimaryColor(Pref(Location.Player, Int::class, 4)),
|
PrimaryColor(Pref(Location.Player, Int::class, Color.WHITE)),
|
||||||
SecondaryColor(Pref(Location.Player, Int::class, 0)),
|
SecondaryColor(Pref(Location.Player, Int::class, Color.BLACK)),
|
||||||
Outline(Pref(Location.Player, Int::class, 0)),
|
Outline(Pref(Location.Player, Int::class, 0)),
|
||||||
SubBackground(Pref(Location.Player, Int::class, 0)),
|
SubBackground(Pref(Location.Player, Int::class, Color.TRANSPARENT)),
|
||||||
SubWindow(Pref(Location.Player, Int::class, 0)),
|
SubWindow(Pref(Location.Player, Int::class, Color.TRANSPARENT)),
|
||||||
SubAlpha(Pref(Location.Player, Float::class, 1f)),
|
SubAlpha(Pref(Location.Player, Float::class, 1f)),
|
||||||
SubStroke(Pref(Location.Player, Float::class, 8f)),
|
SubStroke(Pref(Location.Player, Float::class, 8f)),
|
||||||
SubBottomMargin(Pref(Location.Player, Float::class, 4f)),
|
SubBottomMargin(Pref(Location.Player, Float::class, 1f)),
|
||||||
Font(Pref(Location.Player, Int::class, 0)),
|
Font(Pref(Location.Player, Int::class, 0)),
|
||||||
FontSize(Pref(Location.Player, Int::class, 20)),
|
FontSize(Pref(Location.Player, Int::class, 20)),
|
||||||
Locale(Pref(Location.Player, Int::class, 2)),
|
Locale(Pref(Location.Player, Int::class, 2)),
|
||||||
|
@ -220,4 +220,4 @@ enum class PrefName(val data: Pref) { //TODO: Split this into multiple files
|
||||||
Socks5ProxyPort(Pref(Location.Protected, String::class, "")),
|
Socks5ProxyPort(Pref(Location.Protected, String::class, "")),
|
||||||
Socks5ProxyUsername(Pref(Location.Protected, String::class, "")),
|
Socks5ProxyUsername(Pref(Location.Protected, String::class, "")),
|
||||||
Socks5ProxyPassword(Pref(Location.Protected, String::class, "")),
|
Socks5ProxyPassword(Pref(Location.Protected, String::class, "")),
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,25 +225,6 @@
|
||||||
app:showText="false"
|
app:showText="false"
|
||||||
app:thumbTint="@color/button_switch_track" />
|
app:thumbTint="@color/button_switch_track" />
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/videoSubLanguage"
|
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="64dp"
|
|
||||||
android:layout_marginBottom="8dp"
|
|
||||||
android:fontFamily="@font/poppins_bold"
|
|
||||||
android:insetTop="0dp"
|
|
||||||
android:insetBottom="0dp"
|
|
||||||
android:paddingHorizontal="32dp"
|
|
||||||
android:text="@string/subtitle_langauge"
|
|
||||||
android:textAlignment="viewStart"
|
|
||||||
android:textAllCaps="false"
|
|
||||||
android:textColor="@color/bg_opp"
|
|
||||||
app:cornerRadius="0dp"
|
|
||||||
app:icon="@drawable/ic_round_subtitles_24"
|
|
||||||
app:iconPadding="16dp"
|
|
||||||
app:iconSize="24dp" />
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/videoSubColorPrimary"
|
android:id="@+id/videoSubColorPrimary"
|
||||||
style="@style/Widget.Material3.Button.TextButton"
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
|
@ -426,7 +407,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="32dp"
|
android:layout_marginHorizontal="32dp"
|
||||||
android:valueFrom="1"
|
android:valueFrom="0"
|
||||||
android:stepSize="1.0"
|
android:stepSize="1.0"
|
||||||
android:valueTo="30">
|
android:valueTo="30">
|
||||||
|
|
||||||
|
@ -457,9 +438,9 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="32dp"
|
android:layout_marginHorizontal="32dp"
|
||||||
android:valueFrom="1"
|
android:valueFrom="0"
|
||||||
android:stepSize="1.0"
|
android:stepSize="1.0"
|
||||||
android:valueTo="30">
|
android:valueTo="50">
|
||||||
|
|
||||||
</com.google.android.material.slider.Slider>
|
</com.google.android.material.slider.Slider>
|
||||||
|
|
||||||
|
@ -544,6 +525,25 @@
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/videoSubLanguage"
|
||||||
|
style="@style/Widget.Material3.Button.TextButton"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:fontFamily="@font/poppins_bold"
|
||||||
|
android:insetTop="0dp"
|
||||||
|
android:insetBottom="0dp"
|
||||||
|
android:paddingHorizontal="32dp"
|
||||||
|
android:text="@string/subtitle_langauge"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@color/bg_opp"
|
||||||
|
app:cornerRadius="0dp"
|
||||||
|
app:icon="@drawable/ic_round_subtitles_24"
|
||||||
|
app:iconPadding="16dp"
|
||||||
|
app:iconSize="24dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -1350,4 +1350,4 @@
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
|
@ -1073,7 +1073,7 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
|
||||||
<string name="private_mode">Private</string>
|
<string name="private_mode">Private</string>
|
||||||
<string name="omega_cursed">you have been Ǫ̴̺̙͎̤̫͓̮̰̿͝M̴͇̤͗́̾̈́̑̍̿̈͌͝Ȅ̴̡̨̛͉̣̙̩̲̣̤̟̪̣̎͗̎̆̒̉͆̆̕ͅͅǴ̸̯̬̗̠̙͛͐̀̈͋̀̈̽́̎̿͘͘͝ͅĀ̶̧̲̀ͅ ̴̢̟͕̜̓̾̓C̶̬̜̰̘̝̱̫͓͙̭̈́͐͋̓̏̈̍̓̀̌̾̚Ư̸̛̤̱̈́͆̽͊͛̐̓́̑͘̕̕͝R̸̨̨͈̬̱̺͕̪̪̘͕͎̂͛́̅̆̓̀͝ͅS̴̨̨̛̩̭̗̹̰̭̥͉̮̝̠̓̔͆̂͊͆̀̈́̅̕͘̚͝È̴̢̛̝͈̳͉͈͒͒̒̄̏̈̈́D̸̢̡̨̜̞̩̼̫̹̗̮͛̀̈̋̾̇̕̕͜ͅ</string>
|
<string name="omega_cursed">you have been Ǫ̴̺̙͎̤̫͓̮̰̿͝M̴͇̤͗́̾̈́̑̍̿̈͌͝Ȅ̴̡̨̛͉̣̙̩̲̣̤̟̪̣̎͗̎̆̒̉͆̆̕ͅͅǴ̸̯̬̗̠̙͛͐̀̈͋̀̈̽́̎̿͘͘͝ͅĀ̶̧̲̀ͅ ̴̢̟͕̜̓̾̓C̶̬̜̰̘̝̱̫͓͙̭̈́͐͋̓̏̈̍̓̀̌̾̚Ư̸̛̤̱̈́͆̽͊͛̐̓́̑͘̕̕͝R̸̨̨͈̬̱̺͕̪̪̘͕͎̂͛́̅̆̓̀͝ͅS̴̨̨̛̩̭̗̹̰̭̥͉̮̝̠̓̔͆̂͊͆̀̈́̅̕͘̚͝È̴̢̛̝͈̳͉͈͒͒̒̄̏̈̈́D̸̢̡̨̜̞̩̼̫̹̗̮͛̀̈̋̾̇̕̕͜ͅ</string>
|
||||||
<string name="omega_freed">you have been freed</string>
|
<string name="omega_freed">you have been freed</string>
|
||||||
<string name="subtitle_langauge">Subtitle Langauge</string>
|
<string name="subtitle_langauge">Preferred Langauge</string>
|
||||||
<string name="socks5">SOCKS5</string>
|
<string name="socks5">SOCKS5</string>
|
||||||
<string name="host">Host</string>
|
<string name="host">Host</string>
|
||||||
<string name="port">Port</string>
|
<string name="port">Port</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue