feat: desc for every setting

This commit is contained in:
aayush262 2024-04-21 16:02:21 +05:30
parent e475cc5c01
commit 00758af458
15 changed files with 127 additions and 75 deletions

View file

@ -40,6 +40,7 @@ import ani.dantotsu.addons.torrent.TorrentAddonManager
import ani.dantotsu.connections.anilist.Anilist import ani.dantotsu.connections.anilist.Anilist
import ani.dantotsu.connections.anilist.AnilistHomeViewModel import ani.dantotsu.connections.anilist.AnilistHomeViewModel
import ani.dantotsu.databinding.ActivityMainBinding import ani.dantotsu.databinding.ActivityMainBinding
import ani.dantotsu.databinding.DialogUserAgentBinding
import ani.dantotsu.databinding.SplashScreenBinding import ani.dantotsu.databinding.SplashScreenBinding
import ani.dantotsu.home.AnimeFragment import ani.dantotsu.home.AnimeFragment
import ani.dantotsu.home.HomeFragment import ani.dantotsu.home.HomeFragment
@ -493,16 +494,14 @@ class MainActivity : AppCompatActivity() {
val password = CharArray(16).apply { fill('0') } val password = CharArray(16).apply { fill('0') }
// Inflate the dialog layout // Inflate the dialog layout
val dialogView = val dialogView = DialogUserAgentBinding.inflate(layoutInflater)
LayoutInflater.from(this).inflate(R.layout.dialog_user_agent, null) dialogView.userAgentTextBox.hint = "Password"
dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox)?.hint = "Password" dialogView.subtitle.visibility = View.VISIBLE
val subtitleTextView = dialogView.findViewById<TextView>(R.id.subtitle) dialogView.subtitle.text = getString(R.string.enter_password_to_decrypt_file)
subtitleTextView?.visibility = View.VISIBLE
subtitleTextView?.text = getString(R.string.enter_password_to_decrypt_file)
val dialog = AlertDialog.Builder(this, R.style.MyPopup) val dialog = AlertDialog.Builder(this, R.style.MyPopup)
.setTitle("Enter Password") .setTitle("Enter Password")
.setView(dialogView) .setView(dialogView.root)
.setPositiveButton("OK", null) .setPositiveButton("OK", null)
.setNegativeButton("Cancel") { dialog, _ -> .setNegativeButton("Cancel") { dialog, _ ->
password.fill('0') password.fill('0')

View file

@ -1,11 +1,10 @@
package ani.dantotsu.addons.download package ani.dantotsu.addons
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import ani.dantotsu.addons.AddonListener import ani.dantotsu.addons.download.DownloadAddonManager
import ani.dantotsu.addons.AddonLoader
import ani.dantotsu.addons.torrent.TorrentAddonManager import ani.dantotsu.addons.torrent.TorrentAddonManager
import ani.dantotsu.media.AddonType import ani.dantotsu.media.AddonType
import eu.kanade.tachiyomi.extension.util.ExtensionInstallReceiver import eu.kanade.tachiyomi.extension.util.ExtensionInstallReceiver

View file

@ -5,6 +5,7 @@ import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData import androidx.lifecycle.MutableLiveData
import ani.dantotsu.R import ani.dantotsu.R
import ani.dantotsu.addons.AddonDownloader import ani.dantotsu.addons.AddonDownloader
import ani.dantotsu.addons.AddonInstallReceiver
import ani.dantotsu.addons.AddonListener import ani.dantotsu.addons.AddonListener
import ani.dantotsu.addons.AddonLoader import ani.dantotsu.addons.AddonLoader
import ani.dantotsu.addons.AddonManager import ani.dantotsu.addons.AddonManager

View file

@ -10,7 +10,7 @@ import ani.dantotsu.addons.AddonListener
import ani.dantotsu.addons.AddonLoader import ani.dantotsu.addons.AddonLoader
import ani.dantotsu.addons.AddonManager import ani.dantotsu.addons.AddonManager
import ani.dantotsu.addons.LoadResult import ani.dantotsu.addons.LoadResult
import ani.dantotsu.addons.download.AddonInstallReceiver import ani.dantotsu.addons.AddonInstallReceiver
import ani.dantotsu.media.AddonType import ani.dantotsu.media.AddonType
import ani.dantotsu.util.Logger import ani.dantotsu.util.Logger
import eu.kanade.tachiyomi.extension.InstallStep import eu.kanade.tachiyomi.extension.InstallStep

View file

@ -24,6 +24,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import ani.dantotsu.BottomSheetDialogFragment import ani.dantotsu.BottomSheetDialogFragment
import ani.dantotsu.R import ani.dantotsu.R
import ani.dantotsu.addons.download.DownloadAddonManager
import ani.dantotsu.addons.torrent.TorrentAddonManager import ani.dantotsu.addons.torrent.TorrentAddonManager
import ani.dantotsu.connections.crashlytics.CrashlyticsInterface import ani.dantotsu.connections.crashlytics.CrashlyticsInterface
import ani.dantotsu.copyToClipboard import ani.dantotsu.copyToClipboard
@ -48,6 +49,7 @@ import ani.dantotsu.setSafeOnClickListener
import ani.dantotsu.settings.saving.PrefManager import ani.dantotsu.settings.saving.PrefManager
import ani.dantotsu.settings.saving.PrefName import ani.dantotsu.settings.saving.PrefName
import ani.dantotsu.snackString import ani.dantotsu.snackString
import ani.dantotsu.toast
import ani.dantotsu.tryWith import ani.dantotsu.tryWith
import ani.dantotsu.util.Logger import ani.dantotsu.util.Logger
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@ -478,6 +480,11 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
media!!.userPreferredName media!!.userPreferredName
) )
} else { } else {
val downloadAddonManager: DownloadAddonManager = Injekt.get()
if (!downloadAddonManager.isAvailable()){
toast("Download Extension not available")
return@setSafeOnClickListener
}
val episode = media!!.anime!!.episodes!![media!!.anime!!.selectedEpisode!!]!! val episode = media!!.anime!!.episodes!![media!!.anime!!.selectedEpisode!!]!!
val selectedVideo = val selectedVideo =
if (extractor.videos.size > episode.selectedVideo) extractor.videos[episode.selectedVideo] else null if (extractor.videos.size > episode.selectedVideo) extractor.videos[episode.selectedVideo] else null
@ -488,7 +495,7 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
if (url.startsWith("magnet:") || url.endsWith(".torrent")) { if (url.startsWith("magnet:") || url.endsWith(".torrent")) {
val torrentExtension = Injekt.get<TorrentAddonManager>() val torrentExtension = Injekt.get<TorrentAddonManager>()
if (!torrentExtension.isAvailable()) { if (!torrentExtension.isAvailable()) {
snackString("Torrent Extension not available") toast("Torrent Extension not available")
return@setSafeOnClickListener return@setSafeOnClickListener
} }
runBlocking { runBlocking {

View file

@ -61,7 +61,7 @@ class SettingsAddonActivity : AppCompatActivity() {
type = 1, type = 1,
name = getString(R.string.anime_downloader_addon), name = getString(R.string.anime_downloader_addon),
desc = getString(R.string.not_installed), desc = getString(R.string.not_installed),
icon = R.drawable.anim_play_to_pause, icon = R.drawable.ic_download_24,
isActivity = true, isActivity = true,
attach = { attach = {
setStatus( setStatus(
@ -85,7 +85,7 @@ class SettingsAddonActivity : AppCompatActivity() {
it.settingsIconRight.setOnClickListener { _ -> it.settingsIconRight.setOnClickListener { _ ->
if (it.settingsDesc.text == getString(R.string.installed)) { if (it.settingsDesc.text == getString(R.string.installed)) {
downloadAddonManager.uninstall() downloadAddonManager.uninstall()
return@setOnClickListener //uninstall logic here return@setOnClickListener
} else { } else {
job = Job() job = Job()
val scope = CoroutineScope(Dispatchers.Main + job) val scope = CoroutineScope(Dispatchers.Main + job)
@ -118,7 +118,7 @@ class SettingsAddonActivity : AppCompatActivity() {
type = 1, type = 1,
name = getString(R.string.torrent_addon), name = getString(R.string.torrent_addon),
desc = getString(R.string.not_installed), desc = getString(R.string.not_installed),
icon = R.drawable.anim_play_to_pause, icon = R.drawable.ic_round_magnet_24,
isActivity = true, isActivity = true,
attach = { attach = {
setStatus( setStatus(
@ -176,15 +176,21 @@ class SettingsAddonActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.enable_torrent), name = getString(R.string.enable_torrent),
desc = getString(R.string.enable_torrent), desc = getString(R.string.enable_torrent_desc),
icon = R.drawable.ic_round_dns_24, icon = R.drawable.ic_round_dns_24,
isChecked = PrefManager.getVal(PrefName.TorrentEnabled), isChecked = PrefManager.getVal(PrefName.TorrentEnabled),
switch = { isChecked, _ -> switch = { isChecked, it ->
if (isChecked && !torrentAddonManager.isAvailable()) {
snackString(getString(R.string.install_torrent_addon))
it.settingsButton.isChecked = false
PrefManager.setVal(PrefName.TorrentEnabled, false)
return@Settings
}
PrefManager.setVal(PrefName.TorrentEnabled, isChecked) PrefManager.setVal(PrefName.TorrentEnabled, isChecked)
Injekt.get<TorrentAddonManager>().extension?.let { Injekt.get<TorrentAddonManager>().extension?.let {
if (isChecked) { if (isChecked) {
lifecycleScope.launchIO { lifecycleScope.launchIO {
if (!ServerService.isRunning() && torrentAddonManager.isAvailable()) { if (!ServerService.isRunning()) {
ServerService.start() ServerService.start()
} }
} }
@ -196,14 +202,13 @@ class SettingsAddonActivity : AppCompatActivity() {
} }
} }
} }
} },
) )
) )
) )
binding.settingsRecyclerView.layoutManager = binding.settingsRecyclerView.layoutManager =
LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false) LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
} }
} }

View file

@ -44,7 +44,7 @@ class SettingsAnimeActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.player_settings), name = getString(R.string.player_settings),
desc = getString(R.string.player_settings), desc = getString(R.string.player_settings_desc),
icon = R.drawable.ic_round_video_settings_24, icon = R.drawable.ic_round_video_settings_24,
onClick = { onClick = {
startActivity(Intent(context, PlayerSettingsActivity::class.java)) startActivity(Intent(context, PlayerSettingsActivity::class.java))
@ -54,7 +54,7 @@ class SettingsAnimeActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.purge_anime_downloads), name = getString(R.string.purge_anime_downloads),
desc = getString(R.string.purge_anime_downloads), desc = getString(R.string.purge_anime_downloads_desc),
icon = R.drawable.ic_round_delete_24, icon = R.drawable.ic_round_delete_24,
onClick = { onClick = {
val dialog = AlertDialog.Builder(context, R.style.MyPopup) val dialog = AlertDialog.Builder(context, R.style.MyPopup)
@ -80,7 +80,7 @@ class SettingsAnimeActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.prefer_dub), name = getString(R.string.prefer_dub),
desc = getString(R.string.prefer_dub), desc = getString(R.string.prefer_dub_desc),
icon = R.drawable.ic_round_audiotrack_24, icon = R.drawable.ic_round_audiotrack_24,
isChecked = PrefManager.getVal(PrefName.SettingsPreferDub), isChecked = PrefManager.getVal(PrefName.SettingsPreferDub),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -90,7 +90,7 @@ class SettingsAnimeActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.show_yt), name = getString(R.string.show_yt),
desc = getString(R.string.show_yt), desc = getString(R.string.show_yt_desc),
icon = R.drawable.ic_round_play_circle_24, icon = R.drawable.ic_round_play_circle_24,
isChecked = PrefManager.getVal(PrefName.ShowYtButton), isChecked = PrefManager.getVal(PrefName.ShowYtButton),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -100,7 +100,7 @@ class SettingsAnimeActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.include_list), name = getString(R.string.include_list),
desc = getString(R.string.include_list), desc = getString(R.string.include_list_anime_desc),
icon = R.drawable.view_list_24, icon = R.drawable.view_list_24,
isChecked = PrefManager.getVal(PrefName.IncludeAnimeList), isChecked = PrefManager.getVal(PrefName.IncludeAnimeList),
switch = { isChecked, _ -> switch = { isChecked, _ ->

View file

@ -18,6 +18,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
import ani.dantotsu.R import ani.dantotsu.R
import ani.dantotsu.connections.anilist.Anilist import ani.dantotsu.connections.anilist.Anilist
import ani.dantotsu.databinding.ActivitySettingsCommonBinding import ani.dantotsu.databinding.ActivitySettingsCommonBinding
import ani.dantotsu.databinding.DialogUserAgentBinding
import ani.dantotsu.download.DownloadsManager import ani.dantotsu.download.DownloadsManager
import ani.dantotsu.initActivity import ani.dantotsu.initActivity
import ani.dantotsu.navBarHeight import ani.dantotsu.navBarHeight
@ -33,7 +34,6 @@ import ani.dantotsu.themes.ThemeManager
import ani.dantotsu.toast import ani.dantotsu.toast
import ani.dantotsu.util.LauncherWrapper import ani.dantotsu.util.LauncherWrapper
import ani.dantotsu.util.StoragePermissions import ani.dantotsu.util.StoragePermissions
import com.google.android.material.textfield.TextInputEditText
import kotlinx.coroutines.DelicateCoroutinesApi import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
@ -136,7 +136,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.ui_settings), name = getString(R.string.ui_settings),
desc = getString(R.string.ui_settings), desc = getString(R.string.ui_settings_desc),
icon = R.drawable.ic_round_auto_awesome_24, icon = R.drawable.ic_round_auto_awesome_24,
onClick = { onClick = {
startActivity( startActivity(
@ -151,7 +151,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.download_manager_select), name = getString(R.string.download_manager_select),
desc = getString(R.string.download_manager_select), desc = getString(R.string.download_manager_select_desc),
icon = R.drawable.ic_download_24, icon = R.drawable.ic_download_24,
onClick = { onClick = {
val managers = arrayOf("Default", "1DM", "ADM") val managers = arrayOf("Default", "1DM", "ADM")
@ -172,7 +172,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.backup_restore), name = getString(R.string.backup_restore),
desc = getString(R.string.backup_restore), desc = getString(R.string.backup_restore_desc),
icon = R.drawable.backup_restore, icon = R.drawable.backup_restore,
onClick = { onClick = {
StoragePermissions.downloadsPermission(context) StoragePermissions.downloadsPermission(context)
@ -227,7 +227,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.change_download_location), name = getString(R.string.change_download_location),
desc = getString(R.string.change_download_location), desc = getString(R.string.change_download_location_desc),
icon = R.drawable.ic_round_source_24, icon = R.drawable.ic_round_source_24,
onClick = { onClick = {
val dialog = AlertDialog.Builder(context, R.style.MyPopup) val dialog = AlertDialog.Builder(context, R.style.MyPopup)
@ -267,7 +267,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.always_continue_content), name = getString(R.string.always_continue_content),
desc = getString(R.string.always_continue_content), desc = getString(R.string.always_continue_content_desc),
icon = R.drawable.ic_round_delete_24, icon = R.drawable.ic_round_delete_24,
isChecked = PrefManager.getVal(PrefName.ContinueMedia), isChecked = PrefManager.getVal(PrefName.ContinueMedia),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -277,7 +277,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.search_source_list), name = getString(R.string.search_source_list),
desc = getString(R.string.search_source_list), desc = getString(R.string.search_source_list_desc),
icon = R.drawable.ic_round_search_sources_24, icon = R.drawable.ic_round_search_sources_24,
isChecked = PrefManager.getVal(PrefName.SearchSources), isChecked = PrefManager.getVal(PrefName.SearchSources),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -287,7 +287,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.recentlyListOnly), name = getString(R.string.recentlyListOnly),
desc = getString(R.string.recentlyListOnly), desc = getString(R.string.recentlyListOnly_desc),
icon = R.drawable.ic_round_new_releases_24, icon = R.drawable.ic_round_new_releases_24,
isChecked = PrefManager.getVal(PrefName.RecentlyListOnly), isChecked = PrefManager.getVal(PrefName.RecentlyListOnly),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -297,7 +297,7 @@ class SettingsCommonActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.adult_only_content), name = getString(R.string.adult_only_content),
desc = getString(R.string.adult_only_content), desc = getString(R.string.adult_only_content_desc),
icon = R.drawable.ic_round_nsfw_24, icon = R.drawable.ic_round_nsfw_24,
isChecked = PrefManager.getVal(PrefName.AdultOnly), isChecked = PrefManager.getVal(PrefName.AdultOnly),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -347,14 +347,15 @@ class SettingsCommonActivity : AppCompatActivity() {
val password = CharArray(16).apply { fill('0') } val password = CharArray(16).apply { fill('0') }
// Inflate the dialog layout // Inflate the dialog layout
val dialogView = LayoutInflater.from(this).inflate(R.layout.dialog_user_agent, null) val dialogView = DialogUserAgentBinding.inflate(layoutInflater)
val box = dialogView.findViewById<TextInputEditText>(R.id.userAgentTextBox) val box = dialogView.userAgentTextBox
box?.hint = getString(R.string.password) box.hint = getString(R.string.password)
box?.setSingleLine() box.setSingleLine()
val dialog = val dialog =
AlertDialog.Builder(this, R.style.MyPopup).setTitle(getString(R.string.enter_password)) AlertDialog.Builder(this, R.style.MyPopup).setTitle(getString(R.string.enter_password))
.setView(dialogView).setPositiveButton(R.string.ok, null) .setView(dialogView.root)
.setPositiveButton(R.string.ok, null)
.setNegativeButton(R.string.cancel) { dialog, _ -> .setNegativeButton(R.string.cancel) { dialog, _ ->
password.fill('0') password.fill('0')
dialog.dismiss() dialog.dismiss()
@ -362,8 +363,8 @@ class SettingsCommonActivity : AppCompatActivity() {
}.create() }.create()
fun handleOkAction() { fun handleOkAction() {
val editText = dialog.findViewById<TextInputEditText>(R.id.userAgentTextBox) val editText = dialogView.userAgentTextBox
if (editText?.text?.isNotBlank() == true) { if (editText.text?.isNotBlank() == true) {
editText.text?.toString()?.trim()?.toCharArray(password) editText.text?.toString()?.trim()?.toCharArray(password)
dialog.dismiss() dialog.dismiss()
callback(password) callback(password)
@ -371,7 +372,7 @@ class SettingsCommonActivity : AppCompatActivity() {
toast(getString(R.string.password_cannot_be_empty)) toast(getString(R.string.password_cannot_be_empty))
} }
} }
box?.setOnEditorActionListener { _, actionId, _ -> box.setOnEditorActionListener { _, actionId, _ ->
if (actionId == EditorInfo.IME_ACTION_DONE) { if (actionId == EditorInfo.IME_ACTION_DONE) {
handleOkAction() handleOkAction()
true true
@ -379,9 +380,8 @@ class SettingsCommonActivity : AppCompatActivity() {
false false
} }
} }
val subtitleTextView = dialogView.findViewById<TextView>(R.id.subtitle) dialogView.subtitle.visibility = View.VISIBLE
subtitleTextView?.visibility = View.VISIBLE if (!isExporting) dialogView.subtitle.text =
if (!isExporting) subtitleTextView?.text =
getString(R.string.enter_password_to_decrypt_file) getString(R.string.enter_password_to_decrypt_file)

View file

@ -162,7 +162,7 @@ class SettingsExtensionsActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.anime_add_repository), name = getString(R.string.anime_add_repository),
desc = getString(R.string.anime_add_repository), desc = getString(R.string.anime_add_repository_desc),
icon = R.drawable.ic_github, icon = R.drawable.ic_github,
onClick = { onClick = {
val dialogView = DialogUserAgentBinding.inflate(layoutInflater) val dialogView = DialogUserAgentBinding.inflate(layoutInflater)
@ -198,7 +198,7 @@ class SettingsExtensionsActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.manga_add_repository), name = getString(R.string.manga_add_repository),
desc = getString(R.string.manga_add_repository), desc = getString(R.string.manga_add_repository_desc),
icon = R.drawable.ic_github, icon = R.drawable.ic_github,
onClick = { onClick = {
val dialogView = DialogUserAgentBinding.inflate(layoutInflater) val dialogView = DialogUserAgentBinding.inflate(layoutInflater)
@ -234,7 +234,7 @@ class SettingsExtensionsActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.user_agent), name = getString(R.string.user_agent),
desc = getString(R.string.NSFWExtention), desc = getString(R.string.user_agent_desc),
icon = R.drawable.ic_round_video_settings_24, icon = R.drawable.ic_round_video_settings_24,
onClick = { onClick = {
val dialogView = DialogUserAgentBinding.inflate(layoutInflater) val dialogView = DialogUserAgentBinding.inflate(layoutInflater)
@ -263,7 +263,7 @@ class SettingsExtensionsActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.force_legacy_installer), name = getString(R.string.force_legacy_installer),
desc = getString(R.string.force_legacy_installer), desc = getString(R.string.force_legacy_installer_desc),
icon = R.drawable.ic_round_new_releases_24, icon = R.drawable.ic_round_new_releases_24,
isChecked = extensionInstaller.get() == BasePreferences.ExtensionInstaller.LEGACY, isChecked = extensionInstaller.get() == BasePreferences.ExtensionInstaller.LEGACY,
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -278,7 +278,7 @@ class SettingsExtensionsActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.skip_loading_extension_icons), name = getString(R.string.skip_loading_extension_icons),
desc = getString(R.string.skip_loading_extension_icons), desc = getString(R.string.skip_loading_extension_icons_desc),
icon = R.drawable.ic_round_no_icon_24, icon = R.drawable.ic_round_no_icon_24,
isChecked = PrefManager.getVal(PrefName.SkipExtensionIcons), isChecked = PrefManager.getVal(PrefName.SkipExtensionIcons),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -288,7 +288,7 @@ class SettingsExtensionsActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.NSFWExtention), name = getString(R.string.NSFWExtention),
desc = getString(R.string.NSFWExtention), desc = getString(R.string.NSFWExtention_desc),
icon = R.drawable.ic_round_nsfw_24, icon = R.drawable.ic_round_nsfw_24,
isChecked = PrefManager.getVal(PrefName.NSFWExtension), isChecked = PrefManager.getVal(PrefName.NSFWExtension),
switch = { isChecked, _ -> switch = { isChecked, _ ->

View file

@ -67,7 +67,7 @@ class SettingsMangaActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.reader_settings), name = getString(R.string.reader_settings),
desc = getString(R.string.reader_settings), desc = getString(R.string.reader_settings_desc),
icon = R.drawable.ic_round_reader_settings, icon = R.drawable.ic_round_reader_settings,
onClick = { onClick = {
startActivity(Intent(context, ReaderSettingsActivity::class.java)) startActivity(Intent(context, ReaderSettingsActivity::class.java))
@ -77,7 +77,7 @@ class SettingsMangaActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.purge_manga_downloads), name = getString(R.string.purge_manga_downloads),
desc = getString(R.string.purge_manga_downloads), desc = getString(R.string.purge_manga_downloads_desc),
icon = R.drawable.ic_round_delete_24, icon = R.drawable.ic_round_delete_24,
onClick = { onClick = {
val dialog = AlertDialog.Builder(context, R.style.MyPopup) val dialog = AlertDialog.Builder(context, R.style.MyPopup)
@ -103,7 +103,7 @@ class SettingsMangaActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.purge_novel_downloads), name = getString(R.string.purge_novel_downloads),
desc = getString(R.string.purge_novel_downloads), desc = getString(R.string.purge_novel_downloads_desc),
icon = R.drawable.ic_round_delete_24, icon = R.drawable.ic_round_delete_24,
onClick = { onClick = {
val dialog = AlertDialog.Builder(context, R.style.MyPopup) val dialog = AlertDialog.Builder(context, R.style.MyPopup)
@ -128,7 +128,7 @@ class SettingsMangaActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.include_list), name = getString(R.string.include_list),
desc = getString(R.string.include_list), desc = getString(R.string.include_list_desc),
icon = R.drawable.view_list_24, icon = R.drawable.view_list_24,
isChecked = PrefManager.getVal(PrefName.IncludeMangaList), isChecked = PrefManager.getVal(PrefName.IncludeMangaList),
switch = { isChecked, _ -> switch = { isChecked, _ ->

View file

@ -105,7 +105,7 @@ class SettingsNotificationActivity : AppCompatActivity() {
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.anilist_notification_filters), name = getString(R.string.anilist_notification_filters),
desc = getString(R.string.anilist_notification_filters), desc = getString(R.string.anilist_notification_filters_desc),
icon = R.drawable.ic_anilist, icon = R.drawable.ic_anilist,
onClick = { onClick = {
val types = NotificationType.entries.map { it.name } val types = NotificationType.entries.map { it.name }
@ -138,10 +138,7 @@ class SettingsNotificationActivity : AppCompatActivity() {
R.string.anilist_notifications_checking_time, R.string.anilist_notifications_checking_time,
aItems[PrefManager.getVal(PrefName.AnilistNotificationInterval)] aItems[PrefManager.getVal(PrefName.AnilistNotificationInterval)]
), ),
desc = getString( desc = getString(R.string.anilist_notifications_checking_time_desc),
R.string.anilist_notifications_checking_time,
aItems[PrefManager.getVal(PrefName.AnilistNotificationInterval)]
),
icon = R.drawable.ic_round_notifications_none_24, icon = R.drawable.ic_round_notifications_none_24,
onClick = { onClick = {
val selected = val selected =
@ -173,10 +170,7 @@ class SettingsNotificationActivity : AppCompatActivity() {
R.string.comment_notification_checking_time, R.string.comment_notification_checking_time,
cItems[PrefManager.getVal(PrefName.CommentNotificationInterval)] cItems[PrefManager.getVal(PrefName.CommentNotificationInterval)]
), ),
desc = getString( desc = getString(R.string.comment_notification_checking_time_desc),
R.string.comment_notification_checking_time,
cItems[PrefManager.getVal(PrefName.CommentNotificationInterval)]
),
icon = R.drawable.ic_round_notifications_none_24, icon = R.drawable.ic_round_notifications_none_24,
onClick = { onClick = {
val selected = val selected =
@ -205,7 +199,7 @@ class SettingsNotificationActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.notification_for_checking_subscriptions), name = getString(R.string.notification_for_checking_subscriptions),
desc = getString(R.string.notification_for_checking_subscriptions), desc = getString(R.string.notification_for_checking_subscriptions_desc),
icon = R.drawable.ic_round_smart_button_24, icon = R.drawable.ic_round_smart_button_24,
isChecked = PrefManager.getVal(PrefName.SubscriptionCheckingNotifications), isChecked = PrefManager.getVal(PrefName.SubscriptionCheckingNotifications),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -221,7 +215,7 @@ class SettingsNotificationActivity : AppCompatActivity() {
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.use_alarm_manager_reliable), name = getString(R.string.use_alarm_manager_reliable),
desc = getString(R.string.use_alarm_manager_reliable), desc = getString(R.string.use_alarm_manager_reliable_desc),
icon = R.drawable.ic_anilist, icon = R.drawable.ic_anilist,
isChecked = PrefManager.getVal(PrefName.UseAlarmManager), isChecked = PrefManager.getVal(PrefName.UseAlarmManager),
switch = { isChecked, view -> switch = { isChecked, view ->

View file

@ -112,7 +112,7 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.oled_theme_variant), name = getString(R.string.oled_theme_variant),
desc = getString(R.string.oled_theme_variant), desc = getString(R.string.oled_theme_variant_desc),
icon = R.drawable.ic_round_brightness_4_24, icon = R.drawable.ic_round_brightness_4_24,
isChecked = PrefManager.getVal(PrefName.UseOLED), isChecked = PrefManager.getVal(PrefName.UseOLED),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -123,7 +123,7 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.use_material_you), name = getString(R.string.use_material_you),
desc = getString(R.string.use_material_you), desc = getString(R.string.use_material_you_desc),
icon = R.drawable.ic_round_new_releases_24, icon = R.drawable.ic_round_new_releases_24,
isChecked = PrefManager.getVal(PrefName.UseMaterialYou), isChecked = PrefManager.getVal(PrefName.UseMaterialYou),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -136,7 +136,7 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.use_unique_theme_for_each_item), name = getString(R.string.use_unique_theme_for_each_item),
desc = getString(R.string.use_unique_theme_for_each_item), desc = getString(R.string.use_unique_theme_for_each_item_desc),
icon = R.drawable.ic_palette, icon = R.drawable.ic_palette,
isChecked = PrefManager.getVal(PrefName.UseSourceTheme), isChecked = PrefManager.getVal(PrefName.UseSourceTheme),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -147,7 +147,7 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
Settings( Settings(
type = 2, type = 2,
name = getString(R.string.use_custom_theme), name = getString(R.string.use_custom_theme),
desc = getString(R.string.use_custom_theme), desc = getString(R.string.use_custom_theme_desc),
icon = R.drawable.ic_palette, icon = R.drawable.ic_palette,
isChecked = PrefManager.getVal(PrefName.UseCustomTheme), isChecked = PrefManager.getVal(PrefName.UseCustomTheme),
switch = { isChecked, _ -> switch = { isChecked, _ ->
@ -160,7 +160,7 @@ class SettingsThemeActivity : AppCompatActivity(), SimpleDialog.OnDialogResultLi
Settings( Settings(
type = 1, type = 1,
name = getString(R.string.color_picker), name = getString(R.string.color_picker),
desc = getString(R.string.color_picker), desc = getString(R.string.color_picker_desc),
icon = R.drawable.ic_palette, icon = R.drawable.ic_palette,
onClick = { onClick = {
val originalColor: Int = PrefManager.getVal(PrefName.CustomThemeInt) val originalColor: Int = PrefManager.getVal(PrefName.CustomThemeInt)

View file

@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24"
android:width="24dp"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M21.7,12.818a1.022,1.022 0,0 1,0 1.445L20.154,15.81l-3.589,-3.589 1.547,-1.548a1.022,1.022 0,0 1,1.444 0ZM9.737,2.3 L8.19,3.846l3.59,3.589 1.546,-1.547a1.021,1.021 0,0 0,0 -1.444L11.181,2.3A1.021,1.021 0,0 0,9.737 2.3ZM4.478,19.522a8.458,8.458 0,0 0,11.963 0l2.269,-2.268 -3.589,-3.589 -2.269,2.268a3.384,3.384 0,0 1,-4.785 -4.785l2.269,-2.269L6.747,5.29 4.478,7.559A8.458,8.458 0,0 0,4.478 19.522Z"/>
</vector>

View file

@ -66,7 +66,7 @@
android:layout_marginHorizontal="24dp" android:layout_marginHorizontal="24dp"
android:nestedScrollingEnabled="false" android:nestedScrollingEnabled="false"
android:requiresFadingEdge="vertical" android:requiresFadingEdge="vertical"
tools:itemCount="1" tools:itemCount="5"
tools:listitem="@layout/item_settings" /> tools:listitem="@layout/item_settings" />
</LinearLayout> </LinearLayout>

View file

@ -188,7 +188,7 @@
<string name="noSdFound">No SD card was Found.</string> <string name="noSdFound">No SD card was Found.</string>
<string name="reader_settings">Reader Settings</string> <string name="reader_settings">Reader Settings</string>
<string name="default_source">Default Source</string> <string name="default_source">Default Source</string>
<string name="show_yt">Show Youtube Link</string> <string name="show_yt">Youtube Link</string>
<string name="default_ep_view">Default Episode Layout</string> <string name="default_ep_view">Default Episode Layout</string>
<string name="default_chp_view">Default Chapter Layout</string> <string name="default_chp_view">Default Chapter Layout</string>
<string name="ui">User Interface</string> <string name="ui">User Interface</string>
@ -404,7 +404,7 @@
\n\n_It is not required to sync both MAL and Anilist accounts._ \n\n_It is not required to sync both MAL and Anilist accounts._
</string> </string>
<string name="notification_for_checking_subscriptions">Show notification for Checking Subscriptions</string> <string name="notification_for_checking_subscriptions">Checking Subscriptions notification</string>
<string name="use_alarm_manager">Use Alarm Manager</string> <string name="use_alarm_manager">Use Alarm Manager</string>
<string name="use_alarm_manager_reliable">Use Alarm Manager for reliable Notifications</string> <string name="use_alarm_manager_reliable">Use Alarm Manager for reliable Notifications</string>
<string name="use_alarm_manager_confirm">Using Alarm Manger can help fight against battery optimization, but may consume more battery. It also requires the Alarm Manager permission.</string> <string name="use_alarm_manager_confirm">Using Alarm Manger can help fight against battery optimization, but may consume more battery. It also requires the Alarm Manager permission.</string>
@ -793,7 +793,7 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="blur">Blur</string> <string name="blur">Blur</string>
<string name="hide_scroll_bar">Hide Scroll Bar</string> <string name="hide_scroll_bar">Hide Scroll Bar</string>
<string name="view_on_anilist">View on AniList</string> <string name="view_on_anilist">View on AniList</string>
<string name="anilist_notification_filters">Choose category to ignore</string> <string name="anilist_notification_filters">Filter Notifications</string>
<string name="anilist_notifications_checking_time">Anilist notifications update frequency : %1$s</string> <string name="anilist_notifications_checking_time">Anilist notifications update frequency : %1$s</string>
<string name="comment_notification_checking_time">Comment notifications update frequency : %1$s</string> <string name="comment_notification_checking_time">Comment notifications update frequency : %1$s</string>
<string name="activities">Activities</string> <string name="activities">Activities</string>
@ -912,9 +912,44 @@ Non quae tempore quo provident laudantium qui illo dolor vel quia dolor et exerc
<string name="devs_desc">Dantotsu\'s very own unpaid labours </string> <string name="devs_desc">Dantotsu\'s very own unpaid labours </string>
<string name="forks_desc">More like Dantotsu</string> <string name="forks_desc">More like Dantotsu</string>
<string name="disclaimer_desc">Something to keep in mind</string> <string name="disclaimer_desc">Something to keep in mind</string>
<string name="enable_torrent_desc">This will run a torrent server in the background</string>
<string name="player_settings_desc">TODO</string>
<string name="purge_anime_downloads_desc">Delete all downloaded Anime</string>
<string name="prefer_dub_desc">Select Dub media by default</string>
<string name="show_yt_desc">Show YouTube links for supported media</string>
<string name="include_list_anime_desc">Include list items in Anime explore page</string>
<string name="ui_settings_desc">TODO</string>
<string name="download_manager_select_desc">Default manager to download Anime</string>
<string name="backup_restore_desc">Your preferred settings everywhere</string>
<string name="change_download_location_desc">Change the location where all the downloaded stuff goes</string>
<string name="always_continue_content_desc">TODO</string>
<string name="search_source_list_desc">Auto-select the next server if the previous server doesn\'t have the media</string>
<string name="recentlyListOnly_desc">Show only your list items in the recent tab</string>
<string name="adult_only_content_desc">Show only adult content in the explore page</string>
<string name="anime_add_repository_desc">Add Anime Extensions from various sources</string>
<string name="manga_add_repository_desc">Add Manga Extensions from various sources</string>
<string name="user_agent_desc">Change your default user agent</string>
<string name="force_legacy_installer_desc">Use the legacy installer to install extensions (For older android phones)</string>
<string name="skip_loading_extension_icons_desc">Don\'t load icons of extensions on the extension page</string>
<string name="NSFWExtention_desc">Remove 18+ extensions from search (May remove some useful extensions)</string>
<string name="reader_settings_desc">TODO</string>
<string name="purge_manga_downloads_desc">Delete all downloaded Manga</string>
<string name="purge_novel_downloads_desc">Delete all downloaded Novels</string>
<string name="include_list_desc">Include list items in Manga explore page</string>
<string name="anilist_notification_filters_desc">Choose category to Ignore</string>
<string name="anilist_notifications_checking_time_desc">Set the frequency you want the app to check for Anilist notifications</string>
<string name="comment_notification_checking_time_desc">Set the frequency you want the app to check for Comment notifications</string>
<string name="notification_for_checking_subscriptions_desc">Show notification for checking Subscriptions</string>
<string name="use_alarm_manager_reliable_desc">Use to bypass the phone\'s battery optimizer</string>
<string name="oled_theme_variant_desc">As dark as it gets</string>
<string name="use_material_you_desc">Use the same color as your wallpaper</string>
<string name="use_unique_theme_for_each_item_desc">Use color from media\'s banner</string>
<string name="use_custom_theme_desc">Use your own color for the theme</string>
<string name="color_picker_desc">Choose a color</string>
<string name="torrent_addon">Torrent Addon</string> <string name="torrent_addon">Torrent Addon</string>
<string name="enable_torrent">Enable torrent</string> <string name="enable_torrent">Enable torrent</string>
<string name="anime_downloader_addon">Anime Downloader Addon</string> <string name="anime_downloader_addon">Anime Downloader Addon</string>
<string name="install_torrent_addon">Install Torrent Addon</string>
<string name="loaded_successfully">Loaded Successfully</string> <string name="loaded_successfully">Loaded Successfully</string>
<string name="not_installed">Not Installed</string> <string name="not_installed">Not Installed</string>
<string name="torrent_extension_not_supported">Torrent extension not supported on this device</string> <string name="torrent_extension_not_supported">Torrent extension not supported on this device</string>