B4A Class WebViewSwipeToRefresh

As AHSwipeToRefresh lib cannot work now with WebView (seems, due to AndroidX) - any solution must be found for pull-to-refresh.
So, CLVSwipe Erel's class was reworked into this WVSwipe result class (only for Android from my side).

Dependencies: JavaObject, ViewsEx, XUI.
* Adjustable ProgressBar circle color
* Tested on Android8, 10 devices, please, give feedback how works.

WebViewSwipeToRefresh.b4xlib is used in WebView SwipeToRefresh_test.zip project: the lib is made to have more comfortable usage without layout file.
I guess, this class can be customized and used to pull-to-refresh of any view.

Update v.0.18: fix of WebView freeze at fast scrolling
Update v.0.17: fix of progressbar horizontal position, if WebView is not centered.
 

Attachments

  • WebView SwipeToRefresh_test.zip
    8.9 KB · Views: 183
  • scr2.jpg
    scr2.jpg
    56.3 KB · Views: 253
  • WebViewSwipeToRefresh.b4xlib
    3.8 KB · Views: 112
Last edited:

Siam

Active Member
Licensed User
Hi,
I love this class but i have a big problem with it. If i scroll fast up and down the webview will go frozen and will not response to any action like scroll or tap on a link. i have tested it on Samsung Galaxy 7 with android 8 and on Huawei p20 with android 10.0 here is a small Video you can see what I mean
 

peacemaker

Expert
Licensed User
If i scroll fast up and down the webview will go frozen and will not response

Indeed, tried on Samsung M21.
Try the attached version 0.18.

p.s. and do not wobble it ;)
 

Attachments

  • WebViewSwipeToRefresh.b4xlib
    3.8 KB · Views: 103

peacemaker

Expert
Licensed User
page won't reload (no request was sent to the server)
oops, what version tried ? maybe upload some your test project to check ?


My test project v.0.18 shows that PageFinshed event is fired after each pull.
1600167118969.png
 
Last edited:

peacemaker

Expert
Licensed User
Check those latest version 0.18 of the class, it has subs
Swipe_RefreshRequested
and
RaiseRefreshEvent

edit as needed, and pack the WVSwipe.bas.bas file back into "WebViewSwipeToRefresh.b4xlib"
 

Attachments

  • WVSwipe.bas
    4.8 KB · Views: 82
Last edited:
Top