mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-18 14:53:57 +00:00
fix(profile): remove progress in fav media
This commit is contained in:
@@ -43,6 +43,7 @@ class MediaAdaptor(
|
||||
private val activity: FragmentActivity,
|
||||
private val matchParent: Boolean = false,
|
||||
private val viewPager: ViewPager2? = null,
|
||||
private val fav: Boolean = false,
|
||||
) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
@@ -128,6 +129,7 @@ class MediaAdaptor(
|
||||
)
|
||||
b.itemCompactTotal.text = " | ${media.manga.totalChapters ?: "~"}"
|
||||
}
|
||||
b.itemCompactProgressContainer.visibility = if (fav) View.GONE else View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ class ProfileFragment() : Fragment() {
|
||||
binding.profileFavAnimeContainer,
|
||||
binding.profileFavAnimeRecyclerView,
|
||||
binding.profileFavAnimeProgressBar,
|
||||
binding.profileFavAnimeEmpty,
|
||||
binding.profileFavAnime
|
||||
)
|
||||
|
||||
@@ -129,7 +128,6 @@ class ProfileFragment() : Fragment() {
|
||||
binding.profileFavMangaContainer,
|
||||
binding.profileFavMangaRecyclerView,
|
||||
binding.profileFavMangaProgressBar,
|
||||
binding.profileFavMangaEmpty,
|
||||
binding.profileFavManga
|
||||
)
|
||||
|
||||
@@ -186,21 +184,18 @@ class ProfileFragment() : Fragment() {
|
||||
container: View,
|
||||
recyclerView: RecyclerView,
|
||||
progress: View,
|
||||
empty: View,
|
||||
title: View
|
||||
) {
|
||||
container.visibility = View.VISIBLE
|
||||
progress.visibility = View.VISIBLE
|
||||
recyclerView.visibility = View.GONE
|
||||
empty.visibility = View.GONE
|
||||
title.visibility = View.INVISIBLE
|
||||
|
||||
mode.observe(viewLifecycleOwner) {
|
||||
recyclerView.visibility = View.GONE
|
||||
empty.visibility = View.GONE
|
||||
if (it != null) {
|
||||
if (it.isNotEmpty()) {
|
||||
recyclerView.adapter = MediaAdaptor(0, it, requireActivity())
|
||||
recyclerView.adapter = MediaAdaptor(0, it, requireActivity(), fav=true)
|
||||
recyclerView.layoutManager = LinearLayoutManager(
|
||||
requireContext(),
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
@@ -211,7 +206,7 @@ class ProfileFragment() : Fragment() {
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
|
||||
} else {
|
||||
empty.visibility = View.VISIBLE
|
||||
container.visibility = View.GONE
|
||||
}
|
||||
title.visibility = View.VISIBLE
|
||||
title.startAnimation(setSlideUp())
|
||||
|
||||
Reference in New Issue
Block a user