diff --git a/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java b/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java
index 28db279b..32a1e83a 100644
--- a/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java
+++ b/app/src/main/java/com/github/dfa/diaspora_android/web/BrowserFragment.java
@@ -33,6 +33,7 @@ import com.github.dfa.diaspora_android.ui.theme.ThemeHelper;
import com.github.dfa.diaspora_android.ui.theme.ThemedFragment;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.AppSettings;
+import android.support.v4.widget.SwipeRefreshLayout;//pull to refresh
/**
* Fragment with a webView and a ProgressBar.
@@ -50,6 +51,7 @@ public class BrowserFragment extends ThemedFragment {
protected WebSettings webSettings;
protected String pendingUrl;
+ protected SwipeRefreshLayout swipe;//pull to refresh
@Override
protected int getLayoutResId() {
@@ -90,6 +92,11 @@ public class BrowserFragment extends ThemedFragment {
webView.setParentActivity(getActivity());
this.setRetainInstance(true);
+
+ //pull to refresh
+ swipe = view.findViewById(R.id.swipe);
+ swipe.setOnRefreshListener(() -> reloadUrl());
+ swipe.setDistanceToTriggerSync(20000);
}
@Override
@@ -192,6 +199,7 @@ public class BrowserFragment extends ThemedFragment {
@Override
public void run() {
getWebView().reload();
+ swipe.setRefreshing(false);//pull to refresh
}
});
diff --git a/app/src/main/res/layout/browser__fragment.xml b/app/src/main/res/layout/browser__fragment.xml
index 96daf8b1..9f534a0a 100644
--- a/app/src/main/res/layout/browser__fragment.xml
+++ b/app/src/main/res/layout/browser__fragment.xml
@@ -5,11 +5,16 @@
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.github.dfa.diaspora_android.activity.MainActivity">
+
-
+
+
-
\ No newline at end of file
+