feat: Delete,edit activity

This commit is contained in:
aayush262 2024-05-28 01:04:07 +05:30
parent 6878d12b5c
commit ea75197120
16 changed files with 336 additions and 208 deletions

View file

@ -136,7 +136,7 @@ class ProfileActivity : AppCompatActivity(), AppBarLayout.OnOffsetChangedListene
followButton.setOnClickListener {
lifecycleScope.launch(Dispatchers.IO) {
val res = Anilist.query.toggleFollow(user.id)
val res = Anilist.mutation.toggleFollow(user.id)
if (res?.data?.toggleFollow != null) {
withContext(Dispatchers.Main) {
snackString(R.string.success)
@ -325,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 -> ActivityFragment(ActivityType.OTHER_USER, user.id)
1 -> ActivityFragment.newInstance(ActivityType.OTHER_USER, user.id)
2 -> StatsFragment.newInstance(user)
else -> ProfileFragment.newInstance(user)
}