-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visibility problem #127
Comments
I can't reproduce this. There's a possibility that release 3.4.1 has fixed it, please try that and let me know if you're still seeing this problem. Please also include the code you're using to set up the view. |
I can post the adapter if you want, but I think I've found something:
Any ideas on that? I want to change this anyway to use a preview image on top of your view for the transitions. This may solve this problem as the transitions won't mess around with your views visibility... |
I'm also facing the problem with the ViewPager, the image of a fragment is empty until a bit of swiping is done to that fragment. I thought it was related to #117, but I'm not using previews. I've also tried setting image dimensions. Disabling tiling fixes it, but I would like to keep it enabled. The images used are around ~1000x1600 |
I still can't reproduce anything like this, with or without custom page transitions, and with small or large images. With tiling enabled, it's normal for the image to not be displayed immediately when you start the swipe to the next page, because it has to load. It can't be loaded until the view's dimensions are known, and the dimensions may not be known until the view is partly on screen. I have never seen the view get to calling onReady without displaying the image, or need extra touch gestures to prompt the image to be displayed. |
Actually, the second thing is not reproducable anymore... So I would say that was something different. Probably something with transitions, I'm not sure anymore. If the other thing can't be solved currently, I would suggest something like following: a constructor for the image that takes a size as well, so the image could be loaded before the view is rendered? Or something similar |
It's the view size that's needed, not the image size. I'm considering an option to override the default handling and assume the view will be full screen then subsample the image accordingly, but misuse of this flag would cause crashes and it adds yet another loading path to the many already present. |
Of course, the view size... But in a gallery app for example, the view size normally is full screen and therefore is already known, so this would probably be quite useful for many people |
With these changes I was able to load the initial tile before a fragment is partially visible. The view dimensions of non visible fragments from the viewpager are known beforehand ( The problem is that we lose access to the canvas when initializing outside That's the reason I added the In my tablet and phone the method returns 4096 instead of the 16384 returned by the canvas method, but I haven't tried with bigger images so I don't know if there will be any issue. I'm also not sure if this causes any other problem in the library, but it works fine in my case. Are these changes safe enough @davemorrissey ? |
I've implemented @inorichi's suggestion and it works well. The next image in a view pager is loaded while off screen. I'm not certain whether this was the cause of the original issue, which I never reproduced, but will close this now. Please reopen if there are other cases where the image is not loaded. |
I was using version 3.2.0 and never had problems, now with 3.4.0 I experience following problem:
Sometimes I have to scale the image with my fingers before it's shown...
onReady
is called, but the screen stays empty until I do a scale gesture, this makes the image visibleThe other thing is, that in my
ViewPager
using aFragmentStatePagerAdapter
the views to the left/right sometimes to load the images as well until I swipe to them. The fragments are created butonReady
of the image does not get called. Touching the current page does help and results inonReady
for the left and right image to get called...The text was updated successfully, but these errors were encountered: