2018-07-30 15:42:45 +02:00
|
|
|
package com.keylesspalace.tusky.pager
|
|
|
|
|
2018-12-17 15:25:35 +01:00
|
|
|
import androidx.fragment.app.Fragment
|
2019-11-06 20:17:53 +01:00
|
|
|
import androidx.fragment.app.FragmentActivity
|
|
|
|
import com.keylesspalace.tusky.ViewMediaAdapter
|
2018-07-30 15:42:45 +02:00
|
|
|
import com.keylesspalace.tusky.fragment.ViewMediaFragment
|
|
|
|
|
2019-11-06 20:17:53 +01:00
|
|
|
class AvatarImagePagerAdapter(
|
|
|
|
activity: FragmentActivity,
|
|
|
|
private val avatarUrl: String
|
|
|
|
) : ViewMediaAdapter(activity) {
|
|
|
|
|
|
|
|
override fun createFragment(position: Int): Fragment {
|
2018-07-30 15:42:45 +02:00
|
|
|
return if (position == 0) {
|
|
|
|
ViewMediaFragment.newAvatarInstance(avatarUrl)
|
|
|
|
} else {
|
2018-12-17 15:25:35 +01:00
|
|
|
throw IllegalStateException()
|
2018-07-30 15:42:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-06 20:17:53 +01:00
|
|
|
override fun getItemCount() = 1
|
2018-07-30 15:42:45 +02:00
|
|
|
|
2019-11-06 20:17:53 +01:00
|
|
|
override fun onTransitionEnd(position: Int) {
|
2019-08-04 20:22:57 +02:00
|
|
|
}
|
2018-07-30 15:42:45 +02:00
|
|
|
}
|