OpenGLRenderer tries to scale the bitmap - when reaching the end of the ViewPager

The application has ViewPager

several Fragment

.

When the user scrolls to the bottom of the pages, this Android gradient effect appears, indicating no more pages (instead of the iOS bounce effect).

When this effect occurs, applications stop responding, frames are deleted, and in the log - these lines -

Trying to scale down bitmap for texture (2560x4544 -> 2307x4096)
Scaled bitmap has been successfully created

      

There is no bitmap in an app of this size and it works on an LG G3 display (1440 x 2560 pixels), so I guess some bitmap is scaled to fit that xxxhdpi resolution and then shrunk slightly for some reason.

Question: why is it trying to reduce the bitmap when this effect occurs? Can this be avoided?

Does the rendering of the gradient effect decrease?

+3


source to share


2 answers


It stopped when I turned off the scroll effect (iOS bounce equivalent). Perhaps this effect is an image that changed before being shown, although I don't understand why they don't cache it if that's true.



viewPager.setOverScrollMode(View.OVER_SCROLL_NEVER);

      

0


source


The problem is uploading some image to your page: Solutions: 1. If you must upload an image, use a library called Picasso http://square.github.io/picasso/ to upload it 2. If the image is a form, try doing form yourself in android. Avoid loading large images in xml at all costs. even on the latest phones, this has a huge impact on performance.



0


source







All Articles