Open photos embedded in preview cards in the image viewer (#1966)

* Open photos embedded in preview cards in the internal image viewer instead of opening the browser

* Enable toolbar for single image viewer

* Apply review feedback
This commit is contained in:
Levi Bard 2020-10-22 21:15:46 +02:00 committed by GitHub
commit e0346a8e88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 51 additions and 32 deletions

View file

@ -5,14 +5,14 @@ import androidx.fragment.app.FragmentActivity
import com.keylesspalace.tusky.ViewMediaAdapter
import com.keylesspalace.tusky.fragment.ViewMediaFragment
class AvatarImagePagerAdapter(
class SingleImagePagerAdapter(
activity: FragmentActivity,
private val avatarUrl: String
private val imageUrl: String
) : ViewMediaAdapter(activity) {
override fun createFragment(position: Int): Fragment {
return if (position == 0) {
ViewMediaFragment.newAvatarInstance(avatarUrl)
ViewMediaFragment.newSingleImageInstance(imageUrl)
} else {
throw IllegalStateException()
}