Open correct image
This commit is contained in:
parent
f3dea49627
commit
3b202da7bd
@ -14,9 +14,12 @@ class AlbumActivity : BaseActivity() {
|
||||
|
||||
setContentView(binding.root)
|
||||
val mediaAttachments = intent.getSerializableExtra("images") as ArrayList<Attachment>
|
||||
val index = intent.getIntExtra("index", 0)
|
||||
binding.albumPager.adapter = AlbumViewPagerAdapter(mediaAttachments,
|
||||
sensitive = false,
|
||||
opened = true)
|
||||
opened = true
|
||||
)
|
||||
binding.albumPager.currentItem = index
|
||||
|
||||
if(mediaAttachments.size == 1){
|
||||
binding.albumPager.isUserInputEnabled = false
|
||||
|
@ -89,6 +89,7 @@ class NestedScrollableHost(context: Context, attrs: AttributeSet? = null) :
|
||||
val intent = Intent(context, AlbumActivity::class.java)
|
||||
|
||||
intent.putExtra("images", images)
|
||||
intent.putExtra("index", (child as ViewPager2).currentItem)
|
||||
|
||||
context.startActivity(intent)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user