feat(profile page): Stats, Banner animation

This commit is contained in:
aayush262 2024-03-02 23:01:58 +05:30
parent 2837cad762
commit 86ed721796
6 changed files with 412 additions and 149 deletions

View file

@ -27,7 +27,9 @@ class ProfileFragment(private val user: Query.UserProfile, private val activity:
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val markwon = buildMarkwon(activity, false)
markwon.setMarkdown(binding.profileUserInfo, user.about?:"")
markwon.setMarkdown(binding.profileUserBio, user.about?:"")
binding.userInfoContainer.visibility = if (user.about != null) View.VISIBLE else View.GONE
binding.profileAnimeList.setOnClickListener {
ContextCompat.startActivity(
activity, Intent(activity, ListActivity::class.java)
@ -46,5 +48,15 @@ class ProfileFragment(private val user: Query.UserProfile, private val activity:
}
binding.profileAnimeListImage.loadImage("https://bit.ly/31bsIHq")
binding.profileMangaListImage.loadImage("https://bit.ly/2ZGfcuG")
binding.statsEpisodesWatched.text = user.statistics.anime.episodesWatched.toString()
binding.statsDaysWatched.text = (user.statistics.anime.minutesWatched / (24 * 60)).toString()
binding.statsTotalAnime.text = user.statistics.anime.count.toString()
binding.statsAnimeMeanScore.text = user.statistics.anime.meanScore.toString()
binding.statsChaptersRead.text = user.statistics.manga.chaptersRead.toString()
binding.statsVolumeRead.text = (user.statistics.manga.volumesRead).toString()
binding.statsTotalManga.text = user.statistics.manga.count.toString()
binding.statsMangaMeanScore.text = user.statistics.manga.meanScore.toString()
}
}