clean Sad's shit
This commit is contained in:
parent
84e300482a
commit
cc5b512441
53 changed files with 652 additions and 466 deletions
|
@ -318,8 +318,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
)
|
||||
if (media.format == "NOVEL") {
|
||||
tabLayout.inflateMenu(R.menu.novel_menu_detail)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
tabLayout.inflateMenu(R.menu.manga_menu_detail)
|
||||
}
|
||||
anime = false
|
||||
|
@ -365,6 +364,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
R.id.info -> {
|
||||
selected = 0
|
||||
}
|
||||
|
||||
R.id.watch, R.id.read -> {
|
||||
selected = 1
|
||||
}
|
||||
|
|
|
@ -29,8 +29,8 @@ class SubtitleDownloader {
|
|||
|
||||
|
||||
val subtitleType = when {
|
||||
responseBody?.contains("[Script Info]") == true -> SubtitleType.ASS
|
||||
responseBody?.contains("WEBVTT") == true -> SubtitleType.VTT
|
||||
responseBody.contains("[Script Info]") == true -> SubtitleType.ASS
|
||||
responseBody.contains("WEBVTT") == true -> SubtitleType.VTT
|
||||
else -> SubtitleType.SRT
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@ import java.util.regex.Pattern
|
|||
|
||||
class AnimeNameAdapter {
|
||||
companion object {
|
||||
const val episodeRegex = "(episode|ep|e)[\\s:.\\-]*([\\d]+\\.?[\\d]*)[\\s:.\\-]*\\(?\\s*(sub|subbed|dub|dubbed)*\\s*\\)?\\s*"
|
||||
const val episodeRegex =
|
||||
"(episode|ep|e)[\\s:.\\-]*([\\d]+\\.?[\\d]*)[\\s:.\\-]*\\(?\\s*(sub|subbed|dub|dubbed)*\\s*\\)?\\s*"
|
||||
const val seasonRegex = "(season|s)[\\s:.\\-]*(\\d+)[\\s:.\\-]*"
|
||||
|
||||
fun findSeasonNumber(text: String): Int? {
|
||||
|
|
|
@ -14,10 +14,9 @@ import androidx.core.content.ContextCompat
|
|||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import ani.dantotsu.*
|
||||
import ani.dantotsu.databinding.DialogLayoutBinding
|
||||
import ani.dantotsu.databinding.ItemAnimeWatchBinding
|
||||
import ani.dantotsu.databinding.ItemChipBinding
|
||||
import ani.dantotsu.databinding.DialogLayoutBinding
|
||||
import ani.dantotsu.media.anime.AnimeNameAdapter
|
||||
import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaDetailsActivity
|
||||
import ani.dantotsu.media.SourceSearchDialogFragment
|
||||
|
@ -45,6 +44,7 @@ class AnimeWatchAdapter(
|
|||
val bind = ItemAnimeWatchBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return ViewHolder(bind)
|
||||
}
|
||||
|
||||
private var nestedDialog: AlertDialog? = null
|
||||
|
||||
|
||||
|
@ -234,11 +234,11 @@ class AnimeWatchAdapter(
|
|||
dialogBinding.animeScanlatorContainer.visibility = View.GONE
|
||||
dialogBinding.animeDownloadContainer.visibility = View.GONE
|
||||
|
||||
nestedDialog = AlertDialog.Builder(fragment.requireContext() , R.style.MyPopup)
|
||||
nestedDialog = AlertDialog.Builder(fragment.requireContext(), R.style.MyPopup)
|
||||
.setTitle("Options")
|
||||
.setView(dialogView)
|
||||
.setPositiveButton("OK") { _, _ ->
|
||||
if (run) fragment.onIconPressed(style, reversed)
|
||||
if (run) fragment.onIconPressed(style, reversed)
|
||||
}
|
||||
.setNegativeButton("Cancel") { _, _ ->
|
||||
}
|
||||
|
@ -311,74 +311,74 @@ class AnimeWatchAdapter(
|
|||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun handleEpisodes() {
|
||||
val binding = _binding
|
||||
if (binding != null) {
|
||||
if (media.anime?.episodes != null) {
|
||||
val episodes = media.anime.episodes!!.keys.toTypedArray()
|
||||
fun handleEpisodes() {
|
||||
val binding = _binding
|
||||
if (binding != null) {
|
||||
if (media.anime?.episodes != null) {
|
||||
val episodes = media.anime.episodes!!.keys.toTypedArray()
|
||||
|
||||
val anilistEp = (media.userProgress ?: 0).plus(1)
|
||||
val appEp = loadData<String>("${media.id}_current_ep")?.toIntOrNull() ?: 1
|
||||
val anilistEp = (media.userProgress ?: 0).plus(1)
|
||||
val appEp = loadData<String>("${media.id}_current_ep")?.toIntOrNull() ?: 1
|
||||
|
||||
var continueEp = (if (anilistEp > appEp) anilistEp else appEp).toString()
|
||||
if (episodes.contains(continueEp)) {
|
||||
binding.animeSourceContinue.visibility = View.VISIBLE
|
||||
handleProgress(
|
||||
binding.itemEpisodeProgressCont,
|
||||
binding.itemEpisodeProgress,
|
||||
binding.itemEpisodeProgressEmpty,
|
||||
media.id,
|
||||
continueEp
|
||||
)
|
||||
if ((binding.itemEpisodeProgress.layoutParams as LinearLayout.LayoutParams).weight > fragment.playerSettings.watchPercentage) {
|
||||
val e = episodes.indexOf(continueEp)
|
||||
if (e != -1 && e + 1 < episodes.size) {
|
||||
continueEp = episodes[e + 1]
|
||||
handleProgress(
|
||||
binding.itemEpisodeProgressCont,
|
||||
binding.itemEpisodeProgress,
|
||||
binding.itemEpisodeProgressEmpty,
|
||||
media.id,
|
||||
continueEp
|
||||
)
|
||||
var continueEp = (if (anilistEp > appEp) anilistEp else appEp).toString()
|
||||
if (episodes.contains(continueEp)) {
|
||||
binding.animeSourceContinue.visibility = View.VISIBLE
|
||||
handleProgress(
|
||||
binding.itemEpisodeProgressCont,
|
||||
binding.itemEpisodeProgress,
|
||||
binding.itemEpisodeProgressEmpty,
|
||||
media.id,
|
||||
continueEp
|
||||
)
|
||||
if ((binding.itemEpisodeProgress.layoutParams as LinearLayout.LayoutParams).weight > fragment.playerSettings.watchPercentage) {
|
||||
val e = episodes.indexOf(continueEp)
|
||||
if (e != -1 && e + 1 < episodes.size) {
|
||||
continueEp = episodes[e + 1]
|
||||
handleProgress(
|
||||
binding.itemEpisodeProgressCont,
|
||||
binding.itemEpisodeProgress,
|
||||
binding.itemEpisodeProgressEmpty,
|
||||
media.id,
|
||||
continueEp
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
val ep = media.anime.episodes!![continueEp]!!
|
||||
val ep = media.anime.episodes!![continueEp]!!
|
||||
|
||||
val cleanedTitle = ep.title?.let { AnimeNameAdapter.removeEpisodeNumber(it) }
|
||||
val cleanedTitle = ep.title?.let { AnimeNameAdapter.removeEpisodeNumber(it) }
|
||||
|
||||
binding.itemEpisodeImage.loadImage(
|
||||
ep.thumb ?: FileUrl[media.banner ?: media.cover], 0
|
||||
)
|
||||
if (ep.filler) binding.itemEpisodeFillerView.visibility = View.VISIBLE
|
||||
binding.animeSourceContinueText.text =
|
||||
currActivity()!!.getString(R.string.continue_episode) + "${ep.number}${if (ep.filler) " - Filler" else ""}${"\n$cleanedTitle"}"
|
||||
binding.animeSourceContinue.setOnClickListener {
|
||||
fragment.onEpisodeClick(continueEp)
|
||||
}
|
||||
if (fragment.continueEp) {
|
||||
if ((binding.itemEpisodeProgress.layoutParams as LinearLayout.LayoutParams).weight < fragment.playerSettings.watchPercentage) {
|
||||
binding.animeSourceContinue.performClick()
|
||||
fragment.continueEp = false
|
||||
binding.itemEpisodeImage.loadImage(
|
||||
ep.thumb ?: FileUrl[media.banner ?: media.cover], 0
|
||||
)
|
||||
if (ep.filler) binding.itemEpisodeFillerView.visibility = View.VISIBLE
|
||||
binding.animeSourceContinueText.text =
|
||||
currActivity()!!.getString(R.string.continue_episode) + "${ep.number}${if (ep.filler) " - Filler" else ""}${"\n$cleanedTitle"}"
|
||||
binding.animeSourceContinue.setOnClickListener {
|
||||
fragment.onEpisodeClick(continueEp)
|
||||
}
|
||||
if (fragment.continueEp) {
|
||||
if ((binding.itemEpisodeProgress.layoutParams as LinearLayout.LayoutParams).weight < fragment.playerSettings.watchPercentage) {
|
||||
binding.animeSourceContinue.performClick()
|
||||
fragment.continueEp = false
|
||||
}
|
||||
}
|
||||
} else {
|
||||
binding.animeSourceContinue.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.animeSourceProgressBar.visibility = View.GONE
|
||||
if (media.anime.episodes!!.isNotEmpty())
|
||||
binding.animeSourceNotFound.visibility = View.GONE
|
||||
else
|
||||
binding.animeSourceNotFound.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.animeSourceContinue.visibility = View.GONE
|
||||
}
|
||||
|
||||
binding.animeSourceProgressBar.visibility = View.GONE
|
||||
if (media.anime.episodes!!.isNotEmpty())
|
||||
binding.animeSourceNotFound.visibility = View.GONE
|
||||
else
|
||||
binding.animeSourceNotFound.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.animeSourceContinue.visibility = View.GONE
|
||||
binding.animeSourceNotFound.visibility = View.GONE
|
||||
clearChips()
|
||||
binding.animeSourceProgressBar.visibility = View.VISIBLE
|
||||
clearChips()
|
||||
binding.animeSourceProgressBar.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setLanguageList(lang: Int, source: Int) {
|
||||
val binding = _binding
|
||||
|
@ -401,7 +401,8 @@ fun handleEpisodes() {
|
|||
parser.extension.sources.map { LanguageMapper.mapLanguageCodeToName(it.lang) }
|
||||
)
|
||||
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
|
||||
|
||||
binding?.animeSourceLanguage?.setAdapter(adapter)
|
||||
|
||||
|
|
|
@ -320,9 +320,10 @@ class AnimeWatchFragment : Fragment() {
|
|||
if (allSettings.isNotEmpty()) {
|
||||
var selectedSetting = allSettings[0]
|
||||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||
val names =
|
||||
allSettings.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
val dialog = AlertDialog.Builder(requireContext() , R.style.MyPopup)
|
||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
.setSingleChoiceItems(names, selectedIndex) { dialog, which ->
|
||||
selectedIndex = which
|
||||
|
|
|
@ -26,18 +26,18 @@ class CustomCastThemeFactory : MediaRouteDialogFactory() {
|
|||
}
|
||||
}
|
||||
|
||||
class CustomMediaRouterChooserDialogFragment: MediaRouteChooserDialogFragment() {
|
||||
class CustomMediaRouterChooserDialogFragment : MediaRouteChooserDialogFragment() {
|
||||
override fun onCreateChooserDialog(
|
||||
context: Context,
|
||||
savedInstanceState: Bundle?
|
||||
context: Context,
|
||||
savedInstanceState: Bundle?
|
||||
): MediaRouteChooserDialog =
|
||||
MediaRouteChooserDialog(context, R.style.MyPopup)
|
||||
MediaRouteChooserDialog(context, R.style.MyPopup)
|
||||
}
|
||||
|
||||
class CustomMediaRouteControllerDialogFragment: MediaRouteControllerDialogFragment() {
|
||||
class CustomMediaRouteControllerDialogFragment : MediaRouteControllerDialogFragment() {
|
||||
override fun onCreateControllerDialog(
|
||||
context: Context,
|
||||
savedInstanceState: Bundle?
|
||||
context: Context,
|
||||
savedInstanceState: Bundle?
|
||||
): MediaRouteControllerDialog =
|
||||
MediaRouteControllerDialog(context, R.style.MyPopup)
|
||||
MediaRouteControllerDialog(context, R.style.MyPopup)
|
||||
}
|
|
@ -11,7 +11,6 @@ import ani.dantotsu.connections.updateProgress
|
|||
import ani.dantotsu.databinding.ItemEpisodeCompactBinding
|
||||
import ani.dantotsu.databinding.ItemEpisodeGridBinding
|
||||
import ani.dantotsu.databinding.ItemEpisodeListBinding
|
||||
import ani.dantotsu.media.anime.AnimeNameAdapter
|
||||
import ani.dantotsu.media.Media
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
|
@ -77,11 +76,11 @@ class EpisodeAdapter(
|
|||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
val ep = arr[position]
|
||||
val title = if (!ep.title.isNullOrEmpty() && ep.title != "null") {
|
||||
ep.title?.let { AnimeNameAdapter.removeEpisodeNumber(it) }
|
||||
} else {
|
||||
ep.number
|
||||
} ?: ""
|
||||
val title = if (!ep.title.isNullOrEmpty() && ep.title != "null") {
|
||||
ep.title?.let { AnimeNameAdapter.removeEpisodeNumber(it) }
|
||||
} else {
|
||||
ep.number
|
||||
} ?: ""
|
||||
|
||||
when (holder) {
|
||||
is EpisodeListViewHolder -> {
|
||||
|
|
|
@ -339,7 +339,8 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
setContentView(binding.root)
|
||||
|
||||
//Initialize
|
||||
isCastApiAvailable = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS
|
||||
isCastApiAvailable = GoogleApiAvailability.getInstance()
|
||||
.isGooglePlayServicesAvailable(this) == ConnectionResult.SUCCESS
|
||||
try {
|
||||
castContext = CastContext.getSharedInstance(this)
|
||||
castPlayer = CastPlayer(castContext!!)
|
||||
|
|
|
@ -23,7 +23,6 @@ import ani.dantotsu.databinding.ItemUrlBinding
|
|||
import ani.dantotsu.download.video.Helper
|
||||
import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaDetailsViewModel
|
||||
import ani.dantotsu.others.Download.download
|
||||
import ani.dantotsu.parsers.VideoExtractor
|
||||
import ani.dantotsu.parsers.VideoType
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
@ -275,7 +274,8 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
|
|||
// media!!.userPreferredName
|
||||
//)
|
||||
val episode = media!!.anime!!.episodes!![media!!.anime!!.selectedEpisode!!]!!
|
||||
val video = if (extractor.videos.size > episode.selectedVideo) extractor.videos[episode.selectedVideo] else null
|
||||
val video =
|
||||
if (extractor.videos.size > episode.selectedVideo) extractor.videos[episode.selectedVideo] else null
|
||||
if (video != null) {
|
||||
Helper.startAnimeDownloadService(
|
||||
requireActivity(),
|
||||
|
@ -284,7 +284,7 @@ class SelectorDialogFragment : BottomSheetDialogFragment() {
|
|||
video,
|
||||
null,
|
||||
media,
|
||||
episode.thumb?.url?: media!!.banner?: media!!.cover
|
||||
episode.thumb?.url ?: media!!.banner ?: media!!.cover
|
||||
)
|
||||
}
|
||||
dismiss()
|
||||
|
|
|
@ -48,7 +48,9 @@ class MangaReadAdapter(
|
|||
val bind = ItemAnimeWatchBinding.inflate(LayoutInflater.from(parent.context), parent, false)
|
||||
return ViewHolder(bind)
|
||||
}
|
||||
|
||||
private var nestedDialog: AlertDialog? = null
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val binding = holder.binding
|
||||
|
@ -211,7 +213,8 @@ class MangaReadAdapter(
|
|||
dialogBinding.animeScanlatorTop.setOnClickListener {
|
||||
val dialogView2 =
|
||||
LayoutInflater.from(currContext()).inflate(R.layout.custom_dialog_layout, null)
|
||||
val checkboxContainer = dialogView2.findViewById<LinearLayout>(R.id.checkboxContainer)
|
||||
val checkboxContainer =
|
||||
dialogView2.findViewById<LinearLayout>(R.id.checkboxContainer)
|
||||
|
||||
// Dynamically add checkboxes
|
||||
options.forEach { option ->
|
||||
|
@ -248,12 +251,12 @@ class MangaReadAdapter(
|
|||
dialog.window?.setDimAmount(0.8f)
|
||||
}
|
||||
|
||||
nestedDialog = AlertDialog.Builder(fragment.requireContext() , R.style.MyPopup)
|
||||
nestedDialog = AlertDialog.Builder(fragment.requireContext(), R.style.MyPopup)
|
||||
.setTitle("Options")
|
||||
.setView(dialogView)
|
||||
.setPositiveButton("OK") { _, _ ->
|
||||
if(run) fragment.onIconPressed(style, reversed)
|
||||
if (dialogBinding.downloadNo.text != "0"){
|
||||
if (run) fragment.onIconPressed(style, reversed)
|
||||
if (dialogBinding.downloadNo.text != "0") {
|
||||
fragment.multiDownload(dialogBinding.downloadNo.text.toString().toInt())
|
||||
}
|
||||
}
|
||||
|
@ -293,6 +296,7 @@ class MangaReadAdapter(
|
|||
0
|
||||
)
|
||||
}
|
||||
|
||||
val startChapter = MangaNameAdapter.findChapterNumber(names[limit * (position)])
|
||||
val endChapter = MangaNameAdapter.findChapterNumber(names[last - 1])
|
||||
val startChapterString = if (startChapter != null) {
|
||||
|
@ -425,7 +429,8 @@ class MangaReadAdapter(
|
|||
parser.extension.sources.map { LanguageMapper.mapLanguageCodeToName(it.lang) }
|
||||
)
|
||||
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
|
||||
|
||||
binding?.animeSourceLanguage?.setAdapter(adapter)
|
||||
|
||||
|
|
|
@ -197,12 +197,15 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
|||
override fun onScanlatorsSelected() {
|
||||
updateChapters()
|
||||
}
|
||||
|
||||
fun multiDownload(n: Int) {
|
||||
//get last viewed chapter
|
||||
val selected = media.userProgress
|
||||
val chapters = media.manga?.chapters?.values?.toList()
|
||||
//filter by selected language
|
||||
val progressChapterIndex = (chapters?.indexOfFirst { MangaNameAdapter.findChapterNumber(it.number)?.toInt() == selected } ?: 0) + 1
|
||||
val progressChapterIndex = (chapters?.indexOfFirst {
|
||||
MangaNameAdapter.findChapterNumber(it.number)?.toInt() == selected
|
||||
} ?: 0) + 1
|
||||
|
||||
if (progressChapterIndex < 0 || n < 1 || chapters == null) return
|
||||
|
||||
|
@ -363,7 +366,8 @@ open class MangaReadFragment : Fragment(), ScanlatorSelectionListener {
|
|||
if (allSettings.isNotEmpty()) {
|
||||
var selectedSetting = allSettings[0]
|
||||
if (allSettings.size > 1) {
|
||||
val names = allSettings.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||
val names =
|
||||
allSettings.map { LanguageMapper.mapLanguageCodeToName(it.lang) }.toTypedArray()
|
||||
var selectedIndex = 0
|
||||
val dialog = AlertDialog.Builder(requireContext(), R.style.MyPopup)
|
||||
.setTitle("Select a Source")
|
||||
|
|
|
@ -89,7 +89,8 @@ abstract class BaseImageAdapter(
|
|||
}
|
||||
} else {
|
||||
val detector = GestureDetectorCompat(view.context, object : GesturesListener() {
|
||||
override fun onSingleClick(event: MotionEvent) = activity.handleController(event = event)
|
||||
override fun onSingleClick(event: MotionEvent) =
|
||||
activity.handleController(event = event)
|
||||
})
|
||||
view.findViewById<View>(R.id.imgProgCover).apply {
|
||||
setOnTouchListener { _, event ->
|
||||
|
|
|
@ -93,12 +93,14 @@ open class ImageAdapter(
|
|||
override fun getItemCount(): Int = images.size
|
||||
|
||||
override fun isZoomed(): Boolean {
|
||||
val imageView = activity.findViewById<SubsamplingScaleImageView>(R.id.imgProgImageNoGestures)
|
||||
val imageView =
|
||||
activity.findViewById<SubsamplingScaleImageView>(R.id.imgProgImageNoGestures)
|
||||
return imageView.scale > imageView.minScale
|
||||
}
|
||||
|
||||
override fun setZoom(zoom: Float) {
|
||||
val imageView = activity.findViewById<SubsamplingScaleImageView>(R.id.imgProgImageNoGestures)
|
||||
val imageView =
|
||||
activity.findViewById<SubsamplingScaleImageView>(R.id.imgProgImageNoGestures)
|
||||
imageView.setScaleAndCenter(zoom, imageView.center)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -255,7 +255,8 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
showProgressDialog =
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog")?: true else false
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog")
|
||||
?: true else false
|
||||
|
||||
//Chapter Change
|
||||
fun change(index: Int) {
|
||||
|
@ -850,7 +851,8 @@ class MangaReaderActivity : AppCompatActivity() {
|
|||
private fun progress(runnable: Runnable) {
|
||||
if (maxChapterPage - currentChapterPage <= 1 && Anilist.userid != null) {
|
||||
showProgressDialog =
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog")?: true else false
|
||||
if (settings.askIndividual) loadData<Boolean>("${media.id}_progressDialog")
|
||||
?: true else false
|
||||
if (showProgressDialog) {
|
||||
|
||||
val dialogView = layoutInflater.inflate(R.layout.item_custom_dialog, null)
|
||||
|
|
|
@ -42,7 +42,11 @@ class NovelResponseAdapter(
|
|||
.into(binding.itemEpisodeImage)
|
||||
|
||||
val typedValue = TypedValue()
|
||||
fragment.requireContext().theme?.resolveAttribute(com.google.android.material.R.attr.colorOnBackground, typedValue, true)
|
||||
fragment.requireContext().theme?.resolveAttribute(
|
||||
com.google.android.material.R.attr.colorOnBackground,
|
||||
typedValue,
|
||||
true
|
||||
)
|
||||
val color = typedValue.data
|
||||
|
||||
binding.itemEpisodeTitle.text = novel.name
|
||||
|
@ -98,14 +102,19 @@ class NovelResponseAdapter(
|
|||
}
|
||||
|
||||
binding.root.setOnLongClickListener {
|
||||
val builder = androidx.appcompat.app.AlertDialog.Builder(fragment.requireContext(), R.style.DialogTheme)
|
||||
val builder = androidx.appcompat.app.AlertDialog.Builder(
|
||||
fragment.requireContext(),
|
||||
R.style.DialogTheme
|
||||
)
|
||||
builder.setTitle("Delete ${novel.name}?")
|
||||
builder.setMessage("Are you sure you want to delete ${novel.name}?")
|
||||
builder.setPositiveButton("Yes") { _, _ ->
|
||||
downloadedCheckCallback.deleteDownload(novel)
|
||||
deleteDownload(novel.link)
|
||||
snackString("Deleted ${novel.name}")
|
||||
if (binding.itemEpisodeFiller.text.toString().contains("Download", ignoreCase = true)) {
|
||||
if (binding.itemEpisodeFiller.text.toString()
|
||||
.contains("Download", ignoreCase = true)
|
||||
) {
|
||||
binding.itemEpisodeFiller.text = ""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,8 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
|||
Toast.makeText(this, "Please update WebView from PlayStore", Toast.LENGTH_LONG).show()
|
||||
//open playstore
|
||||
val intent = Intent(Intent.ACTION_VIEW)
|
||||
intent.data = Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.webview")
|
||||
intent.data =
|
||||
Uri.parse("https://play.google.com/store/apps/details?id=com.google.android.webview")
|
||||
startActivity(intent)
|
||||
//stop reader
|
||||
finish()
|
||||
|
@ -270,7 +271,8 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
|||
binding.bookReader.getAppearance {
|
||||
currentTheme = it
|
||||
themes.add(0, it)
|
||||
settings.defaultLN = loadData("${sanitizedBookId}_current_settings") ?: settings.defaultLN
|
||||
settings.defaultLN =
|
||||
loadData("${sanitizedBookId}_current_settings") ?: settings.defaultLN
|
||||
applySettings()
|
||||
}
|
||||
|
||||
|
@ -351,7 +353,7 @@ class NovelReaderActivity : AppCompatActivity(), EbookReaderEventListener {
|
|||
saveData("${sanitizedBookId}_current_settings", settings.defaultLN)
|
||||
hideBars()
|
||||
|
||||
if(settings.defaultLN.useOledTheme) {
|
||||
if (settings.defaultLN.useOledTheme) {
|
||||
themes.forEach { theme ->
|
||||
theme.darkBg = Color.parseColor("#000000")
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import ani.dantotsu.databinding.ActivityListBinding
|
|||
import ani.dantotsu.loadData
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.others.LangSet
|
||||
import ani.dantotsu.saveData
|
||||
import ani.dantotsu.settings.UserInterfaceSettings
|
||||
import ani.dantotsu.statusBarHeight
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue