Problem with activity transitions & ViewPager
Hi, I am using ImageViewTouch inside ViewPager (as full screen gallery). When I start my acitivity with transition, ViewPager displays correctly only first page - on every different i do not see image. In earlier version of Your library ViewPager was initializing correctly, but there was problem with transition.
yes, I've noticed that either. I'll try to see what's happening during a transition
I got the solution from here: http://stackoverflow.com/questions/13860832/viewpager-imageview-zooming-issue
@sephiroth74 I have this problem too. Any idea how we can fix it?
@mecid take a look at this http://stackoverflow.com/questions/13860832/viewpager-imageview-zooming-issue
@tuanchauict not working for me.
Any news on this?
@sephiroth74 I have this problem too.
Seems the problem is brought by ViewPager. More exactly, the problem is occurred when image is set while the fragment isn't visible.
@sephiroth74 I'm investigating this issue. What I found is:
- The left of the first image matrix in the first page is 0
- Then that one in the second page is 1080, which is my screen's width
- The third is 2160, and so on...
Than I extends the ImageViewTouch class and override this method:
@Override
protected void onViewPortChanged(float left, float top, float right, float bottom) {
super.onViewPortChanged(0, top, right - left, bottom);
}
the problem is fixed.
So the code above is a workaround.
The problem may be the incorrect base matrix.
@xingrz works for me, thank you!
No need to override ImageViewTouch.
Wrapping the view into a FrameLayout does the trick for me:
FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">
<com.testproject.base.view.ImageViewTouch
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"/>
/FrameLayout>
@xingrz works for me too! thank u very much!