feat: more options in anime and manga side
This commit is contained in:
parent
7951c2cf37
commit
2dc3035a7c
18 changed files with 657 additions and 53 deletions
|
@ -207,6 +207,21 @@ class AnimeFragment : Fragment() {
|
|||
animePageAdapter.updateRecent(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getMovies().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
animePageAdapter.updateMovies(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getTopRated().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
animePageAdapter.updateTopRated(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getMostFav().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
animePageAdapter.updateMostFav(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
if (animePageAdapter.trendingViewPager != null) {
|
||||
animePageAdapter.updateHeight()
|
||||
model.getTrending().observe(viewLifecycleOwner) {
|
||||
|
@ -264,6 +279,7 @@ class AnimeFragment : Fragment() {
|
|||
model.loaded = true
|
||||
model.loadTrending(1)
|
||||
model.loadUpdated()
|
||||
model.loadAll()
|
||||
model.loadPopular(
|
||||
"ANIME", sort = Anilist.sortBy[1], onList = PrefManager.getVal(
|
||||
PrefName.PopularAnimeList
|
||||
|
|
|
@ -212,7 +212,55 @@ class AnimePageAdapter : RecyclerView.Adapter<AnimePageAdapter.AnimePageViewHold
|
|||
binding.animePopular.visibility = View.VISIBLE
|
||||
binding.animePopular.startAnimation(setSlideUp())
|
||||
}
|
||||
fun updateMovies(adaptor: MediaAdaptor) {
|
||||
binding.animeMoviesProgressBar.visibility = View.GONE
|
||||
binding.animeMoviesRecyclerView.adapter = adaptor
|
||||
binding.animeMoviesRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.animeMoviesRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.animeMoviesRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.animeMovies.visibility = View.VISIBLE
|
||||
binding.animeMovies.startAnimation(setSlideUp())
|
||||
binding.animeMoviesRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
|
||||
fun updateTopRated(adaptor: MediaAdaptor) {
|
||||
binding.animeTopRatedProgressBar.visibility = View.GONE
|
||||
binding.animeTopRatedRecyclerView.adapter = adaptor
|
||||
binding.animeTopRatedRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.animeTopRatedRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.animeTopRatedRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.animeTopRated.visibility = View.VISIBLE
|
||||
binding.animeTopRated.startAnimation(setSlideUp())
|
||||
binding.animeTopRatedRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
fun updateMostFav(adaptor: MediaAdaptor) {
|
||||
binding.animeMostFavProgressBar.visibility = View.GONE
|
||||
binding.animeMostFavRecyclerView.adapter = adaptor
|
||||
binding.animeMostFavRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.animeMostFavRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.animeMostFavRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.animeMostFav.visibility = View.VISIBLE
|
||||
binding.animeMostFav.startAnimation(setSlideUp())
|
||||
binding.animeMostFavRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
fun updateAvatar() {
|
||||
if (Anilist.avatar != null && ready.value == true) {
|
||||
trendingBinding.userAvatar.loadImage(Anilist.avatar)
|
||||
|
|
|
@ -165,6 +165,26 @@ class MangaFragment : Fragment() {
|
|||
mangaPageAdapter.updateNovel(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getPopularManga().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
mangaPageAdapter.updateTrendingManga(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getPopularManhwa().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
mangaPageAdapter.updateTrendingManhwa(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getTopRated().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
mangaPageAdapter.updateTopRated(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
model.getMostFav().observe(viewLifecycleOwner) {
|
||||
if (it != null) {
|
||||
mangaPageAdapter.updateMostFav(MediaAdaptor(0, it, requireActivity()))
|
||||
}
|
||||
}
|
||||
if (mangaPageAdapter.trendingViewPager != null) {
|
||||
mangaPageAdapter.updateHeight()
|
||||
model.getTrending().observe(viewLifecycleOwner) {
|
||||
|
@ -238,6 +258,7 @@ class MangaFragment : Fragment() {
|
|||
model.loaded = true
|
||||
model.loadTrending()
|
||||
model.loadTrendingNovel()
|
||||
model.loadAll()
|
||||
model.loadPopular(
|
||||
"MANGA", sort = Anilist.sortBy[1], onList = PrefManager.getVal(
|
||||
PrefName.PopularMangaList
|
||||
|
|
|
@ -180,6 +180,70 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
|
|||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
|
||||
fun updateTrendingManga(adaptor: MediaAdaptor) {
|
||||
binding.mangaTrendingMangaProgressBar.visibility = View.GONE
|
||||
binding.mangaTrendingMangaRecyclerView.adapter = adaptor
|
||||
binding.mangaTrendingMangaRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.mangaTrendingMangaRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.mangaTrendingMangaRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.mangaTrendingManga.visibility = View.VISIBLE
|
||||
binding.mangaTrendingManga.startAnimation(setSlideUp())
|
||||
binding.mangaTrendingMangaRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
fun updateTrendingManhwa(adaptor: MediaAdaptor) {
|
||||
binding.mangaTrendingManhwaProgressBar.visibility = View.GONE
|
||||
binding.mangaTrendingManhwaRecyclerView.adapter = adaptor
|
||||
binding.mangaTrendingManhwaRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.mangaNovelRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.mangaTrendingManhwaRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.mangaTrendingManhwa.visibility = View.VISIBLE
|
||||
binding.mangaTrendingManhwa.startAnimation(setSlideUp())
|
||||
binding.mangaTrendingManhwaRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
fun updateTopRated(adaptor: MediaAdaptor) {
|
||||
binding.mangaTopRatedProgressBar.visibility = View.GONE
|
||||
binding.mangaTopRatedRecyclerView.adapter = adaptor
|
||||
binding.mangaTopRatedRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.mangaTopRatedRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.mangaTopRatedRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.mangaTopRated.visibility = View.VISIBLE
|
||||
binding.mangaTopRated.startAnimation(setSlideUp())
|
||||
binding.mangaTopRatedRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
fun updateMostFav(adaptor: MediaAdaptor) {
|
||||
binding.mangaMostFavProgressBar.visibility = View.GONE
|
||||
binding.mangaMostFavRecyclerView.adapter = adaptor
|
||||
binding.mangaMostFavRecyclerView.layoutManager =
|
||||
LinearLayoutManager(
|
||||
binding.mangaMostFavRecyclerView.context,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
binding.mangaMostFavRecyclerView.visibility = View.VISIBLE
|
||||
|
||||
binding.mangaMostFav.visibility = View.VISIBLE
|
||||
binding.mangaMostFav.startAnimation(setSlideUp())
|
||||
binding.mangaMostFavRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
}
|
||||
fun updateNovel(adaptor: MediaAdaptor) {
|
||||
binding.mangaNovelProgressBar.visibility = View.GONE
|
||||
binding.mangaNovelRecyclerView.adapter = adaptor
|
||||
|
@ -195,8 +259,6 @@ class MangaPageAdapter : RecyclerView.Adapter<MangaPageAdapter.MangaPageViewHold
|
|||
binding.mangaNovel.startAnimation(setSlideUp())
|
||||
binding.mangaNovelRecyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
binding.mangaPopular.visibility = View.VISIBLE
|
||||
binding.mangaPopular.startAnimation(setSlideUp())
|
||||
}
|
||||
|
||||
fun updateAvatar() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue