chore: cleanup
This commit is contained in:
parent
a573fbdc89
commit
ea48809d07
10 changed files with 42 additions and 116 deletions
|
@ -40,6 +40,7 @@ import ani.dantotsu.databinding.ItemTitleTrailerBinding
|
|||
import ani.dantotsu.displayTimer
|
||||
import ani.dantotsu.loadImage
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.profile.User
|
||||
import ani.dantotsu.px
|
||||
import ani.dantotsu.setSafeOnClickListener
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
|
@ -572,6 +573,22 @@ class MediaInfoFragment : Fragment() {
|
|||
parent.addView(root)
|
||||
}
|
||||
}
|
||||
val users = media.users!!
|
||||
if (Anilist.token != null && media.userStatus != null) {
|
||||
users.add(0,
|
||||
User(
|
||||
Anilist.userid!!,
|
||||
Anilist.username!!,
|
||||
Anilist.avatar,
|
||||
Anilist.bg,
|
||||
status = media.userStatus,
|
||||
score = media.userScore.toFloat(),
|
||||
progress = media.userProgress,
|
||||
totalEpisodes = if (type == "ANIME") media.anime?.totalEpisodes else media.manga?.totalChapters,
|
||||
nextAiringEpisode = media.anime?.nextAiringEpisode
|
||||
)
|
||||
)
|
||||
}
|
||||
if (!media.users.isNullOrEmpty() && !offline) {
|
||||
ItemTitleRecyclerBinding.inflate(
|
||||
LayoutInflater.from(context),
|
||||
|
@ -580,7 +597,7 @@ class MediaInfoFragment : Fragment() {
|
|||
).apply {
|
||||
itemTitle.setText(R.string.social)
|
||||
itemRecycler.adapter =
|
||||
MediaSocialAdapter(media.users!!, type, requireActivity())
|
||||
MediaSocialAdapter(users, type, requireActivity())
|
||||
itemRecycler.layoutManager = LinearLayoutManager(
|
||||
requireContext(),
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue