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:
parent
53bd081802
commit
e0346a8e88
7 changed files with 51 additions and 32 deletions
|
|
@ -0,0 +1,25 @@
|
|||
package com.keylesspalace.tusky.pager
|
||||
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.keylesspalace.tusky.ViewMediaAdapter
|
||||
import com.keylesspalace.tusky.fragment.ViewMediaFragment
|
||||
|
||||
class SingleImagePagerAdapter(
|
||||
activity: FragmentActivity,
|
||||
private val imageUrl: String
|
||||
) : ViewMediaAdapter(activity) {
|
||||
|
||||
override fun createFragment(position: Int): Fragment {
|
||||
return if (position == 0) {
|
||||
ViewMediaFragment.newSingleImageInstance(imageUrl)
|
||||
} else {
|
||||
throw IllegalStateException()
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = 1
|
||||
|
||||
override fun onTransitionEnd(position: Int) {
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue