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: 391
  • scr2.jpg
    56.3 KB · Views: 467
  • WebViewSwipeToRefresh.b4xlib
    3.8 KB · Views: 307
Last edited:

Siam

Active Member
Licensed User
Longtime 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
Longtime 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: 292

peacemaker

Expert
Licensed User
Longtime 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.
 
Last edited:

peacemaker

Expert
Licensed User
Longtime 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: 239
Last edited:

peacemaker

Expert
Licensed User
Longtime User
@Ivica Golubovic, please, try this class with your super UltimateWebView - it does not work, but Swipe-To-Refresh is important feature.
All my latest questions are due to this feature - something wrong with it to use instead of native WebView.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…