Language name in extension setting (#111)
* Full language name in ext settings * added more lang name * changed alter dialog view * sort language by names * 3x grid for 360DP mobiles * Default novel settings * Oled for LN * Lang full name * Notification icon changed to dantotsu * Remember 'sort' value
This commit is contained in:
parent
ef30869b62
commit
4286232d17
21 changed files with 1487 additions and 649 deletions
|
@ -1,6 +1,7 @@
|
||||||
package ani.dantotsu.connections.anilist
|
package ani.dantotsu.connections.anilist
|
||||||
|
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
|
import android.content.Context
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.checkGenreTime
|
import ani.dantotsu.checkGenreTime
|
||||||
import ani.dantotsu.checkId
|
import ani.dantotsu.checkId
|
||||||
|
@ -410,8 +411,9 @@ class AnilistQueries {
|
||||||
sorted["Favourites"]?.sortWith(compareBy { it.userFavOrder })
|
sorted["Favourites"]?.sortWith(compareBy { it.userFavOrder })
|
||||||
|
|
||||||
sorted["All"] = all
|
sorted["All"] = all
|
||||||
|
val listsort = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||||
val sort = sortOrder ?: options?.rowOrder
|
?.getString("sort_order", "score")
|
||||||
|
val sort = listsort ?: sortOrder ?: options?.rowOrder
|
||||||
for (i in sorted.keys) {
|
for (i in sorted.keys) {
|
||||||
when (sort) {
|
when (sort) {
|
||||||
"score" -> sorted[i]?.sortWith { b, a ->
|
"score" -> sorted[i]?.sortWith { b, a ->
|
||||||
|
|
|
@ -78,7 +78,7 @@ class SearchActivity : AppCompatActivity() {
|
||||||
mediaAdaptor = MediaAdaptor(style, model.searchResults.results, this, matchParent = true)
|
mediaAdaptor = MediaAdaptor(style, model.searchResults.results, this, matchParent = true)
|
||||||
val headerAdaptor = SearchAdapter(this)
|
val headerAdaptor = SearchAdapter(this)
|
||||||
|
|
||||||
val gridSize = (screenWidth / 124f).toInt()
|
val gridSize = (screenWidth / 120f).toInt()
|
||||||
val gridLayoutManager = GridLayoutManager(this, gridSize)
|
val gridLayoutManager = GridLayoutManager(this, gridSize)
|
||||||
gridLayoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
gridLayoutManager.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
|
||||||
override fun getSpanSize(position: Int): Int {
|
override fun getSpanSize(position: Int): Int {
|
||||||
|
|
|
@ -395,7 +395,7 @@ class AnimeWatchAdapter(
|
||||||
val adapter = ArrayAdapter(
|
val adapter = ArrayAdapter(
|
||||||
fragment.requireContext(),
|
fragment.requireContext(),
|
||||||
R.layout.item_dropdown,
|
R.layout.item_dropdown,
|
||||||
parser.extension.sources.map { LanguageMapper.mapLanguageCodeToName(it.lang) }
|
parser.extension.sources.sortedBy { it.lang }.map { LanguageMapper.mapLanguageCodeToName(it.lang) }
|
||||||
)
|
)
|
||||||
val items = adapter.count
|
val items = adapter.count
|
||||||
if (items > 1) binding?.animeSourceLanguageContainer?.visibility = View.VISIBLE else binding?.animeSourceLanguageContainer?.visibility = View.GONE
|
if (items > 1) binding?.animeSourceLanguageContainer?.visibility = View.VISIBLE else binding?.animeSourceLanguageContainer?.visibility = View.GONE
|
||||||
|
|
|
@ -23,6 +23,7 @@ import ani.dantotsu.databinding.FragmentAnimeWatchBinding
|
||||||
import ani.dantotsu.media.Media
|
import ani.dantotsu.media.Media
|
||||||
import ani.dantotsu.media.MediaDetailsActivity
|
import ani.dantotsu.media.MediaDetailsActivity
|
||||||
import ani.dantotsu.media.MediaDetailsViewModel
|
import ani.dantotsu.media.MediaDetailsViewModel
|
||||||
|
import ani.dantotsu.others.LanguageMapper
|
||||||
import ani.dantotsu.parsers.AnimeParser
|
import ani.dantotsu.parsers.AnimeParser
|
||||||
import ani.dantotsu.parsers.AnimeSources
|
import ani.dantotsu.parsers.AnimeSources
|
||||||
import ani.dantotsu.parsers.HAnimeSources
|
import ani.dantotsu.parsers.HAnimeSources
|
||||||
|
@ -314,19 +315,19 @@ class AnimeWatchFragment : Fragment() {
|
||||||
if (show) View.GONE else View.VISIBLE
|
if (show) View.GONE else View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var itemSelected = false
|
||||||
val allSettings = pkg.sources.filterIsInstance<ConfigurableAnimeSource>()
|
val allSettings = pkg.sources.filterIsInstance<ConfigurableAnimeSource>()
|
||||||
if (allSettings.isNotEmpty()) {
|
if (allSettings.isNotEmpty()) {
|
||||||
var selectedSetting = allSettings[0]
|
var selectedSetting = allSettings[0]
|
||||||
if (allSettings.size > 1) {
|
if (allSettings.size > 1) {
|
||||||
val names = allSettings.map { it.lang }.toTypedArray()
|
val names = allSettings.sortedBy { it.lang }.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||||
var selectedIndex = 0
|
var selectedIndex = 0
|
||||||
val dialog = AlertDialog.Builder(requireContext())
|
val dialog = AlertDialog.Builder(requireContext() , R.style.MyPopup)
|
||||||
.setTitle("Select a Source")
|
.setTitle("Select a Source")
|
||||||
.setSingleChoiceItems(names, selectedIndex) { _, which ->
|
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||||
selectedIndex = which
|
selectedIndex = which
|
||||||
}
|
|
||||||
.setPositiveButton("OK") { dialog, _ ->
|
|
||||||
selectedSetting = allSettings[selectedIndex]
|
selectedSetting = allSettings[selectedIndex]
|
||||||
|
itemSelected = true
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
|
||||||
// Move the fragment transaction here
|
// Move the fragment transaction here
|
||||||
|
@ -343,10 +344,10 @@ class AnimeWatchFragment : Fragment() {
|
||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.setNegativeButton("Cancel") { dialog, _ ->
|
.setOnDismissListener {
|
||||||
dialog.cancel()
|
if (!itemSelected) {
|
||||||
changeUIVisibility(true)
|
changeUIVisibility(true)
|
||||||
return@setNegativeButton
|
}
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
dialog.window?.setDimAmount(0.8f)
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
|
|
@ -425,7 +425,7 @@ class MangaReadAdapter(
|
||||||
val adapter = ArrayAdapter(
|
val adapter = ArrayAdapter(
|
||||||
fragment.requireContext(),
|
fragment.requireContext(),
|
||||||
R.layout.item_dropdown,
|
R.layout.item_dropdown,
|
||||||
parser.extension.sources.map { LanguageMapper.mapLanguageCodeToName(it.lang) }
|
parser.extension.sources.sortedBy { it.lang }.map { LanguageMapper.mapLanguageCodeToName(it.lang) }
|
||||||
)
|
)
|
||||||
val items = adapter.count
|
val items = adapter.count
|
||||||
if (items > 1) binding?.animeSourceLanguageContainer?.visibility = View.VISIBLE else binding?.animeSourceLanguageContainer?.visibility = View.GONE
|
if (items > 1) binding?.animeSourceLanguageContainer?.visibility = View.VISIBLE else binding?.animeSourceLanguageContainer?.visibility = View.GONE
|
||||||
|
|
|
@ -37,6 +37,7 @@ import ani.dantotsu.media.Media
|
||||||
import ani.dantotsu.media.MediaDetailsActivity
|
import ani.dantotsu.media.MediaDetailsActivity
|
||||||
import ani.dantotsu.media.MediaDetailsViewModel
|
import ani.dantotsu.media.MediaDetailsViewModel
|
||||||
import ani.dantotsu.media.manga.mangareader.ChapterLoaderDialog
|
import ani.dantotsu.media.manga.mangareader.ChapterLoaderDialog
|
||||||
|
import ani.dantotsu.others.LanguageMapper
|
||||||
import ani.dantotsu.parsers.DynamicMangaParser
|
import ani.dantotsu.parsers.DynamicMangaParser
|
||||||
import ani.dantotsu.parsers.HMangaSources
|
import ani.dantotsu.parsers.HMangaSources
|
||||||
import ani.dantotsu.parsers.MangaParser
|
import ani.dantotsu.parsers.MangaParser
|
||||||
|
@ -357,19 +358,19 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
||||||
if (show) View.GONE else View.VISIBLE
|
if (show) View.GONE else View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
var itemSelected = false
|
||||||
val allSettings = pkg.sources.filterIsInstance<ConfigurableSource>()
|
val allSettings = pkg.sources.filterIsInstance<ConfigurableSource>()
|
||||||
if (allSettings.isNotEmpty()) {
|
if (allSettings.isNotEmpty()) {
|
||||||
var selectedSetting = allSettings[0]
|
var selectedSetting = allSettings[0]
|
||||||
if (allSettings.size > 1) {
|
if (allSettings.size > 1) {
|
||||||
val names = allSettings.map { it.lang }.toTypedArray()
|
val names = allSettings.sortedBy { it.lang }.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||||
var selectedIndex = 0
|
var selectedIndex = 0
|
||||||
val dialog = AlertDialog.Builder(requireContext())
|
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||||
.setTitle("Select a Source")
|
.setTitle("Select a Source")
|
||||||
.setSingleChoiceItems(names, selectedIndex) { _, which ->
|
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||||
selectedIndex = which
|
selectedIndex = which
|
||||||
}
|
|
||||||
.setPositiveButton("OK") { dialog, _ ->
|
|
||||||
selectedSetting = allSettings[selectedIndex]
|
selectedSetting = allSettings[selectedIndex]
|
||||||
|
itemSelected = true
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
|
|
||||||
// Move the fragment transaction here
|
// Move the fragment transaction here
|
||||||
|
@ -384,10 +385,10 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
||||||
.addToBackStack(null)
|
.addToBackStack(null)
|
||||||
.commit()
|
.commit()
|
||||||
}
|
}
|
||||||
.setNegativeButton("Cancel") { dialog, _ ->
|
.setOnDismissListener {
|
||||||
dialog.cancel()
|
if (!itemSelected) {
|
||||||
changeUIVisibility(true)
|
changeUIVisibility(true)
|
||||||
return@setNegativeButton
|
}
|
||||||
}
|
}
|
||||||
.show()
|
.show()
|
||||||
dialog.window?.setDimAmount(0.8f)
|
dialog.window?.setDimAmount(0.8f)
|
||||||
|
|
|
@ -36,7 +36,7 @@ import ani.dantotsu.saveData
|
||||||
import ani.dantotsu.setSafeOnClickListener
|
import ani.dantotsu.setSafeOnClickListener
|
||||||
import ani.dantotsu.settings.CurrentNovelReaderSettings
|
import ani.dantotsu.settings.CurrentNovelReaderSettings
|
||||||
import ani.dantotsu.settings.CurrentReaderSettings
|
import ani.dantotsu.settings.CurrentReaderSettings
|
||||||
import ani.dantotsu.settings.NovelReaderSettings
|
import ani.dantotsu.settings.ReaderSettings
|
||||||
import ani.dantotsu.settings.UserInterfaceSettings
|
import ani.dantotsu.settings.UserInterfaceSettings
|
||||||
import ani.dantotsu.snackString
|
import ani.dantotsu.snackString
|
||||||
import ani.dantotsu.themes.ThemeManager
|
import ani.dantotsu.themes.ThemeManager
|
||||||
|
@ -62,7 +62,7 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
private lateinit var binding: ActivityNovelReaderBinding
|
private lateinit var binding: ActivityNovelReaderBinding
|
||||||
private val scope = lifecycleScope
|
private val scope = lifecycleScope
|
||||||
|
|
||||||
lateinit var settings: NovelReaderSettings
|
lateinit var settings: ReaderSettings
|
||||||
private lateinit var uiSettings: UserInterfaceSettings
|
private lateinit var uiSettings: UserInterfaceSettings
|
||||||
|
|
||||||
private var notchHeight: Int? = null
|
private var notchHeight: Int? = null
|
||||||
|
@ -159,9 +159,8 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
ThemeManager(this).applyTheme()
|
ThemeManager(this).applyTheme()
|
||||||
binding = ActivityNovelReaderBinding.inflate(layoutInflater)
|
binding = ActivityNovelReaderBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
settings = loadData("reader_settings", this)
|
||||||
settings = loadData("novel_reader_settings", this)
|
?: ReaderSettings().apply { saveData("reader_settings", this) }
|
||||||
?: NovelReaderSettings().apply { saveData("novel_reader_settings", this) }
|
|
||||||
uiSettings = loadData("ui_settings", this)
|
uiSettings = loadData("ui_settings", this)
|
||||||
?: UserInterfaceSettings().also { saveData("ui_settings", it) }
|
?: UserInterfaceSettings().also { saveData("ui_settings", it) }
|
||||||
|
|
||||||
|
@ -271,7 +270,7 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
binding.bookReader.getAppearance {
|
binding.bookReader.getAppearance {
|
||||||
currentTheme = it
|
currentTheme = it
|
||||||
themes.add(0, it)
|
themes.add(0, it)
|
||||||
settings.default = loadData("${sanitizedBookId}_current_settings") ?: settings.default
|
settings.defaultLN = loadData("${sanitizedBookId}_current_settings") ?: settings.defaultLN
|
||||||
applySettings()
|
applySettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +322,7 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
return when (event.keyCode) {
|
return when (event.keyCode) {
|
||||||
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_PAGE_UP -> {
|
KeyEvent.KEYCODE_VOLUME_UP, KeyEvent.KEYCODE_DPAD_UP, KeyEvent.KEYCODE_PAGE_UP -> {
|
||||||
if (event.keyCode == KeyEvent.KEYCODE_VOLUME_UP)
|
if (event.keyCode == KeyEvent.KEYCODE_VOLUME_UP)
|
||||||
if (!settings.default.volumeButtons)
|
if (!settings.defaultLN.volumeButtons)
|
||||||
return false
|
return false
|
||||||
if (event.action == KeyEvent.ACTION_DOWN) {
|
if (event.action == KeyEvent.ACTION_DOWN) {
|
||||||
onVolumeUp?.invoke()
|
onVolumeUp?.invoke()
|
||||||
|
@ -333,7 +332,7 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
|
|
||||||
KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_PAGE_DOWN -> {
|
KeyEvent.KEYCODE_VOLUME_DOWN, KeyEvent.KEYCODE_DPAD_DOWN, KeyEvent.KEYCODE_PAGE_DOWN -> {
|
||||||
if (event.keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
if (event.keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
|
||||||
if (!settings.default.volumeButtons)
|
if (!settings.defaultLN.volumeButtons)
|
||||||
return false
|
return false
|
||||||
if (event.action == KeyEvent.ACTION_DOWN) {
|
if (event.action == KeyEvent.ACTION_DOWN) {
|
||||||
onVolumeDown?.invoke()
|
onVolumeDown?.invoke()
|
||||||
|
@ -349,13 +348,18 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
|
|
||||||
|
|
||||||
fun applySettings() {
|
fun applySettings() {
|
||||||
saveData("${sanitizedBookId}_current_settings", settings.default)
|
saveData("${sanitizedBookId}_current_settings", settings.defaultLN)
|
||||||
hideBars()
|
hideBars()
|
||||||
|
|
||||||
|
if(settings.defaultLN.useOledTheme) {
|
||||||
|
themes.forEach { theme ->
|
||||||
|
theme.darkBg = Color.parseColor("#000000")
|
||||||
|
}
|
||||||
|
}
|
||||||
currentTheme =
|
currentTheme =
|
||||||
themes.first { it.name.equals(settings.default.currentThemeName, ignoreCase = true) }
|
themes.first { it.name.equals(settings.defaultLN.currentThemeName, ignoreCase = true) }
|
||||||
|
|
||||||
when (settings.default.layout) {
|
when (settings.defaultLN.layout) {
|
||||||
CurrentNovelReaderSettings.Layouts.PAGED -> {
|
CurrentNovelReaderSettings.Layouts.PAGED -> {
|
||||||
currentTheme?.flow = ReaderFlow.PAGINATED
|
currentTheme?.flow = ReaderFlow.PAGINATED
|
||||||
}
|
}
|
||||||
|
@ -366,22 +370,22 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER
|
requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_USER
|
||||||
when (settings.default.dualPageMode) {
|
when (settings.defaultLN.dualPageMode) {
|
||||||
CurrentReaderSettings.DualPageModes.No -> currentTheme?.maxColumnCount = 1
|
CurrentReaderSettings.DualPageModes.No -> currentTheme?.maxColumnCount = 1
|
||||||
CurrentReaderSettings.DualPageModes.Automatic -> currentTheme?.maxColumnCount = 2
|
CurrentReaderSettings.DualPageModes.Automatic -> currentTheme?.maxColumnCount = 2
|
||||||
CurrentReaderSettings.DualPageModes.Force -> requestedOrientation =
|
CurrentReaderSettings.DualPageModes.Force -> requestedOrientation =
|
||||||
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTheme?.lineHeight = settings.default.lineHeight
|
currentTheme?.lineHeight = settings.defaultLN.lineHeight
|
||||||
currentTheme?.gap = settings.default.margin
|
currentTheme?.gap = settings.defaultLN.margin
|
||||||
currentTheme?.maxInlineSize = settings.default.maxInlineSize
|
currentTheme?.maxInlineSize = settings.defaultLN.maxInlineSize
|
||||||
currentTheme?.maxBlockSize = settings.default.maxBlockSize
|
currentTheme?.maxBlockSize = settings.defaultLN.maxBlockSize
|
||||||
currentTheme?.useDark = settings.default.useDarkTheme
|
currentTheme?.useDark = settings.defaultLN.useDarkTheme
|
||||||
|
|
||||||
currentTheme?.let { binding.bookReader.setAppearance(it) }
|
currentTheme?.let { binding.bookReader.setAppearance(it) }
|
||||||
|
|
||||||
if (settings.default.keepScreenOn) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
if (settings.defaultLN.keepScreenOn) window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
else window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
else window.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,7 @@ class NovelReaderSettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
val activity = requireActivity() as NovelReaderActivity
|
val activity = requireActivity() as NovelReaderActivity
|
||||||
val settings = activity.settings.default
|
val settings = activity.settings.defaultLN
|
||||||
|
|
||||||
val themeLabels = activity.themes.map { it.name }
|
val themeLabels = activity.themes.map { it.name }
|
||||||
binding.themeSelect.adapter =
|
binding.themeSelect.adapter =
|
||||||
NoPaddingArrayAdapter(activity, R.layout.item_dropdown, themeLabels)
|
NoPaddingArrayAdapter(activity, R.layout.item_dropdown, themeLabels)
|
||||||
|
@ -49,7 +48,11 @@ class NovelReaderSettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
|
|
||||||
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
override fun onNothingSelected(parent: AdapterView<*>?) {}
|
||||||
}
|
}
|
||||||
|
binding.useOledTheme.isChecked = settings.useOledTheme
|
||||||
|
binding.useOledTheme.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
settings.useOledTheme = isChecked
|
||||||
|
activity.applySettings()
|
||||||
|
}
|
||||||
val layoutList = listOf(
|
val layoutList = listOf(
|
||||||
binding.paged,
|
binding.paged,
|
||||||
binding.continuous
|
binding.continuous
|
||||||
|
@ -173,6 +176,20 @@ class NovelReaderSettingsDialogFragment : BottomSheetDialogFragment() {
|
||||||
binding.maxBlockSize.setText(value.toString())
|
binding.maxBlockSize.setText(value.toString())
|
||||||
activity.applySettings()
|
activity.applySettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
binding.incrementMaxBlockSize.setOnClickListener {
|
||||||
|
val value = binding.maxBlockSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.maxBlockSize = value + 10
|
||||||
|
binding.maxBlockSize.setText(settings.maxBlockSize.toString())
|
||||||
|
activity.applySettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.decrementMaxBlockSize.setOnClickListener {
|
||||||
|
val value = binding.maxBlockSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.maxBlockSize = value - 10
|
||||||
|
binding.maxBlockSize.setText(settings.maxBlockSize.toString())
|
||||||
|
activity.applySettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.useDarkTheme.isChecked = settings.useDarkTheme
|
binding.useDarkTheme.isChecked = settings.useDarkTheme
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package ani.dantotsu.media.user
|
package ani.dantotsu.media.user
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.util.TypedValue
|
import android.util.TypedValue
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -14,9 +15,11 @@ import androidx.lifecycle.MutableLiveData
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.Refresh
|
import ani.dantotsu.Refresh
|
||||||
|
import ani.dantotsu.currContext
|
||||||
import ani.dantotsu.databinding.ActivityListBinding
|
import ani.dantotsu.databinding.ActivityListBinding
|
||||||
import ani.dantotsu.loadData
|
import ani.dantotsu.loadData
|
||||||
import ani.dantotsu.others.LangSet
|
import ani.dantotsu.others.LangSet
|
||||||
|
import ani.dantotsu.saveData
|
||||||
import ani.dantotsu.settings.UserInterfaceSettings
|
import ani.dantotsu.settings.UserInterfaceSettings
|
||||||
import ani.dantotsu.themes.ThemeManager
|
import ani.dantotsu.themes.ThemeManager
|
||||||
import com.google.android.material.tabs.TabLayout
|
import com.google.android.material.tabs.TabLayout
|
||||||
|
@ -144,7 +147,8 @@ class ListActivity : AppCompatActivity() {
|
||||||
R.id.release -> "release"
|
R.id.release -> "release"
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
|
currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)?.edit()
|
||||||
|
?.putString("sort_order", sort)?.apply()
|
||||||
binding.listProgressBar.visibility = View.VISIBLE
|
binding.listProgressBar.visibility = View.VISIBLE
|
||||||
binding.listViewPager.adapter = null
|
binding.listViewPager.adapter = null
|
||||||
scope.launch {
|
scope.launch {
|
||||||
|
|
|
@ -46,7 +46,7 @@ class ListFragment : Fragment() {
|
||||||
binding.listRecyclerView.layoutManager =
|
binding.listRecyclerView.layoutManager =
|
||||||
GridLayoutManager(
|
GridLayoutManager(
|
||||||
requireContext(),
|
requireContext(),
|
||||||
if (grid!!) (screenWidth / 124f).toInt() else 1
|
if (grid!!) (screenWidth / 120f).toInt() else 1
|
||||||
)
|
)
|
||||||
binding.listRecyclerView.adapter = adapter
|
binding.listRecyclerView.adapter = adapter
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,52 +6,115 @@ class LanguageMapper {
|
||||||
fun mapLanguageCodeToName(code: String): String {
|
fun mapLanguageCodeToName(code: String): String {
|
||||||
return when (code) {
|
return when (code) {
|
||||||
"all" -> "Multi"
|
"all" -> "Multi"
|
||||||
|
"af" -> "Afrikaans"
|
||||||
|
"am" -> "Amharic"
|
||||||
"ar" -> "Arabic"
|
"ar" -> "Arabic"
|
||||||
|
"as" -> "Assamese"
|
||||||
|
"az" -> "Azerbaijani"
|
||||||
|
"be" -> "Belarusian"
|
||||||
|
"bg" -> "Bulgarian"
|
||||||
|
"bn" -> "Bengali"
|
||||||
|
"bs" -> "Bosnian"
|
||||||
|
"ca" -> "Catalan"
|
||||||
|
"ceb" -> "Cebuano"
|
||||||
|
"cs" -> "Czech"
|
||||||
|
"da" -> "Danish"
|
||||||
"de" -> "German"
|
"de" -> "German"
|
||||||
|
"el" -> "Greek"
|
||||||
"en" -> "English"
|
"en" -> "English"
|
||||||
|
"en-Us" -> "English (United States)"
|
||||||
|
"eo" -> "Esperanto"
|
||||||
"es" -> "Spanish"
|
"es" -> "Spanish"
|
||||||
|
"es-419" -> "Spanish (Latin America)"
|
||||||
|
"et" -> "Estonian"
|
||||||
|
"eu" -> "Basque"
|
||||||
|
"fa" -> "Persian"
|
||||||
|
"fi" -> "Finnish"
|
||||||
|
"fil" -> "Filipino"
|
||||||
|
"fo" -> "Faroese"
|
||||||
"fr" -> "French"
|
"fr" -> "French"
|
||||||
|
"ga" -> "Irish"
|
||||||
|
"gn" -> "Guarani"
|
||||||
|
"gu" -> "Gujarati"
|
||||||
|
"ha" -> "Hausa"
|
||||||
|
"he" -> "Hebrew"
|
||||||
|
"hi" -> "Hindi"
|
||||||
|
"hr" -> "Croatian"
|
||||||
|
"ht" -> "Haitian Creole"
|
||||||
|
"hu" -> "Hungarian"
|
||||||
|
"hy" -> "Armenian"
|
||||||
"id" -> "Indonesian"
|
"id" -> "Indonesian"
|
||||||
|
"ig" -> "Igbo"
|
||||||
|
"is" -> "Icelandic"
|
||||||
"it" -> "Italian"
|
"it" -> "Italian"
|
||||||
"ja" -> "Japanese"
|
"ja" -> "Japanese"
|
||||||
|
"jv" -> "Javanese"
|
||||||
|
"ka" -> "Georgian"
|
||||||
|
"kk" -> "Kazakh"
|
||||||
|
"km" -> "Khmer"
|
||||||
|
"kn" -> "Kannada"
|
||||||
"ko" -> "Korean"
|
"ko" -> "Korean"
|
||||||
"pl" -> "Polish"
|
"ku" -> "Kurdish"
|
||||||
"pt-BR" -> "Portuguese (Brazil)"
|
"ky" -> "Kyrgyz"
|
||||||
"ru" -> "Russian"
|
"la" -> "Latin"
|
||||||
"th" -> "Thai"
|
"lb" -> "Luxembourgish"
|
||||||
"tr" -> "Turkish"
|
"lo" -> "Lao"
|
||||||
"uk" -> "Ukrainian"
|
|
||||||
"vi" -> "Vietnamese"
|
|
||||||
"zh" -> "Chinese"
|
|
||||||
"zh-Hans" -> "Chinese (Simplified)"
|
|
||||||
"es-419" -> "Spanish (Latin America)"
|
|
||||||
"hu" -> "Hungarian"
|
|
||||||
"zh-habt" -> "Chinese (Hakka)"
|
|
||||||
"zh-hant" -> "Chinese (Traditional)"
|
|
||||||
"ca" -> "Catalan"
|
|
||||||
"bg" -> "Bulgarian"
|
|
||||||
"fa" -> "Persian"
|
|
||||||
"mn" -> "Mongolian"
|
|
||||||
"ro" -> "Romanian"
|
|
||||||
"he" -> "Hebrew"
|
|
||||||
"ms" -> "Malay"
|
|
||||||
"tl" -> "Tagalog"
|
|
||||||
"hi" -> "Hindi"
|
|
||||||
"my" -> "Burmese"
|
|
||||||
"cs" -> "Czech"
|
|
||||||
"pt" -> "Portuguese"
|
|
||||||
"nl" -> "Dutch"
|
|
||||||
"sv" -> "Swedish"
|
|
||||||
"bn" -> "Bengali"
|
|
||||||
"no" -> "Norwegian"
|
|
||||||
"el" -> "Greek"
|
|
||||||
"sr" -> "Serbian"
|
|
||||||
"da" -> "Danish"
|
|
||||||
"lt" -> "Lithuanian"
|
"lt" -> "Lithuanian"
|
||||||
|
"lv" -> "Latvian"
|
||||||
|
"mg" -> "Malagasy"
|
||||||
|
"mi" -> "Maori"
|
||||||
|
"mk" -> "Macedonian"
|
||||||
"ml" -> "Malayalam"
|
"ml" -> "Malayalam"
|
||||||
|
"mn" -> "Mongolian"
|
||||||
|
"mo" -> "Moldovan"
|
||||||
"mr" -> "Marathi"
|
"mr" -> "Marathi"
|
||||||
|
"ms" -> "Malay"
|
||||||
|
"mt" -> "Maltese"
|
||||||
|
"my" -> "Burmese"
|
||||||
|
"ne" -> "Nepali"
|
||||||
|
"nl" -> "Dutch"
|
||||||
|
"no" -> "Norwegian"
|
||||||
|
"ny" -> "Chichewa"
|
||||||
|
"pl" -> "Polish"
|
||||||
|
"pt" -> "Portuguese"
|
||||||
|
"pt-BR" -> "Portuguese (Brazil)"
|
||||||
|
"pt-PT" -> "Portuguese (Portugal)"
|
||||||
|
"ps" -> "Pashto"
|
||||||
|
"ro" -> "Romanian"
|
||||||
|
"rm" -> "Romansh"
|
||||||
|
"ru" -> "Russian"
|
||||||
|
"sd" -> "Sindhi"
|
||||||
|
"sh" -> "Serbo-Croatian"
|
||||||
|
"si" -> "Sinhala"
|
||||||
|
"sk" -> "Slovak"
|
||||||
|
"sl" -> "Slovenian"
|
||||||
|
"sm" -> "Samoan"
|
||||||
|
"sn" -> "Shona"
|
||||||
|
"so" -> "Somali"
|
||||||
|
"sq" -> "Albanian"
|
||||||
|
"sr" -> "Serbian"
|
||||||
|
"st" -> "Southern Sotho"
|
||||||
|
"sv" -> "Swedish"
|
||||||
|
"sw" -> "Swahili"
|
||||||
"ta" -> "Tamil"
|
"ta" -> "Tamil"
|
||||||
"te" -> "Telugu"
|
"te" -> "Telugu"
|
||||||
|
"tg" -> "Tajik"
|
||||||
|
"th" -> "Thai"
|
||||||
|
"ti" -> "Tigrinya"
|
||||||
|
"tk" -> "Turkmen"
|
||||||
|
"tl" -> "Tagalog"
|
||||||
|
"to" -> "Tongan"
|
||||||
|
"tr" -> "Turkish"
|
||||||
|
"uk" -> "Ukrainian"
|
||||||
|
"ur" -> "Urdu"
|
||||||
|
"uz" -> "Uzbek"
|
||||||
|
"vi" -> "Vietnamese"
|
||||||
|
"yo" -> "Yoruba"
|
||||||
|
"zh" -> "Chinese"
|
||||||
|
"zh-Hans" -> "Chinese (Simplified)"
|
||||||
|
"zh-Hant" -> "Chinese (Traditional)"
|
||||||
|
"zh-Habt" -> "Chinese (Hakka)"
|
||||||
|
"zu" -> "Zulu"
|
||||||
else -> code
|
else -> code
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ data class CurrentNovelReaderSettings(
|
||||||
var justify: Boolean = true,
|
var justify: Boolean = true,
|
||||||
var hyphenation: Boolean = true,
|
var hyphenation: Boolean = true,
|
||||||
var useDarkTheme: Boolean = false,
|
var useDarkTheme: Boolean = false,
|
||||||
|
var useOledTheme: Boolean = false,
|
||||||
var invert: Boolean = false,
|
var invert: Boolean = false,
|
||||||
var maxInlineSize: Int = 720,
|
var maxInlineSize: Int = 720,
|
||||||
var maxBlockSize: Int = 1440,
|
var maxBlockSize: Int = 1440,
|
||||||
|
|
|
@ -67,7 +67,7 @@ class InstalledAnimeExtensionsFragment : Fragment(), SearchQueryHandler {
|
||||||
if (allSettings.isNotEmpty()) {
|
if (allSettings.isNotEmpty()) {
|
||||||
var selectedSetting = allSettings[0]
|
var selectedSetting = allSettings[0]
|
||||||
if (allSettings.size > 1) {
|
if (allSettings.size > 1) {
|
||||||
val names = allSettings.map { it.lang }.toTypedArray()
|
val names = allSettings.sortedBy { it.lang }.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||||
var selectedIndex = 0
|
var selectedIndex = 0
|
||||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||||
.setTitle("Select a Source")
|
.setTitle("Select a Source")
|
||||||
|
|
|
@ -64,7 +64,7 @@ class InstalledMangaExtensionsFragment : Fragment(), SearchQueryHandler {
|
||||||
if (allSettings.isNotEmpty()) {
|
if (allSettings.isNotEmpty()) {
|
||||||
var selectedSetting = allSettings[0]
|
var selectedSetting = allSettings[0]
|
||||||
if (allSettings.size > 1) {
|
if (allSettings.size > 1) {
|
||||||
val names = allSettings.map { it.lang }.toTypedArray()
|
val names = allSettings.sortedBy { it.lang }.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||||
var selectedIndex = 0
|
var selectedIndex = 0
|
||||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||||
.setTitle("Select a Source")
|
.setTitle("Select a Source")
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
package ani.dantotsu.settings
|
|
||||||
|
|
||||||
import java.io.Serializable
|
|
||||||
|
|
||||||
data class NovelReaderSettings(
|
|
||||||
var showSource: Boolean = true,
|
|
||||||
var showSystemBars: Boolean = false,
|
|
||||||
var default: CurrentNovelReaderSettings = CurrentNovelReaderSettings(),
|
|
||||||
var askIndividual: Boolean = true,
|
|
||||||
) : Serializable
|
|
|
@ -8,6 +8,7 @@ data class ReaderSettings(
|
||||||
|
|
||||||
var autoDetectWebtoon: Boolean = true,
|
var autoDetectWebtoon: Boolean = true,
|
||||||
var default: CurrentReaderSettings = CurrentReaderSettings(),
|
var default: CurrentReaderSettings = CurrentReaderSettings(),
|
||||||
|
var defaultLN: CurrentNovelReaderSettings = CurrentNovelReaderSettings(),
|
||||||
|
|
||||||
var askIndividual: Boolean = true,
|
var askIndividual: Boolean = true,
|
||||||
var updateForH: Boolean = false
|
var updateForH: Boolean = false
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
package ani.dantotsu.settings
|
package ani.dantotsu.settings
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import android.widget.AdapterView
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import androidx.core.view.updateLayoutParams
|
import androidx.core.view.updateLayoutParams
|
||||||
|
import ani.dantotsu.NoPaddingArrayAdapter
|
||||||
import ani.dantotsu.R
|
import ani.dantotsu.R
|
||||||
import ani.dantotsu.databinding.ActivityReaderSettingsBinding
|
import ani.dantotsu.databinding.ActivityReaderSettingsBinding
|
||||||
import ani.dantotsu.initActivity
|
import ani.dantotsu.initActivity
|
||||||
import ani.dantotsu.loadData
|
import ani.dantotsu.loadData
|
||||||
|
import ani.dantotsu.media.novel.novelreader.NovelReaderActivity
|
||||||
import ani.dantotsu.navBarHeight
|
import ani.dantotsu.navBarHeight
|
||||||
import ani.dantotsu.others.LangSet
|
import ani.dantotsu.others.LangSet
|
||||||
import ani.dantotsu.saveData
|
import ani.dantotsu.saveData
|
||||||
|
@ -42,7 +46,7 @@ class ReaderSettingsActivity : AppCompatActivity() {
|
||||||
onBackPressedDispatcher.onBackPressed()
|
onBackPressedDispatcher.onBackPressed()
|
||||||
}
|
}
|
||||||
|
|
||||||
//General
|
//Manga Settings
|
||||||
binding.readerSettingsSourceName.isChecked = settings.showSource
|
binding.readerSettingsSourceName.isChecked = settings.showSource
|
||||||
binding.readerSettingsSourceName.setOnCheckedChangeListener { _, isChecked ->
|
binding.readerSettingsSourceName.setOnCheckedChangeListener { _, isChecked ->
|
||||||
settings.showSource = isChecked
|
settings.showSource = isChecked
|
||||||
|
@ -54,14 +58,14 @@ class ReaderSettingsActivity : AppCompatActivity() {
|
||||||
settings.showSystemBars = isChecked
|
settings.showSystemBars = isChecked
|
||||||
saveData(reader, settings)
|
saveData(reader, settings)
|
||||||
}
|
}
|
||||||
|
//Default Manga
|
||||||
binding.readerSettingsAutoWebToon.isChecked = settings.autoDetectWebtoon
|
binding.readerSettingsAutoWebToon.isChecked = settings.autoDetectWebtoon
|
||||||
binding.readerSettingsAutoWebToon.setOnCheckedChangeListener { _, isChecked ->
|
binding.readerSettingsAutoWebToon.setOnCheckedChangeListener { _, isChecked ->
|
||||||
settings.autoDetectWebtoon = isChecked
|
settings.autoDetectWebtoon = isChecked
|
||||||
saveData(reader, settings)
|
saveData(reader, settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Default
|
|
||||||
val layoutList = listOf(
|
val layoutList = listOf(
|
||||||
binding.readerSettingsPaged,
|
binding.readerSettingsPaged,
|
||||||
binding.readerSettingsContinuousPaged,
|
binding.readerSettingsContinuousPaged,
|
||||||
|
@ -185,6 +189,169 @@ class ReaderSettingsActivity : AppCompatActivity() {
|
||||||
saveData(reader, settings)
|
saveData(reader, settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//LN settings
|
||||||
|
val layoutListLN = listOf(
|
||||||
|
binding.LNpaged,
|
||||||
|
binding.LNcontinuous
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.LNlayoutText.text = settings.defaultLN.layout.string
|
||||||
|
var selectedLN = layoutListLN[settings.defaultLN.layout.ordinal]
|
||||||
|
selectedLN.alpha = 1f
|
||||||
|
|
||||||
|
layoutListLN.forEachIndexed { index, imageButton ->
|
||||||
|
imageButton.setOnClickListener {
|
||||||
|
selectedLN.alpha = 0.33f
|
||||||
|
selectedLN = imageButton
|
||||||
|
selectedLN.alpha = 1f
|
||||||
|
settings.defaultLN.layout = CurrentNovelReaderSettings.Layouts[index]
|
||||||
|
?: CurrentNovelReaderSettings.Layouts.PAGED
|
||||||
|
binding.LNlayoutText.text = settings.defaultLN.layout.string
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val dualListLN = listOf(
|
||||||
|
binding.LNdualNo,
|
||||||
|
binding.LNdualAuto,
|
||||||
|
binding.LNdualForce
|
||||||
|
)
|
||||||
|
|
||||||
|
binding.LNdualPageText.text = settings.defaultLN.dualPageMode.toString()
|
||||||
|
var selectedDualLN = dualListLN[settings.defaultLN.dualPageMode.ordinal]
|
||||||
|
selectedDualLN.alpha = 1f
|
||||||
|
|
||||||
|
dualListLN.forEachIndexed { index, imageButton ->
|
||||||
|
imageButton.setOnClickListener {
|
||||||
|
selectedDualLN.alpha = 0.33f
|
||||||
|
selectedDualLN = imageButton
|
||||||
|
selectedDualLN.alpha = 1f
|
||||||
|
settings.defaultLN.dualPageMode = CurrentReaderSettings.DualPageModes[index]
|
||||||
|
?: CurrentReaderSettings.DualPageModes.Automatic
|
||||||
|
binding.LNdualPageText.text = settings.defaultLN.dualPageMode.toString()
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNlineHeight.setText(settings.defaultLN.lineHeight.toString())
|
||||||
|
binding.LNlineHeight.setOnFocusChangeListener { _, hasFocus ->
|
||||||
|
if (!hasFocus) {
|
||||||
|
val value = binding.LNlineHeight.text.toString().toFloatOrNull() ?: 1.4f
|
||||||
|
settings.defaultLN.lineHeight = value
|
||||||
|
binding.LNlineHeight.setText(value.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNincrementLineHeight.setOnClickListener {
|
||||||
|
val value = binding.LNlineHeight.text.toString().toFloatOrNull() ?: 1.4f
|
||||||
|
settings.defaultLN.lineHeight = value + 0.1f
|
||||||
|
binding.LNlineHeight.setText(settings.defaultLN.lineHeight.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNdecrementLineHeight.setOnClickListener {
|
||||||
|
val value = binding.LNlineHeight.text.toString().toFloatOrNull() ?: 1.4f
|
||||||
|
settings.defaultLN.lineHeight = value - 0.1f
|
||||||
|
binding.LNlineHeight.setText(settings.defaultLN.lineHeight.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNmargin.setText(settings.defaultLN.margin.toString())
|
||||||
|
binding.LNmargin.setOnFocusChangeListener { _, hasFocus ->
|
||||||
|
if (!hasFocus) {
|
||||||
|
val value = binding.LNmargin.text.toString().toFloatOrNull() ?: 0.06f
|
||||||
|
settings.defaultLN.margin = value
|
||||||
|
binding.LNmargin.setText(value.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNincrementMargin.setOnClickListener {
|
||||||
|
val value = binding.LNmargin.text.toString().toFloatOrNull() ?: 0.06f
|
||||||
|
settings.defaultLN.margin = value + 0.01f
|
||||||
|
binding.LNmargin.setText(settings.defaultLN.margin.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNdecrementMargin.setOnClickListener {
|
||||||
|
val value = binding.LNmargin.text.toString().toFloatOrNull() ?: 0.06f
|
||||||
|
settings.defaultLN.margin = value - 0.01f
|
||||||
|
binding.LNmargin.setText(settings.defaultLN.margin.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNmaxInlineSize.setText(settings.defaultLN.maxInlineSize.toString())
|
||||||
|
binding.LNmaxInlineSize.setOnFocusChangeListener { _, hasFocus ->
|
||||||
|
if (!hasFocus) {
|
||||||
|
val value = binding.LNmaxInlineSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.defaultLN.maxInlineSize = value
|
||||||
|
binding.LNmaxInlineSize.setText(value.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNincrementMaxInlineSize.setOnClickListener {
|
||||||
|
val value = binding.LNmaxInlineSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.defaultLN.maxInlineSize = value + 10
|
||||||
|
binding.LNmaxInlineSize.setText(settings.defaultLN.maxInlineSize.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNdecrementMaxInlineSize.setOnClickListener {
|
||||||
|
val value = binding.LNmaxInlineSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.defaultLN.maxInlineSize = value - 10
|
||||||
|
binding.LNmaxInlineSize.setText(settings.defaultLN.maxInlineSize.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNmaxBlockSize.setText(settings.defaultLN.maxBlockSize.toString())
|
||||||
|
binding.LNmaxBlockSize.setOnFocusChangeListener { _, hasFocus ->
|
||||||
|
if (!hasFocus) {
|
||||||
|
val value = binding.LNmaxBlockSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.defaultLN.maxBlockSize = value
|
||||||
|
binding.LNmaxBlockSize.setText(value.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.LNincrementMaxBlockSize.setOnClickListener {
|
||||||
|
val value = binding.LNmaxBlockSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.defaultLN.maxInlineSize = value + 10
|
||||||
|
binding.LNmaxBlockSize.setText(settings.defaultLN.maxInlineSize.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNdecrementMaxBlockSize.setOnClickListener {
|
||||||
|
val value = binding.LNmaxBlockSize.text.toString().toIntOrNull() ?: 720
|
||||||
|
settings.defaultLN.maxBlockSize = value - 10
|
||||||
|
binding.LNmaxBlockSize.setText(settings.defaultLN.maxBlockSize.toString())
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNuseDarkTheme.isChecked = settings.defaultLN.useDarkTheme
|
||||||
|
binding.LNuseDarkTheme.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
settings.defaultLN.useDarkTheme = isChecked
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNuseOledTheme.isChecked = settings.defaultLN.useOledTheme
|
||||||
|
binding.LNuseOledTheme.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
settings.defaultLN.useOledTheme = isChecked
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNkeepScreenOn.isChecked = settings.defaultLN.keepScreenOn
|
||||||
|
binding.LNkeepScreenOn.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
settings.defaultLN.keepScreenOn = isChecked
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.LNvolumeButton.isChecked = settings.defaultLN.volumeButtons
|
||||||
|
binding.LNvolumeButton.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
settings.defaultLN.volumeButtons = isChecked
|
||||||
|
saveData(reader, settings)
|
||||||
|
}
|
||||||
|
|
||||||
//Update Progress
|
//Update Progress
|
||||||
binding.readerSettingsAskUpdateProgress.isChecked = settings.askIndividual
|
binding.readerSettingsAskUpdateProgress.isChecked = settings.askIndividual
|
||||||
binding.readerSettingsAskUpdateProgress.setOnCheckedChangeListener { _, isChecked ->
|
binding.readerSettingsAskUpdateProgress.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="32dp"
|
||||||
android:height="24dp"
|
android:height="32dp"
|
||||||
android:viewportWidth="480"
|
android:viewportWidth="700"
|
||||||
android:viewportHeight="480"
|
android:viewportHeight="768"
|
||||||
android:tint="?attr/colorControlNormal">
|
android:tint="?attr/colorControlNormal">
|
||||||
|
<clip-path
|
||||||
|
android:fillColor="#e9e6f4"
|
||||||
|
android:pathData="M125.71,125.71h516.58v516.58h-516.58z"/>
|
||||||
<path
|
<path
|
||||||
android:fillColor="#e9e6f4"
|
android:fillColor="#e9e6f4"
|
||||||
android:pathData="M298.5,303.98c0,10.32 -6.43,17.41 -7.83,18.82l-140,140C62.36,427.38 0,340.98 0,240c0,-132.55 107.45,-240 240,-240L240.5,0L136.18,104.28c-8.92,8.95 -29.67,33.86 -29.68,71.71 0,10.22 2.27,45.73 31.56,73.57a101,101 0,0 0,45.95 24.93v9.4a27.92,27.92 0,0 0,42 24.23l51.64,-29.81a27.23,27.23 0,0 1,14.21 8.11A27.72,27.72 0,0 1,298.5 303.98Z" />
|
android:pathData="M44.26,128C44.26,173.48 80.53,210.4 125.71,211.63L125.71,128.01L642.29,128.01L642.29,639.97L768,639.97L768,128L44.26,128zM642.29,639.97L125.71,639.97L125.71,639.99L642.29,639.99L642.29,639.97zM125.71,639.97L125.71,556.38C80.54,557.6 44.28,594.5 44.26,639.97L125.71,639.97zM125.71,556.38C126.48,556.35 127.23,556.26 128,556.26L384,556.26C479.14,556.26 556.26,479.13 556.26,384C556.26,288.86 479.13,211.74 384,211.74L128,211.74C127.23,211.74 126.48,211.65 125.71,211.63L125.71,286.18L384,286.18C438.02,286.18 481.82,329.98 481.82,384C481.82,438.03 438.02,481.82 384,481.82L125.71,481.82L125.71,556.38zM125.71,481.82L125.71,286.18L0,286.18L0,481.82L125.71,481.82z"/>
|
||||||
<path
|
<path
|
||||||
android:fillColor="#e9e6f4"
|
android:fillColor="#e9e6f4"
|
||||||
android:pathData="M329.34,17.18 L189.26,157.26A27.91,27.91 0,0 0,181.5 176.01a29,29 0,0 0,3.43 12.88,28 28,0 0,1 41,-17l53.73,31c15.36,1.41 44.91,7.64 68.06,33.57S373.5,292.38 373.5,304.02c0,37.74 -20.73,62.68 -29.63,71.65l-0.1,0.1L239.55,480h0.45c132.55,0 240,-107.45 240,-240C480,139.02 417.64,52.62 329.34,17.18Z" />
|
android:pathData="m442,366.7l-76.02,-43.89c-13.32,-7.69 -29.96,1.92 -29.96,17.3v87.78c0,15.38 16.65,24.99 29.96,17.3l76.02,-43.89c13.32,-7.69 13.32,-26.91 0,-34.6Z"/>
|
||||||
<path
|
|
||||||
android:fillColor="#e9e6f4"
|
|
||||||
android:pathData="M299.99,240a11.85,11.85 0,0 1,-6 10.37l-47,27.13 -29,16.76a12,12 0,0 1,-18 -10.37L199.99,196.11a11.95,11.95 0,0 1,18 -10.37l29,16.76 47,27.13A11.85,11.85 0,0 1,299.99 240Z" />
|
|
||||||
</vector>
|
</vector>
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -512,6 +512,25 @@
|
||||||
app:thumbTint="@color/button_switch_track"
|
app:thumbTint="@color/button_switch_track"
|
||||||
tools:ignore="VisualLintButtonSize" />
|
tools:ignore="VisualLintButtonSize" />
|
||||||
|
|
||||||
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
|
android:id="@+id/useOledTheme"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:checked="false"
|
||||||
|
android:drawableStart="@drawable/ic_round_brightness_4_24"
|
||||||
|
android:drawablePadding="16dp"
|
||||||
|
android:elegantTextHeight="true"
|
||||||
|
android:fontFamily="@font/poppins_bold"
|
||||||
|
android:minHeight="64dp"
|
||||||
|
android:text="Use OLED Theme"
|
||||||
|
android:textAlignment="viewStart"
|
||||||
|
android:textColor="?attr/colorOnBackground"
|
||||||
|
app:cornerRadius="0dp"
|
||||||
|
app:drawableTint="?attr/colorPrimary"
|
||||||
|
app:showText="false"
|
||||||
|
app:thumbTint="@color/button_switch_track"
|
||||||
|
tools:ignore="VisualLintButtonSize" />
|
||||||
|
|
||||||
<com.google.android.material.materialswitch.MaterialSwitch
|
<com.google.android.material.materialswitch.MaterialSwitch
|
||||||
android:id="@+id/keepScreenOn"
|
android:id="@+id/keepScreenOn"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:id="@+id/animeSourceLanguageContainer"
|
android:id="@+id/animeSourceLanguageContainer"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_height="56dp"
|
android:layout_height="56dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:hint="Language"
|
android:hint="Language"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue