Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Problem with activity transitions & ViewPager #76

Open
MikolajLen opened this issue Jun 19, 2015 · 11 comments
Open

Problem with activity transitions & ViewPager #76

MikolajLen opened this issue Jun 19, 2015 · 11 comments

Comments

@MikolajLen
Copy link

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.

@sephiroth74
Copy link
Owner

yes, I've noticed that either. I'll try to see what's happening during a transition

@tuanchauict
Copy link

@mecid
Copy link

mecid commented Sep 15, 2015

@sephiroth74 I have this problem too. Any idea how we can fix it?

@tuanchauict
Copy link

@mecid
Copy link

mecid commented Sep 17, 2015

@tuanchauict not working for me.

@shmoula
Copy link

shmoula commented Oct 8, 2015

Any news on this?

@xingrz
Copy link

xingrz commented Oct 10, 2015

@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.

@xingrz
Copy link

xingrz commented Oct 10, 2015

@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.

@shmoula
Copy link

shmoula commented Nov 5, 2015

@xingrz works for me, thank you!

@DiegoCast
Copy link

DiegoCast commented Jun 6, 2017

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>

@wynhe
Copy link

wynhe commented Jul 21, 2017

@xingrz works for me too! thank u very much!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants