no changes
This commit is contained in:
parent
37a53748a2
commit
1a346e6b5a
13 changed files with 53 additions and 54 deletions
|
@ -1,12 +1,12 @@
|
|||
package ani.dantotsu.settings
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.os.Build.*
|
||||
import android.os.Build.VERSION.*
|
||||
import android.os.Bundle
|
||||
import android.text.Editable
|
||||
import android.text.TextWatcher
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.AutoCompleteTextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
|
@ -16,6 +16,9 @@ import androidx.viewpager2.adapter.FragmentStateAdapter
|
|||
import androidx.viewpager2.widget.ViewPager2
|
||||
import ani.dantotsu.*
|
||||
import ani.dantotsu.databinding.ActivityExtensionsBinding
|
||||
import ani.dantotsu.others.LanguageMapper
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.settings.saving.PrefWrapper
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
|
@ -111,20 +114,20 @@ class ExtensionsActivity : AppCompatActivity() {
|
|||
}
|
||||
})
|
||||
|
||||
|
||||
initActivity(this)
|
||||
binding.languageselect.visibility = View.GONE
|
||||
/* TODO
|
||||
binding.languageselect.setOnClickListener {
|
||||
val popup = PopupMenu(this, it)
|
||||
popup.inflate(R.menu.launguage_selector_menu)
|
||||
popup.setOnMenuItemClickListener { menuItem ->
|
||||
true
|
||||
}
|
||||
popup.setOnDismissListener {
|
||||
}
|
||||
popup.show()
|
||||
}*/
|
||||
binding.languageselect.setOnClickListener {
|
||||
val languageOptions = LanguageMapper.Companion.Language.entries.map{ it.name }.toTypedArray()
|
||||
val builder = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
val listOrder = PrefWrapper.getVal(PrefName.LangSort,"all")
|
||||
val index = LanguageMapper.Companion.Language.entries.toTypedArray().indexOfFirst{it.code == listOrder}
|
||||
builder.setTitle("Language")
|
||||
builder.setSingleChoiceItems(languageOptions, index){ dialog, i ->
|
||||
PrefWrapper.setVal(PrefName.LangSort, LanguageMapper.Companion.Language.entries[i].code)
|
||||
dialog.dismiss()
|
||||
}
|
||||
val dialog = builder.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
|
||||
topMargin = statusBarHeight
|
||||
bottomMargin = navBarHeight
|
||||
|
|
|
@ -95,7 +95,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
var speedsName = curSpeedArr.map { "${it}x" }.toTypedArray()
|
||||
binding.playerSettingsSpeed.text =
|
||||
getString(R.string.default_playback_speed, speedsName[settings.defaultSpeed])
|
||||
val speedDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val speedDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.default_speed))
|
||||
binding.playerSettingsSpeed.setOnClickListener {
|
||||
val dialog =
|
||||
|
@ -246,7 +246,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
val resizeModes = arrayOf("Original", "Zoom", "Stretch")
|
||||
val resizeDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val resizeDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.default_resize_mode))
|
||||
binding.playerResizeMode.setOnClickListener {
|
||||
val dialog =
|
||||
|
@ -332,7 +332,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
"Blue",
|
||||
"Magenta"
|
||||
)
|
||||
val primaryColorDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val primaryColorDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.primary_sub_color))
|
||||
binding.videoSubColorPrimary.setOnClickListener {
|
||||
val dialog = primaryColorDialog.setSingleChoiceItems(
|
||||
|
@ -359,7 +359,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
"Magenta",
|
||||
"Transparent"
|
||||
)
|
||||
val secondaryColorDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val secondaryColorDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorSecondary.setOnClickListener {
|
||||
val dialog = secondaryColorDialog.setSingleChoiceItems(
|
||||
|
@ -373,7 +373,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
val typesOutline = arrayOf("Outline", "Shine", "Drop Shadow", "None")
|
||||
val outlineDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val outlineDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.outline_type))
|
||||
binding.videoSubOutline.setOnClickListener {
|
||||
val dialog = outlineDialog.setSingleChoiceItems(
|
||||
|
@ -400,7 +400,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
"Blue",
|
||||
"Magenta"
|
||||
)
|
||||
val subBackgroundDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val subBackgroundDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorBackground.setOnClickListener {
|
||||
val dialog = subBackgroundDialog.setSingleChoiceItems(
|
||||
|
@ -428,7 +428,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
"Blue",
|
||||
"Magenta"
|
||||
)
|
||||
val subWindowDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val subWindowDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.outline_sub_color))
|
||||
binding.videoSubColorWindow.setOnClickListener {
|
||||
val dialog = subWindowDialog.setSingleChoiceItems(
|
||||
|
@ -449,7 +449,7 @@ class PlayerSettingsActivity : AppCompatActivity() {
|
|||
"Century Gothic",
|
||||
"Century Gothic Bold"
|
||||
)
|
||||
val fontDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val fontDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.subtitle_font))
|
||||
binding.videoSubFont.setOnClickListener {
|
||||
val dialog = fontDialog.setSingleChoiceItems(fonts, settings.font) { dialog, count ->
|
||||
|
|
|
@ -207,7 +207,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
|||
|
||||
val managers = arrayOf("Default", "1DM", "ADM")
|
||||
val downloadManagerDialog =
|
||||
AlertDialog.Builder(this, R.style.DialogTheme).setTitle("Download Manager")
|
||||
AlertDialog.Builder(this, R.style.MyPopup).setTitle("Download Manager")
|
||||
var downloadManager = PrefWrapper.getVal(PrefName.DownloadManager, 0)
|
||||
binding.settingsDownloadManager.setOnClickListener {
|
||||
val dialog = downloadManagerDialog.setSingleChoiceItems(
|
||||
|
@ -608,7 +608,7 @@ class SettingsActivity : AppCompatActivity(), SimpleDialog.OnDialogResultListene
|
|||
}.toTypedArray()
|
||||
binding.settingsSubscriptionsTime.text =
|
||||
getString(R.string.subscriptions_checking_time_s, timeNames[curTime])
|
||||
val speedDialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val speedDialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(R.string.subscriptions_checking_time)
|
||||
binding.settingsSubscriptionsTime.setOnClickListener {
|
||||
val dialog = speedDialog.setSingleChoiceItems(timeNames, curTime) { dialog, i ->
|
||||
|
|
|
@ -41,7 +41,7 @@ class UserInterfaceSettingsActivity : AppCompatActivity() {
|
|||
|
||||
val views = resources.getStringArray(R.array.home_layouts)
|
||||
binding.uiSettingsHomeLayout.setOnClickListener {
|
||||
val dialog = AlertDialog.Builder(this, R.style.DialogTheme)
|
||||
val dialog = AlertDialog.Builder(this, R.style.MyPopup)
|
||||
.setTitle(getString(R.string.home_layout_show)).apply {
|
||||
setMultiChoiceItems(
|
||||
views,
|
||||
|
|
|
@ -100,8 +100,9 @@ class AnimeExtensionPagingSource(
|
|||
} else {
|
||||
availableExtensions.filter { it.name.contains(query, ignoreCase = true) }
|
||||
}
|
||||
val filternfsw =
|
||||
if (isNsfwEnabled) filteredExtensions else filteredExtensions.filterNot { it.isNsfw }
|
||||
val lang = PrefWrapper.getVal(PrefName.LangSort, "all")
|
||||
val langFilter = if (lang != "all") filteredExtensions.filter { it.lang == lang } else filteredExtensions
|
||||
val filternfsw = if (isNsfwEnabled) langFilter else langFilter.filterNot { it.isNsfw }
|
||||
return try {
|
||||
val sublist = filternfsw.subList(
|
||||
fromIndex = position,
|
||||
|
|
|
@ -100,8 +100,9 @@ class MangaExtensionPagingSource(
|
|||
} else {
|
||||
availableExtensions.filter { it.name.contains(query, ignoreCase = true) }
|
||||
}
|
||||
val filternfsw =
|
||||
if (isNsfwEnabled) filteredExtensions else filteredExtensions.filterNot { it.isNsfw }
|
||||
val lang = PrefWrapper.getVal(PrefName.LangSort, "all")
|
||||
val langFilter = if (lang != "all") filteredExtensions.filter { it.lang == lang } else filteredExtensions
|
||||
val filternfsw = if (isNsfwEnabled) langFilter else langFilter.filterNot { it.isNsfw }
|
||||
return try {
|
||||
val sublist = filternfsw.subList(
|
||||
fromIndex = position,
|
||||
|
|
|
@ -45,6 +45,7 @@ enum class PrefName(val data: Pref) {
|
|||
AllowOpeningLinks(Pref(Location.Irrelevant, Boolean::class)),
|
||||
SearchStyle(Pref(Location.Irrelevant, Int::class)),
|
||||
HasUpdatedPrefs(Pref(Location.Irrelevant, Boolean::class)),
|
||||
LangSort(Pref(Location.Irrelevant, String::class)),
|
||||
|
||||
//Protected
|
||||
DiscordToken(Pref(Location.Protected, String::class)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue