no changes

This commit is contained in:
aayush262 2024-02-01 23:37:34 +05:30
parent 37a53748a2
commit 1a346e6b5a
13 changed files with 53 additions and 54 deletions

View file

@ -383,12 +383,10 @@ class AnimeWatchFragment : Fragment() {
if (allSettings.size > 1) {
val names =
allSettings.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
var selectedIndex = 0
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
.setTitle("Select a Source")
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
selectedIndex = which
selectedSetting = allSettings[selectedIndex]
.setSingleChoiceItems(names, -1) { dialog, which ->
selectedSetting = allSettings[which]
itemSelected = true
dialog.dismiss()

View file

@ -543,7 +543,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
exoPlayer.seekTo(exoPlayer.currentPosition + settings.skipTime * 1000)
}
exoSkip.setOnLongClickListener {
val dialog = Dialog(this, R.style.DialogTheme)
val dialog = Dialog(this, R.style.MyPopup)
dialog.setContentView(R.layout.item_seekbar_dialog)
dialog.setCancelable(true)
dialog.setCanceledOnTouchOutside(true)
@ -1144,7 +1144,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
playbackParameters = PlaybackParameters(speeds[curSpeed])
var speed: Float
val speedDialog =
AlertDialog.Builder(this, R.style.DialogTheme).setTitle(getString(R.string.speed))
AlertDialog.Builder(this, R.style.MyPopup).setTitle(getString(R.string.speed))
exoSpeed.setOnClickListener {
val dialog = speedDialog.setSingleChoiceItems(speedsName, curSpeed) { dialog, i ->
if (isInitialized) {
@ -1413,7 +1413,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
)
)
)
val dialog = AlertDialog.Builder(this, R.style.DialogTheme)
val dialog = AlertDialog.Builder(this, R.style.MyPopup)
.setTitle(getString(R.string.continue_from, time)).apply {
setCancelable(false)
setPositiveButton(getString(R.string.yes)) { d, _ ->

View file

@ -386,12 +386,10 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
if (allSettings.size > 1) {
val names =
allSettings.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
var selectedIndex = 0
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
.setTitle("Select a Source")
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
selectedIndex = which
selectedSetting = allSettings[selectedIndex]
.setSingleChoiceItems(names, -1) { dialog, which ->
selectedSetting = allSettings[which]
itemSelected = true
dialog.dismiss()

View file

@ -104,7 +104,7 @@ class NovelResponseAdapter(
binding.root.setOnLongClickListener {
val builder = androidx.appcompat.app.AlertDialog.Builder(
fragment.requireContext(),
R.style.DialogTheme
R.style.MyPopup
)
builder.setTitle("Delete ${novel.name}?")
builder.setMessage("Are you sure you want to delete ${novel.name}?")

View file

@ -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
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()
}
popup.setOnDismissListener {
val dialog = builder.show()
dialog.window?.setDimAmount(0.8f)
}
popup.show()
}*/
binding.settingsContainer.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = statusBarHeight
bottomMargin = navBarHeight

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -62,17 +62,24 @@
</style>
<style name="MyPopup" parent="">
<item name="android:fontFamily">@font/poppins_bold</item>
<item name="android:textColor">?attr/colorOnBackground</item>
<item name="android:popupBackground">?attr/colorSurface</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
<item name="android:fontFamily">@font/poppins_semi_bold</item>
<item name="android:textColor">?attr/colorOnBackground</item>
<item name="android:windowTitleStyle">@style/HeadingText</item>
<item name="android:popupBackground">?attr/colorSurface</item>
<item name="android:windowBackground">@drawable/shape_corner_16dp</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
<style name="HeadingText">
<item name="android:fontFamily">@font/poppins_bold</item>
<item name="android:textColor">?attr/colorPrimary</item>
<item name="android:textSize">58sp</item>
</style>
<style name="BottomNavBar" parent="">
<!-- set background color to transparent -->
<item name="android:background">@android:color/transparent</item>

View file

@ -44,16 +44,6 @@
<item name="android:navigationBarColor">@color/nav_bg</item>
</style>
<style name="DialogTheme" parent="Theme.Dantotsu">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowBackground">@drawable/shape_corner_16dp</item>
</style>
<style name="Theme.Dantotsu.ALLBLACK" parent="Theme.Base">
<item name="colorPrimary">@color/bg_black</item>
<item name="colorOnPrimary">@color/bg_black</item>