diff options
author | Marcin Zelent <zelent.marcin@gmail.com> | 2018-04-23 17:19:58 +0200 |
---|---|---|
committer | Marcin Zelent <zelent.marcin@gmail.com> | 2018-04-23 17:19:58 +0200 |
commit | e2f49fe23b2ae1a910ab7015167e5ed9a5e4988a (patch) | |
tree | bbc450ed3480593480efcba5a5a58dcd63fa51c1 /app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java | |
parent | 2cf7ca569e50caa8d33d4045977d69d1f10771c2 (diff) |
Added proper new observation layout with geolocation and bird choosing,
added swipe refreshing.
Diffstat (limited to 'app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java')
-rw-r--r-- | app/src/main/java/org/marcinzelent/liberavem/AllObservationsFragment.java | 12 |
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()); } |