dimming
This commit is contained in:
parent
b8782b0507
commit
dc1edc9a42
11 changed files with 43 additions and 22 deletions
|
@ -55,7 +55,7 @@ class InstalledAnimeExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { it.lang }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||
selectedIndex = which
|
||||
|
@ -85,6 +85,7 @@ class InstalledAnimeExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
}
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
// If there's only one setting, proceed with the fragment transaction
|
||||
val eActivity = requireActivity() as ExtensionsActivity
|
||||
|
|
|
@ -62,7 +62,7 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { it.lang }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||
selectedIndex = which
|
||||
|
@ -81,6 +81,7 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
|||
.commit()
|
||||
}
|
||||
.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
} else {
|
||||
// If there's only one setting, proceed with the fragment transaction
|
||||
val fragment = MangaSourcePreferencesFragment().getInstance(selectedSetting.id) {
|
||||
|
|
|
@ -106,13 +106,14 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val speedDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.default_speed))
|
||||
binding.playerSettingsSpeed.setOnClickListener {
|
||||
speedDialog.setSingleChoiceItems(speedsName, settings.defaultSpeed) { dialog, i ->
|
||||
val dialog = speedDialog.setSingleChoiceItems(speedsName, settings.defaultSpeed) { dialog, i ->
|
||||
settings.defaultSpeed = i
|
||||
binding.playerSettingsSpeed.text =
|
||||
getString(R.string.default_playback_speed, speedsName[i])
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.playerSettingsCursedSpeeds.isChecked = settings.cursedSpeeds
|
||||
|
@ -255,11 +256,12 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val resizeDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.default_resize_mode))
|
||||
binding.playerResizeMode.setOnClickListener {
|
||||
resizeDialog.setSingleChoiceItems(resizeModes, settings.resize) { dialog, count ->
|
||||
val dialog = resizeDialog.setSingleChoiceItems(resizeModes, settings.resize) { dialog, count ->
|
||||
settings.resize = count
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
fun restartApp() {
|
||||
Snackbar.make(
|
||||
|
@ -339,7 +341,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val primaryColorDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.primary_sub_color))
|
||||
binding.videoSubColorPrimary.setOnClickListener {
|
||||
primaryColorDialog.setSingleChoiceItems(
|
||||
val dialog = primaryColorDialog.setSingleChoiceItems(
|
||||
colorsPrimary,
|
||||
settings.primaryColor
|
||||
) { dialog, count ->
|
||||
|
@ -347,6 +349,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val colorsSecondary = arrayOf(
|
||||
"Black",
|
||||
|
@ -365,7 +368,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val secondaryColorDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorSecondary.setOnClickListener {
|
||||
secondaryColorDialog.setSingleChoiceItems(
|
||||
val dialog = secondaryColorDialog.setSingleChoiceItems(
|
||||
colorsSecondary,
|
||||
settings.secondaryColor
|
||||
) { dialog, count ->
|
||||
|
@ -373,16 +376,18 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val typesOutline = arrayOf("Outline", "Shine", "Drop Shadow", "None")
|
||||
val outlineDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_type))
|
||||
binding.videoSubOutline.setOnClickListener {
|
||||
outlineDialog.setSingleChoiceItems(typesOutline, settings.outline) { dialog, count ->
|
||||
val dialog = outlineDialog.setSingleChoiceItems(typesOutline, settings.outline) { dialog, count ->
|
||||
settings.outline = count
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val colorsSubBackground = arrayOf(
|
||||
"Transparent",
|
||||
|
@ -401,7 +406,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val subBackgroundDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorBackground.setOnClickListener {
|
||||
subBackgroundDialog.setSingleChoiceItems(
|
||||
val dialog = subBackgroundDialog.setSingleChoiceItems(
|
||||
colorsSubBackground,
|
||||
settings.subBackground
|
||||
) { dialog, count ->
|
||||
|
@ -409,6 +414,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
val colorsSubWindow = arrayOf(
|
||||
|
@ -428,7 +434,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val subWindowDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorWindow.setOnClickListener {
|
||||
subWindowDialog.setSingleChoiceItems(
|
||||
val dialog = subWindowDialog.setSingleChoiceItems(
|
||||
colorsSubWindow,
|
||||
settings.subWindow
|
||||
) { dialog, count ->
|
||||
|
@ -436,6 +442,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val fonts = arrayOf(
|
||||
"Poppins Semi Bold",
|
||||
|
@ -448,11 +455,12 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
val fontDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.subtitle_font))
|
||||
binding.videoSubFont.setOnClickListener {
|
||||
fontDialog.setSingleChoiceItems(fonts, settings.font) { dialog, count ->
|
||||
val dialog = fontDialog.setSingleChoiceItems(fonts, settings.font) { dialog, count ->
|
||||
settings.font = count
|
||||
saveData(player, settings)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
binding.subtitleFontSize.setText(settings.fontSize.toString())
|
||||
binding.subtitleFontSize.setOnEditorActionListener { _, actionId, _ ->
|
||||
|
|
|
@ -199,8 +199,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
passedColor = color
|
||||
linearLayout.setBackgroundColor(color)
|
||||
})
|
||||
|
||||
alertDialog.show()
|
||||
alertDialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
//val animeSource = loadData<Int>("settings_def_anime_source_s")?.let { if (it >= AnimeSources.names.size) 0 else it } ?: 0
|
||||
|
@ -237,11 +236,12 @@ class SettingsActivity : AppCompatActivity() {
|
|||
AlertDialog.Builder(this, R.style.DialogTheme).setTitle("Download Manager")
|
||||
var downloadManager = loadData<Int>("settings_download_manager") ?: 0
|
||||
binding.settingsDownloadManager.setOnClickListener {
|
||||
downloadManagerDialog.setSingleChoiceItems(managers, downloadManager) { dialog, count ->
|
||||
val dialog = downloadManagerDialog.setSingleChoiceItems(managers, downloadManager) { dialog, count ->
|
||||
downloadManager = count
|
||||
saveData("settings_download_manager", downloadManager)
|
||||
dialog.dismiss()
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.settingsForceLegacyInstall.isChecked =
|
||||
|
@ -287,6 +287,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
.create()
|
||||
|
||||
alertDialog.show()
|
||||
alertDialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
|
||||
|
@ -592,7 +593,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
val speedDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(R.string.subscriptions_checking_time)
|
||||
binding.settingsSubscriptionsTime.setOnClickListener {
|
||||
speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
||||
val dialog = speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
||||
curTime = i
|
||||
binding.settingsSubscriptionsTime.text =
|
||||
getString(R.string.subscriptions_checking_time_s, timeNames[i])
|
||||
|
@ -600,6 +601,7 @@ class SettingsActivity : AppCompatActivity() {
|
|||
dialog.dismiss()
|
||||
startSubscription(true)
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.settingsSubscriptionsTime.setOnLongClickListener {
|
||||
|
|
|
@ -42,7 +42,7 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
|
|||
|
||||
val views = resources.getStringArray(R.array.home_layouts)
|
||||
binding.uiSettingsHomeLayout.setOnClickListener {
|
||||
AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val dialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
.setTitle(getString(R.string.home_layout_show)).apply {
|
||||
setMultiChoiceItems(
|
||||
views,
|
||||
|
@ -52,6 +52,7 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
|
|||
saveData(ui, settings)
|
||||
}
|
||||
}.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
binding.uiSettingsSmallView.isChecked = settings.smallView
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue