Alexander
Alexander

Reputation: 1515

Pull to Refresh for WebView

Is it possible to implemented a Pull to Refresh feature to reload pages within a WebView (Version 2.2 and above)?

Upvotes: 9

Views: 15122

Answers (5)

Andreas Gohr
Andreas Gohr

Reputation: 4935

This is now super easy by using the SwipeRefreshLayout. A good tutorial is available here: http://antonioleiva.com/swiperefreshlayout/

Upvotes: 2

EpicPandaForce
EpicPandaForce

Reputation: 81539

You can override overScrollBy() method and obtain deltaY at a given scrollY value, then call your inner javascript method responsible for starting pull to refresh.

Android ListView: get Overscroll distance

Upvotes: 0

Md. Ilyas Hasan Mamun
Md. Ilyas Hasan Mamun

Reputation: 1888

Download Zip from the following link.Add the library project(library) to both PullToRefreshListFragment & PullToRefreshViewPager as library project after that add PullToRefreshListFragment &PullToRefreshViewPager projects to LauncherActivity to run.

https://github.com/chrisbanes/Android-PullToRefresh

To use webView PullTorefresh in your project Activity, Your Project-> properties->android->add the library.jar

Upvotes: 0

Mike Keskinov
Mike Keskinov

Reputation: 11878

You can use Android-PullToRefresh library, it contains different ready-to-use wraps for GridView, ListView, ScrollView and WebView. Please take a look at: https://github.com/chrisbanes/Android-PullToRefresh/wiki/Quick-Start-Guide.

Upvotes: 0

Nicholas
Nicholas

Reputation: 2205

Have you tried https://github.com/chrisbanes/Android-PullToRefresh

According to the documentation it also has support for WebViews and the demo app works like a charm.

Upvotes: 10

Related Questions