a445c12094
* upgrade to AndroidX, upgrade libraries * move to MaterialComponents theme * make sure the compose button looks good everywhere * fix tollbar title/button alignment on tablet * move to new material color theming, consolidate colors and themes * fix build, fix imports * set error on TextInputLayout instead of EditText * fix imports, TootButton when * improve snackbar style * fix task description color
23 lines
667 B
Kotlin
23 lines
667 B
Kotlin
package com.keylesspalace.tusky.pager
|
|
|
|
import androidx.fragment.app.Fragment
|
|
import androidx.fragment.app.FragmentManager
|
|
import androidx.fragment.app.FragmentPagerAdapter
|
|
|
|
import com.keylesspalace.tusky.fragment.ViewMediaFragment
|
|
import java.lang.IllegalStateException
|
|
|
|
class AvatarImagePagerAdapter(fragmentManager: FragmentManager, private val avatarUrl: String) : FragmentPagerAdapter(fragmentManager) {
|
|
|
|
override fun getItem(position: Int): Fragment {
|
|
return if (position == 0) {
|
|
ViewMediaFragment.newAvatarInstance(avatarUrl)
|
|
} else {
|
|
throw IllegalStateException()
|
|
}
|
|
}
|
|
|
|
override fun getCount() = 1
|
|
|
|
}
|