Android Tutorial ScrollView example

Is it possible to load images from a webpage?
If i look to your code begin post.:
B4X:
imagesFolder = File.DirRootExternal & "/images"
if i try it with a website link, for example.:
B4X:
imagesFolder = "http://www.abcdef.nl/uploads/pics_fotogallery"
I get a mesage that there is no image folder found.
Is it possible with code to do this or must it be totaly changed, because i like this code
 

LucaMs

Expert
Licensed User
Longtime User
By default it disappears right after the user finishes scrolling. But I want it to always stay on.
I think you should set this:
https://developer.android.com/refer...attr_android:scrollbarAlwaysDrawVerticalTrack

but it seems not to work using this code:
B4X:
Sub SetAlwaysDrawVerticalTrack(SV As ScrollView, Visible As Boolean)
    Dim JO As JavaObject
    JO = SV
    JO.RunMethod("scrollbarAlwaysDrawVerticalTrack", Array As Object(Visible))
End Sub

The error message is:
java.lang.RuntimeException: Method: scrollbarAlwaysDrawVerticalTrack not found in: anywheresoftware.b4a.objects.ScrollViewWrapper$MyScrollView

so I think that the code does not work because ScrollView is a B4A wrapper: am I wrong? Is there another way to do it?
 

klaus

Expert
Licensed User
Longtime User
Use this code:
B4X:
'Sets the scrollbar almost allways visible
Private Sub SetScrollBarPermanent(v As View)
    Private jo = v As JavaObject
   
    jo.RunMethod("setScrollBarDefaultDelayBeforeFade", Array (10000000))
    jo.RunMethod("setScrollBarFadeDuration", Array (10000000))
End Sub
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…