commit
c3f5a820e4
23 changed files with 164 additions and 51 deletions
2
.github/workflows/beta.yml
vendored
2
.github/workflows/beta.yml
vendored
|
@ -54,7 +54,7 @@ jobs:
|
|||
shell: bash
|
||||
run: |
|
||||
contentbody=$( jq -Rsa . <<< "${{ github.event.head_commit.message }}" )
|
||||
curl -F "payload_json={\"content\":\" Debug-Build **${{ env.VERSION }}**\n\n${contentbody:1:-1}\"}" -F "dantotsu_debug=@app/build/outputs/apk/debug/app-debug.apk" ${{ secrets.DISCORD_WEBHOOK }}
|
||||
curl -F "payload_json={\"content\":\" Debug-Build: <@719439449423085569> **${{ env.VERSION }}**\n\n${contentbody:1:-1}\"}" -F "dantotsu_debug=@app/build/outputs/apk/debug/app-debug.apk" ${{ secrets.DISCORD_WEBHOOK }}
|
||||
|
||||
- name: Delete Old Pre-Releases
|
||||
id: delete-pre-releases
|
||||
|
|
|
@ -15,6 +15,7 @@ import android.content.res.Configuration
|
|||
import android.content.res.Resources.getSystem
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.media.MediaScannerConnection
|
||||
import android.net.ConnectivityManager
|
||||
import android.net.NetworkCapabilities.*
|
||||
|
@ -25,6 +26,7 @@ import android.telephony.TelephonyManager
|
|||
import android.text.InputFilter
|
||||
import android.text.Spanned
|
||||
import android.util.AttributeSet
|
||||
import android.util.TypedValue
|
||||
import android.view.*
|
||||
import android.view.ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
import android.view.animation.*
|
||||
|
@ -48,6 +50,7 @@ import ani.dantotsu.media.Media
|
|||
import ani.dantotsu.parsers.ShowResponse
|
||||
import ani.dantotsu.settings.UserInterfaceSettings
|
||||
import ani.dantotsu.subcriptions.NotificationClickReceiver
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.model.GlideUrl
|
||||
import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade
|
||||
|
@ -211,6 +214,10 @@ open class BottomSheetDialogFragment : BottomSheetDialogFragment() {
|
|||
val behavior = BottomSheetBehavior.from(requireView().parent as View)
|
||||
behavior.state = BottomSheetBehavior.STATE_EXPANDED
|
||||
}
|
||||
val typedValue = TypedValue()
|
||||
val theme = requireContext().theme
|
||||
theme.resolveAttribute(com.google.android.material.R.attr.colorOnSurfaceInverse, typedValue, true)
|
||||
window.navigationBarColor = typedValue.data
|
||||
}
|
||||
|
||||
override fun show(manager: FragmentManager, tag: String?) {
|
||||
|
|
|
@ -17,6 +17,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import android.view.animation.AnticipateInterpolator
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.activity.addCallback
|
||||
import androidx.activity.viewModels
|
||||
import androidx.annotation.OptIn
|
||||
|
@ -46,9 +47,13 @@ import ani.dantotsu.media.MediaDetailsActivity
|
|||
import ani.dantotsu.others.CustomBottomDialog
|
||||
import ani.dantotsu.others.LangSet
|
||||
import ani.dantotsu.others.SharedPreferenceBooleanLiveData
|
||||
import ani.dantotsu.parsers.novel.NovelExtensionManager
|
||||
import ani.dantotsu.settings.UserInterfaceSettings
|
||||
import ani.dantotsu.subcriptions.Subscription.Companion.startSubscription
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
import eu.kanade.domain.source.service.SourcePreferences
|
||||
import eu.kanade.tachiyomi.extension.anime.AnimeExtensionManager
|
||||
import eu.kanade.tachiyomi.extension.manga.MangaExtensionManager
|
||||
import io.noties.markwon.Markwon
|
||||
import io.noties.markwon.SoftBreakAddsNewLinePlugin
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
|
@ -57,6 +62,8 @@ import kotlinx.coroutines.delay
|
|||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import nl.joery.animatedbottombar.AnimatedBottomBar
|
||||
import uy.kohesive.injekt.Injekt
|
||||
import uy.kohesive.injekt.api.get
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
|
@ -154,6 +161,15 @@ class MainActivity : AppCompatActivity() {
|
|||
)
|
||||
}
|
||||
|
||||
val preferences: SourcePreferences = Injekt.get()
|
||||
if (preferences.animeExtensionUpdatesCount().get() > 0 || preferences.mangaExtensionUpdatesCount().get() > 0) {
|
||||
Toast.makeText(
|
||||
this,
|
||||
"You have extension updates available!",
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
|
||||
binding.root.isMotionEventSplittingEnabled = false
|
||||
|
||||
lifecycleScope.launch {
|
||||
|
@ -213,13 +229,13 @@ class MainActivity : AppCompatActivity() {
|
|||
|
||||
}
|
||||
}
|
||||
val offline = getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
val offlineMode = getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
.getBoolean("offlineMode", false)
|
||||
if (!isOnline(this)) {
|
||||
snackString(this@MainActivity.getString(R.string.no_internet_connection))
|
||||
startActivity(Intent(this, NoInternet::class.java))
|
||||
} else {
|
||||
if (offline) {
|
||||
if (offlineMode) {
|
||||
snackString(this@MainActivity.getString(R.string.no_internet_connection))
|
||||
startActivity(Intent(this, NoInternet::class.java))
|
||||
} else {
|
||||
|
|
|
@ -25,6 +25,10 @@ import android.widget.TextView
|
|||
import androidx.annotation.OptIn
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.app.ActivityOptionsCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.util.Pair
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.marginBottom
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
|
@ -187,9 +191,17 @@ class OfflineAnimeFragment : Fragment(), OfflineAnimeSearchListener {
|
|||
return@let
|
||||
}
|
||||
MediaDetailsActivity.mediaSingleton = mediaModel
|
||||
startActivity(
|
||||
ContextCompat.startActivity(
|
||||
requireActivity(),
|
||||
Intent(requireContext(), MediaDetailsActivity::class.java)
|
||||
.putExtra("download", true)
|
||||
.putExtra("download", true),
|
||||
ActivityOptionsCompat.makeSceneTransitionAnimation(
|
||||
requireActivity(),
|
||||
Pair.create(
|
||||
requireActivity().findViewById<ImageView>(R.id.itemCompactImage),
|
||||
ViewCompat.getTransitionName(requireActivity().findViewById(R.id.itemCompactImage))
|
||||
),
|
||||
).toBundle()
|
||||
)
|
||||
} ?: run {
|
||||
snackString("no media found")
|
||||
|
|
|
@ -51,8 +51,8 @@ class OfflineMangaAdapter(
|
|||
val itemScore = view.findViewById<TextView>(R.id.itemCompactScore)
|
||||
val itemScoreBG = view.findViewById<View>(R.id.itemCompactScoreBG)
|
||||
val ongoing = view.findViewById<CardView>(R.id.itemCompactOngoing)
|
||||
val totalchapter = view.findViewById<TextView>(R.id.itemCompactTotal)
|
||||
val typeimage = view.findViewById<ImageView>(R.id.itemCompactTypeImage)
|
||||
val totalChapter = view.findViewById<TextView>(R.id.itemCompactTotal)
|
||||
val typeImage = view.findViewById<ImageView>(R.id.itemCompactTypeImage)
|
||||
val type = view.findViewById<TextView>(R.id.itemCompactRelation)
|
||||
val typeView = view.findViewById<LinearLayout>(R.id.itemCompactType)
|
||||
|
||||
|
@ -61,16 +61,16 @@ class OfflineMangaAdapter(
|
|||
val chapters = view.findViewById<TextView>(R.id.itemTotal)
|
||||
chapters.text = " Chapters"
|
||||
bannerView.setImageURI(item.banner)
|
||||
totalchapter.text = item.totalChapter
|
||||
totalChapter.text = item.totalChapter
|
||||
} else if (style == 1) {
|
||||
val readchapter =
|
||||
val readChapter =
|
||||
view.findViewById<TextView>(R.id.itemCompactUserProgress) // for compact view
|
||||
readchapter.text = item.readChapter
|
||||
totalchapter.text = " | " + item.totalChapter
|
||||
readChapter.text = item.readChapter
|
||||
totalChapter.text = " | " + item.totalChapter
|
||||
}
|
||||
|
||||
// Bind item data to the views
|
||||
typeimage.setImageResource(if (item.type == "Novel") R.drawable.ic_round_book_24 else R.drawable.ic_round_import_contacts_24)
|
||||
typeImage.setImageResource(if (item.type == "Novel") R.drawable.ic_round_book_24 else R.drawable.ic_round_import_contacts_24)
|
||||
type.text = item.type
|
||||
typeView.visibility = View.VISIBLE
|
||||
imageView.setImageURI(item.image)
|
||||
|
|
|
@ -23,6 +23,10 @@ import android.widget.ImageView
|
|||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.cardview.widget.CardView
|
||||
import androidx.core.app.ActivityOptionsCompat
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.core.util.Pair
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.marginBottom
|
||||
import androidx.fragment.app.Fragment
|
||||
import ani.dantotsu.R
|
||||
|
@ -62,7 +66,7 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
private var downloads: List<OfflineMangaModel> = listOf()
|
||||
private lateinit var gridView: GridView
|
||||
private lateinit var adapter: OfflineMangaAdapter
|
||||
private lateinit var total : TextView
|
||||
private lateinit var total: TextView
|
||||
private var uiSettings: UserInterfaceSettings =
|
||||
loadData("ui_settings") ?: UserInterfaceSettings()
|
||||
|
||||
|
@ -132,7 +136,8 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
layoutList.setOnClickListener {
|
||||
selected(it as ImageView)
|
||||
style = 0
|
||||
requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putInt("offline_view", style!!).apply()
|
||||
requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit()
|
||||
.putInt("offline_view", style!!).apply()
|
||||
gridView.visibility = View.GONE
|
||||
gridView = view.findViewById(R.id.gridView)
|
||||
adapter.notifyNewGrid()
|
||||
|
@ -143,13 +148,15 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
layoutcompact.setOnClickListener {
|
||||
selected(it as ImageView)
|
||||
style = 1
|
||||
requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit().putInt("offline_view", style!!).apply()
|
||||
requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit()
|
||||
.putInt("offline_view", style!!).apply()
|
||||
gridView.visibility = View.GONE
|
||||
gridView = view.findViewById(R.id.gridView1)
|
||||
adapter.notifyNewGrid()
|
||||
grid()
|
||||
}
|
||||
gridView = if (style == 0) view.findViewById(R.id.gridView) else view.findViewById(R.id.gridView1)
|
||||
gridView =
|
||||
if (style == 0) view.findViewById(R.id.gridView) else view.findViewById(R.id.gridView1)
|
||||
total = view.findViewById(R.id.total)
|
||||
grid()
|
||||
return view
|
||||
|
@ -164,7 +171,8 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
adapter = OfflineMangaAdapter(requireContext(), downloads, this)
|
||||
gridView.adapter = adapter
|
||||
gridView.scheduleLayoutAnimation()
|
||||
total.text = if (gridView.count > 0) "Manga and Novels (${gridView.count})" else "Empty List"
|
||||
total.text =
|
||||
if (gridView.count > 0) "Manga and Novels (${gridView.count})" else "Empty List"
|
||||
gridView.setOnItemClickListener { _, _, position, _ ->
|
||||
// Get the OfflineMangaModel that was clicked
|
||||
val item = adapter.getItem(position) as OfflineMangaModel
|
||||
|
@ -172,10 +180,19 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
downloadManager.mangaDownloadedTypes.firstOrNull { it.title == item.title }
|
||||
?: downloadManager.novelDownloadedTypes.firstOrNull { it.title == item.title }
|
||||
media?.let {
|
||||
startActivity(
|
||||
ContextCompat.startActivity(
|
||||
requireActivity(),
|
||||
Intent(requireContext(), MediaDetailsActivity::class.java)
|
||||
.putExtra("media", getMedia(it))
|
||||
.putExtra("download", true)
|
||||
.putExtra("download", true),
|
||||
ActivityOptionsCompat.makeSceneTransitionAnimation(
|
||||
requireActivity(),
|
||||
Pair.create(
|
||||
gridView.getChildAt(position)
|
||||
.findViewById<ImageView>(R.id.itemCompactImage),
|
||||
ViewCompat.getTransitionName(requireActivity().findViewById(R.id.itemCompactImage))
|
||||
)
|
||||
).toBundle()
|
||||
)
|
||||
} ?: run {
|
||||
snackString("no media found")
|
||||
|
@ -200,7 +217,8 @@ class OfflineMangaFragment : Fragment(), OfflineMangaSearchListener {
|
|||
downloadManager.removeMedia(item.title, type)
|
||||
getDownloads()
|
||||
adapter.setItems(downloads)
|
||||
total.text = if (gridView.count > 0) "Manga and Novels (${gridView.count})" else "Empty List"
|
||||
total.text =
|
||||
if (gridView.count > 0) "Manga and Novels (${gridView.count})" else "Empty List"
|
||||
}
|
||||
builder.setNegativeButton("No") { _, _ ->
|
||||
// Do nothing
|
||||
|
|
|
@ -2,6 +2,7 @@ package ani.dantotsu.home
|
|||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
|
@ -267,7 +268,8 @@ class AnimeFragment : Fragment() {
|
|||
model.loaded = true
|
||||
model.loadTrending(1)
|
||||
model.loadUpdated()
|
||||
model.loadPopular("ANIME", sort = Anilist.sortBy[1])
|
||||
model.loadPopular("ANIME", sort = Anilist.sortBy[1], onList = requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
.getBoolean("popular_list", false))
|
||||
}
|
||||
live.postValue(false)
|
||||
_binding?.animeRefresh?.isRefreshing = false
|
||||
|
|
|
@ -132,8 +132,15 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
|
|||
|
||||
binding.animeIncludeList.visibility =
|
||||
if (Anilist.userid != null) View.VISIBLE else View.GONE
|
||||
|
||||
binding.animeIncludeList.isChecked = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("popular_list", true) ?: true
|
||||
|
||||
binding.animeIncludeList.setOnCheckedChangeListener { _, isChecked ->
|
||||
onIncludeListClick.invoke(isChecked)
|
||||
|
||||
currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)?.edit()
|
||||
?.putBoolean("popular_list", isChecked)?.apply()
|
||||
}
|
||||
if (ready.value == false)
|
||||
ready.postValue(true)
|
||||
|
|
|
@ -2,6 +2,7 @@ package ani.dantotsu.home
|
|||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
|
@ -241,7 +242,8 @@ class MangaFragment : Fragment() {
|
|||
model.loaded = true
|
||||
model.loadTrending()
|
||||
model.loadTrendingNovel()
|
||||
model.loadPopular("MANGA", sort = Anilist.sortBy[1])
|
||||
model.loadPopular("MANGA", sort = Anilist.sortBy[1], onList = requireContext().getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
.getBoolean("popular_list", false) )
|
||||
}
|
||||
live.postValue(false)
|
||||
_binding?.mangaRefresh?.isRefreshing = false
|
||||
|
|
|
@ -125,10 +125,16 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
|
|||
|
||||
binding.mangaIncludeList.visibility =
|
||||
if (Anilist.userid != null) View.VISIBLE else View.GONE
|
||||
|
||||
binding.mangaIncludeList.isChecked = currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
|
||||
?.getBoolean("popular_list", true) ?: true
|
||||
|
||||
binding.mangaIncludeList.setOnCheckedChangeListener { _, isChecked ->
|
||||
onIncludeListClick.invoke(isChecked)
|
||||
}
|
||||
|
||||
currContext()?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)?.edit()
|
||||
?.putBoolean("popular_list", isChecked)?.apply()
|
||||
}
|
||||
if (ready.value == false)
|
||||
ready.postValue(true)
|
||||
}
|
||||
|
|
|
@ -392,17 +392,23 @@ class MediaAdaptor(
|
|||
Intent(activity, MediaDetailsActivity::class.java).putExtra(
|
||||
"media",
|
||||
media as Serializable
|
||||
), ActivityOptionsCompat.makeSceneTransitionAnimation(
|
||||
),
|
||||
if (itemCompactImage != null) {
|
||||
ActivityOptionsCompat.makeSceneTransitionAnimation(
|
||||
activity,
|
||||
Pair.create(
|
||||
itemCompactImage,
|
||||
ViewCompat.getTransitionName(activity.findViewById(R.id.itemCompactImage))!!
|
||||
),
|
||||
).toBundle()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun longClicked(position: Int): Boolean {
|
||||
if ((mediaList?.size ?: 0) > position && position != -1) {
|
||||
val media = mediaList?.get(position) ?: return false
|
||||
|
|
|
@ -492,6 +492,7 @@ class MediaDetailsActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedLi
|
|||
init {
|
||||
enabled(true)
|
||||
scope.launch {
|
||||
delay(100) //TODO: a listener would be better
|
||||
clicked()
|
||||
}
|
||||
image.setOnClickListener {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ani.dantotsu.media.anime
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.AlertDialog
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
|
@ -125,10 +126,10 @@ class EpisodeAdapter(
|
|||
binding.itemEpisodeFiller.visibility = View.GONE
|
||||
binding.itemEpisodeFillerView.visibility = View.GONE
|
||||
}
|
||||
holder.bind(ep.number, ep.downloadProgress)
|
||||
binding.itemEpisodeDesc.visibility =
|
||||
if (ep.desc != null && ep.desc?.trim(' ') != "") View.VISIBLE else View.GONE
|
||||
binding.itemEpisodeDesc.text = ep.desc ?: ""
|
||||
holder.bind(ep.number, ep.downloadProgress , ep.desc)
|
||||
|
||||
if (media.userProgress != null) {
|
||||
if ((ep.number.toFloatOrNull() ?: 9999f) <= media.userProgress!!.toFloat()) {
|
||||
|
@ -339,7 +340,16 @@ class EpisodeAdapter(
|
|||
fragment.onAnimeEpisodeStopDownloadClick(episodeNumber)
|
||||
return@setOnClickListener
|
||||
} else if (downloadedEpisodes.contains(episodeNumber)) {
|
||||
val builder = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
builder.setTitle("Delete Episode")
|
||||
builder.setMessage("Are you sure you want to delete Episode ${episodeNumber}?")
|
||||
builder.setPositiveButton("Yes") { _, _ ->
|
||||
fragment.onAnimeEpisodeRemoveDownloadClick(episodeNumber)
|
||||
}
|
||||
builder.setNegativeButton("No") { _, _ ->
|
||||
}
|
||||
val dialog = builder.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
return@setOnClickListener
|
||||
} else {
|
||||
fragment.onAnimeEpisodeDownloadClick(episodeNumber)
|
||||
|
@ -354,8 +364,9 @@ class EpisodeAdapter(
|
|||
}
|
||||
}
|
||||
|
||||
fun bind(episodeNumber: String, progress: String?) {
|
||||
fun bind(episodeNumber: String, progress: String?, desc: String?) {
|
||||
if (progress != null) {
|
||||
binding.itemEpisodeDesc.visibility = View.GONE
|
||||
binding.itemDownloadStatus.visibility = View.VISIBLE
|
||||
binding.itemDownloadStatus.text = progress
|
||||
} else {
|
||||
|
@ -366,7 +377,9 @@ class EpisodeAdapter(
|
|||
// Show spinner
|
||||
binding.itemDownload.setImageResource(R.drawable.ic_sync)
|
||||
startOrContinueRotation(episodeNumber)
|
||||
binding.itemEpisodeDesc.visibility = View.GONE
|
||||
} else if (downloadedEpisodes.contains(episodeNumber)) {
|
||||
binding.itemEpisodeDesc.visibility = View.GONE
|
||||
binding.itemDownloadStatus.visibility = View.VISIBLE
|
||||
// Show checkmark
|
||||
binding.itemDownload.setImageResource(R.drawable.ic_circle_check)
|
||||
|
@ -378,6 +391,7 @@ class EpisodeAdapter(
|
|||
}, 1000)
|
||||
} else {
|
||||
binding.itemDownloadStatus.visibility = View.GONE
|
||||
binding.itemEpisodeDesc.visibility = if (desc != null && desc.trim(' ') != "") View.VISIBLE else View.GONE
|
||||
// Show download icon
|
||||
binding.itemDownload.setImageResource(R.drawable.ic_circle_add)
|
||||
binding.itemDownload.rotation = 0f
|
||||
|
|
|
@ -969,6 +969,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
exoPlayer.currentPosition,
|
||||
this
|
||||
)
|
||||
exoPlayer.seekTo(0)
|
||||
val prev = episodeArr[currentEpisodeIndex]
|
||||
isTimeStampsLoaded = false
|
||||
episodeLength = 0f
|
||||
|
@ -1472,7 +1473,10 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
|
||||
|
||||
try {
|
||||
mediaSession = MediaSession.Builder(this, exoPlayer).build()
|
||||
val rightNow = Calendar.getInstance()
|
||||
mediaSession = MediaSession.Builder(this, exoPlayer)
|
||||
.setId(rightNow.timeInMillis.toString())
|
||||
.build()
|
||||
} catch (e: Exception) {
|
||||
toast(e.toString())
|
||||
}
|
||||
|
@ -1556,6 +1560,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
if (castPlayer?.isPlaying == false) {
|
||||
playerView.player?.pause()
|
||||
}
|
||||
if (exoPlayer.currentPosition > 5000) {
|
||||
saveData(
|
||||
"${media.id}_${media.anime!!.selectedEpisode}",
|
||||
exoPlayer.currentPosition,
|
||||
|
@ -1563,6 +1568,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener, SessionAvailabilityL
|
|||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
|
|
@ -218,7 +218,16 @@ class MangaChapterAdapter(
|
|||
fragment.onMangaChapterStopDownloadClick(chapterNumber)
|
||||
return@setOnClickListener
|
||||
} else if (downloadedChapters.contains(chapterNumber)) {
|
||||
val builder = AlertDialog.Builder(currContext(), R.style.MyPopup)
|
||||
builder.setTitle("Delete Chapter")
|
||||
builder.setMessage("Are you sure you want to delete ${chapterNumber}?")
|
||||
builder.setPositiveButton("Yes") { _, _ ->
|
||||
fragment.onMangaChapterRemoveDownloadClick(chapterNumber)
|
||||
}
|
||||
builder.setNegativeButton("No") { _, _ ->
|
||||
}
|
||||
val dialog = builder.show()
|
||||
dialog.window?.setDimAmount(0.8f)
|
||||
return@setOnClickListener
|
||||
} else {
|
||||
fragment.onMangaChapterDownloadClick(chapterNumber)
|
||||
|
|
|
@ -7,6 +7,7 @@ import android.view.LayoutInflater
|
|||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import ani.dantotsu.BottomSheetDialogFragment
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.databinding.BottomSheetCustomBinding
|
||||
|
||||
open class CustomBottomDialog : BottomSheetDialogFragment() {
|
||||
|
@ -55,10 +56,6 @@ open class CustomBottomDialog : BottomSheetDialogFragment() {
|
|||
_binding = BottomSheetCustomBinding.inflate(inflater, container, false)
|
||||
val window = dialog?.window
|
||||
window?.statusBarColor = Color.TRANSPARENT
|
||||
val typedValue = TypedValue()
|
||||
val theme = requireContext().theme
|
||||
theme.resolveAttribute(com.google.android.material.R.attr.colorSurface, typedValue, true)
|
||||
window?.navigationBarColor = typedValue.data
|
||||
return binding.root
|
||||
}
|
||||
|
||||
|
|
|
@ -308,11 +308,13 @@
|
|||
android:text="@string/popular_anime"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/animeIncludeList"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:checked="true"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/include_media_in_list" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
android:id="@+id/listAppBar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorSurface"
|
||||
android:background="?attr/colorSurfaceVariant"
|
||||
android:theme="@style/Theme.Dantotsu.AppBarOverlay">
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
android:background="@drawable/card_outline"
|
||||
app:cardCornerRadius="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurfaceVariant"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/itemEpisodeProgressCont"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/colorSurfaceVariant"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -264,12 +264,14 @@
|
|||
android:text="@string/popular_manga"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/mangaIncludeList"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/include_media_in_list"
|
||||
android:checked="true"/>
|
||||
android:checked="true"
|
||||
android:textSize="12sp"
|
||||
android:fontFamily="@font/poppins_bold"
|
||||
android:text="@string/include_media_in_list" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
<item name="colorSurfaceVariant">@color/md_theme_dark_5_surfaceVariant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_theme_dark_5_onSurfaceVariant</item>
|
||||
<item name="colorOutline">@color/md_theme_dark_5_outline</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_dark_5_inverseOnSurface</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_dark_5_surface</item>
|
||||
<item name="colorSurfaceInverse">@color/md_theme_dark_5_inverseSurface</item>
|
||||
<item name="colorPrimaryInverse">@color/md_theme_dark_5_inversePrimary</item>
|
||||
</style>
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
<item name="colorSurfaceVariant">@color/md_theme_light_5_surfaceVariant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_theme_light_5_onSurfaceVariant</item>
|
||||
<item name="colorOutline">@color/md_theme_light_5_outline</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_light_5_inverseOnSurface</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_light_5_surface</item>
|
||||
<item name="colorSurfaceInverse">@color/md_theme_light_5_inverseSurface</item>
|
||||
<item name="colorPrimaryInverse">@color/md_theme_light_5_inversePrimary</item>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue