Skip to content Skip to sidebar Skip to footer

Fading Edges Working Only On Top And Left

I made a custom ImageView that supports basic scrolling through calls to View.scrollBy() in a GestureDetector. I wanted to add some feedback on the reaching of scrolling bounds so

Solution 1:

It seems that the problem is in getBottomFadingEdgeStrength() and getRightFadingEdgeStrength(), or better, in the fact that I didn't override them to work with my custom view.

These protected methods tell view's draw() when to draw the fadings (and how strongly -- see what a ScrollView does when you get close to the scrolling limit).

For top and left edges it's easy because the limit is 0 in both cases and the default implementation works (in its on/off manner), but for the other two I need to override the methods to take into account my own scrolling bounds (in my case, the drawable dimensions).

Post a Comment for "Fading Edges Working Only On Top And Left"