prepare 2 images on both sides at the fullscreen view

This commit is contained in:
tibbi 2017-04-26 23:03:37 +02:00
parent 2503aead44
commit 11a98d69fe

View file

@ -209,6 +209,7 @@ class ViewPagerActivity : SimpleActivity(), ViewPager.OnPageChangeListener, View
val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia) val pagerAdapter = MyPagerAdapter(this, supportFragmentManager, mMedia)
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1 || !isDestroyed) {
view_pager.apply { view_pager.apply {
offscreenPageLimit = 2
adapter = pagerAdapter adapter = pagerAdapter
currentItem = mPos currentItem = mPos
addOnPageChangeListener(this@ViewPagerActivity) addOnPageChangeListener(this@ViewPagerActivity)