mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-29 14:41:01 +00:00
feat: optimize activity page
This commit is contained in:
@@ -30,8 +30,8 @@ import ani.dantotsu.media.user.ListActivity
|
||||
import ani.dantotsu.navBarHeight
|
||||
import ani.dantotsu.openImage
|
||||
import ani.dantotsu.openLinkInBrowser
|
||||
import ani.dantotsu.others.ImageViewDialog
|
||||
import ani.dantotsu.profile.activity.FeedFragment
|
||||
import ani.dantotsu.profile.activity.ActivityFragment
|
||||
import ani.dantotsu.profile.activity.ActivityFragment.Companion.ActivityType
|
||||
import ani.dantotsu.settings.saving.PrefManager
|
||||
import ani.dantotsu.settings.saving.PrefName
|
||||
import ani.dantotsu.snackString
|
||||
@@ -156,6 +156,7 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
openLinkInBrowser("https://anilist.co/user/${user.name}")
|
||||
true
|
||||
}
|
||||
|
||||
R.id.action_create_new_activity -> {
|
||||
ContextCompat.startActivity(
|
||||
context,
|
||||
@@ -165,6 +166,7 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
)
|
||||
true
|
||||
}
|
||||
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
@@ -177,7 +179,8 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
user.avatar?.medium ?: ""
|
||||
)
|
||||
profileUserName.text = user.name
|
||||
val bannerAnimations: ImageView= if (PrefManager.getVal(PrefName.BannerAnimations)) profileBannerImage else profileBannerImageNoKen
|
||||
val bannerAnimations: ImageView =
|
||||
if (PrefManager.getVal(PrefName.BannerAnimations)) profileBannerImage else profileBannerImageNoKen
|
||||
|
||||
blurImage(
|
||||
bannerAnimations,
|
||||
@@ -199,7 +202,8 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
profileAppBar.addOnOffsetChangedListener(context)
|
||||
|
||||
|
||||
profileFollowerCount.text = (respond.data.followerPage?.pageInfo?.total ?: 0).toString()
|
||||
profileFollowerCount.text =
|
||||
(respond.data.followerPage?.pageInfo?.total ?: 0).toString()
|
||||
profileFollowerCountContainer.setOnClickListener {
|
||||
ContextCompat.startActivity(
|
||||
context,
|
||||
@@ -209,7 +213,8 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
null
|
||||
)
|
||||
}
|
||||
profileFollowingCount.text = (respond.data.followingPage?.pageInfo?.total ?: 0).toString()
|
||||
profileFollowingCount.text =
|
||||
(respond.data.followingPage?.pageInfo?.total ?: 0).toString()
|
||||
profileFollowingCountContainer.setOnClickListener {
|
||||
ContextCompat.startActivity(
|
||||
context,
|
||||
@@ -320,7 +325,7 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
|
||||
override fun getItemCount(): Int = 3
|
||||
override fun createFragment(position: Int): Fragment = when (position) {
|
||||
0 -> ProfileFragment.newInstance(user)
|
||||
1 -> FeedFragment.newInstance(user.id, false, -1)
|
||||
1 -> ActivityFragment(ActivityType.OTHER_USER, user.id)
|
||||
2 -> StatsFragment.newInstance(user)
|
||||
else -> ProfileFragment.newInstance(user)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user