aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java')
-rw-r--r--app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java b/app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java
index a16e833..af4331a 100644
--- a/app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java
+++ b/app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java
@@ -4,6 +4,7 @@ package org.marcinzelent.liberavem;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
+import android.support.v4.widget.SwipeRefreshLayout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@@ -48,6 +49,17 @@ public class AllObservationsFragment extends Fragment {
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
+ final SwipeRefreshLayout sfl = view.findViewById(R.id.swiperefresh);
+ sfl.setOnRefreshListener(
+ new SwipeRefreshLayout.OnRefreshListener() {
+ @Override
+ public void onRefresh() {
+ DataKeeper.getInstance().downloadData(getActivity());
+ sfl.setRefreshing(false);
+ }
+ }
+ );
+
DataKeeper.getInstance().downloadData(getActivity());
}