feat: list view for home page media
This commit is contained in:
parent
fdb7f45a3d
commit
42330032c8
8 changed files with 359 additions and 89 deletions
|
@ -34,6 +34,7 @@ import ani.dantotsu.home.status.UserStatusAdapter
|
|||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.media.Media
|
||||
import ani.dantotsu.media.MediaAdaptor
|
||||
import ani.dantotsu.media.MediaListViewActivity
|
||||
import ani.dantotsu.media.user.ListActivity
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.profile.ProfileActivity
|
||||
|
@ -209,13 +210,15 @@ class HomeFragment : Fragment() {
|
|||
recyclerView: RecyclerView,
|
||||
progress: View,
|
||||
empty: View,
|
||||
title: View
|
||||
title: View,
|
||||
more: View
|
||||
) {
|
||||
container.visibility = View.VISIBLE
|
||||
progress.visibility = View.VISIBLE
|
||||
recyclerView.visibility = View.GONE
|
||||
empty.visibility = View.GONE
|
||||
title.visibility = View.INVISIBLE
|
||||
more.visibility = View.INVISIBLE
|
||||
|
||||
mode.observe(viewLifecycleOwner) {
|
||||
recyclerView.visibility = View.GONE
|
||||
|
@ -228,6 +231,14 @@ class HomeFragment : Fragment() {
|
|||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
more.setOnClickListener { _ ->
|
||||
MediaListViewActivity.mediaList = it
|
||||
ContextCompat.startActivity(
|
||||
requireActivity(), Intent(requireActivity(), MediaListViewActivity::class.java)
|
||||
.putExtra("title", getString(R.string.continue_watching)),
|
||||
null
|
||||
)
|
||||
}
|
||||
recyclerView.visibility = View.VISIBLE
|
||||
recyclerView.layoutAnimation =
|
||||
LayoutAnimationController(setSlideIn(), 0.25f)
|
||||
|
@ -235,6 +246,7 @@ class HomeFragment : Fragment() {
|
|||
} else {
|
||||
empty.visibility = View.VISIBLE
|
||||
}
|
||||
more?.visibility = View.VISIBLE
|
||||
title.visibility = View.VISIBLE
|
||||
title.startAnimation(setSlideUp())
|
||||
progress.visibility = View.GONE
|
||||
|
@ -250,7 +262,8 @@ class HomeFragment : Fragment() {
|
|||
binding.homeWatchingRecyclerView,
|
||||
binding.homeWatchingProgressBar,
|
||||
binding.homeWatchingEmpty,
|
||||
binding.homeContinueWatch
|
||||
binding.homeContinueWatch,
|
||||
binding.homeContinueWatchMore
|
||||
)
|
||||
binding.homeWatchingBrowseButton.setOnClickListener {
|
||||
bottomBar.selectTabAt(0)
|
||||
|
@ -262,7 +275,9 @@ class HomeFragment : Fragment() {
|
|||
binding.homeFavAnimeRecyclerView,
|
||||
binding.homeFavAnimeProgressBar,
|
||||
binding.homeFavAnimeEmpty,
|
||||
binding.homeFavAnime
|
||||
binding.homeFavAnime,
|
||||
binding.homeFavAnimeMore
|
||||
|
||||
)
|
||||
|
||||
initRecyclerView(
|
||||
|
@ -271,7 +286,8 @@ class HomeFragment : Fragment() {
|
|||
binding.homePlannedAnimeRecyclerView,
|
||||
binding.homePlannedAnimeProgressBar,
|
||||
binding.homePlannedAnimeEmpty,
|
||||
binding.homePlannedAnime
|
||||
binding.homePlannedAnime,
|
||||
binding.homePlannedAnimeMore
|
||||
)
|
||||
binding.homePlannedAnimeBrowseButton.setOnClickListener {
|
||||
bottomBar.selectTabAt(0)
|
||||
|
@ -283,7 +299,8 @@ class HomeFragment : Fragment() {
|
|||
binding.homeReadingRecyclerView,
|
||||
binding.homeReadingProgressBar,
|
||||
binding.homeReadingEmpty,
|
||||
binding.homeContinueRead
|
||||
binding.homeContinueRead,
|
||||
binding.homeContinueReadMore
|
||||
)
|
||||
binding.homeReadingBrowseButton.setOnClickListener {
|
||||
bottomBar.selectTabAt(2)
|
||||
|
@ -295,7 +312,8 @@ class HomeFragment : Fragment() {
|
|||
binding.homeFavMangaRecyclerView,
|
||||
binding.homeFavMangaProgressBar,
|
||||
binding.homeFavMangaEmpty,
|
||||
binding.homeFavManga
|
||||
binding.homeFavManga,
|
||||
binding.homeFavMangaMore
|
||||
)
|
||||
|
||||
initRecyclerView(
|
||||
|
@ -304,7 +322,8 @@ class HomeFragment : Fragment() {
|
|||
binding.homePlannedMangaRecyclerView,
|
||||
binding.homePlannedMangaProgressBar,
|
||||
binding.homePlannedMangaEmpty,
|
||||
binding.homePlannedManga
|
||||
binding.homePlannedManga,
|
||||
binding.homePlannedMangaMore
|
||||
)
|
||||
binding.homePlannedMangaBrowseButton.setOnClickListener {
|
||||
bottomBar.selectTabAt(2)
|
||||
|
@ -316,7 +335,8 @@ class HomeFragment : Fragment() {
|
|||
binding.homeRecommendedRecyclerView,
|
||||
binding.homeRecommendedProgressBar,
|
||||
binding.homeRecommendedEmpty,
|
||||
binding.homeRecommended
|
||||
binding.homeRecommended,
|
||||
binding.homeRecommendedMore
|
||||
)
|
||||
binding.homeUserStatusContainer.visibility = View.VISIBLE
|
||||
binding.homeUserStatusProgressBar.visibility = View.VISIBLE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue