Android Question How to remove the scrollview fadingedge

RayLee

Member
Licensed User
Longtime User
In java, it could be set
Code: Copy
scrollView1.setHorizontalFadingEdgeEnabled(false)

but i use the code:
Code: Copy
    Dim reItem As Reflector
    reItem.Target = PnMainContainer ' PnMainContainer is a scrollview object
    reItem.RunMethod2("setHorizontalFadingEdgeEnabled", False, "java.lang.Boolean")

It causes some errors:

java.lang.NoSuchMethodException: setHorizontalFadingEdgeEnabled

How can I invoke this method?
 
This line is wrong
Code: Copy
reItem.RunMethod2("setHorizontalFadingEdgeEnabled", False, "java.lang.Boolean")
It must be
Code: Copy
reItem.RunMethod2("setHorizontalFadingEdgeEnabled", False, "java.lang.boolean")
 
Upvote 0
This line is wrong
Code: Copy
reItem.RunMethod2("setHorizontalFadingEdgeEnabled", False, "java.lang.Boolean")
Code: Copy
reItem.RunMethod2("setHorizontalFadingEdgeEnabled", False, "java.lang.boolean")

Both lines are identic. And this should help to not change the line? ;-)
 
Upvote 0
I think your looking for the overscroll mode

Code: Copy
reitem.RunMethod2("setVerticalScrollBarEnabled", False, "java.lang.boolean")
reItem.RunMethod2("setOverScrollMode", 2, "java.lang.int" )
 
Upvote 0
It depends on what fading you are speaking of and the Android version.
There are two fadings:
- a permanent fading on the edges which remain when the scroll position is not at the beginning or at the end.
- a dynamic fading which appears when you reach either the beginning or the end.
The permanent fading is removed with
r.RunMethod2("setHorizontalFadingEdgeEnabled", False, "java.lang.boolean")
or
r.RunMethod2("setVertivalFadingEdgeEnabled", False, "java.lang.boolean")
but the dynamic fading remains.
To remove both fadings, as reported by barx, use .
r.RunMethod2("setOverScrollMode", 2, "java.lang.int")

On my device with Android 2.3.3 the permanent fading is True by default.
On my device with Android 4.2.2 the permanent fading is False by default.

Attached a small test program.

In the picture you see on the top permanent fading is True and on the bottom permanent fading is False.
 

Attachments

Last edited:
Upvote 0
Nothing is ever straight forward lol. I wasn't aware of this second fade. Put me back on the n00b pile. ;)
 
Upvote 0
Me too, I discovered it and also the differences depending on the Android version when I played with the different functions.
I had never looked at setOverScrollMode before I saw your post.
I have updated my post with your solution.
 
Upvote 0
Back
Top