aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Zelent <zelent.marcin@gmail.com>2018-04-23 17:19:58 +0200
committerMarcin Zelent <zelent.marcin@gmail.com>2018-04-23 17:19:58 +0200
commite2f49fe23b2ae1a910ab7015167e5ed9a5e4988a (patch)
treebbc450ed3480593480efcba5a5a58dcd63fa51c1 /app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.java
parent2cf7ca569e50caa8d33d4045977d69d1f10771c2 (diff)
Added proper new observation layout with geolocation and bird choosing,
added swipe refreshing.
Diffstat (limited to 'app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.java')
-rw-r--r--app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.java b/app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.java
index d0ad649..b83d7b4 100644
--- a/app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.java
+++ b/app/src/main/java/org/marcinzelent/liberavem/MyObservationsFragment.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;
@@ -33,6 +34,20 @@ public class MyObservationsFragment extends Fragment {
return rootView;
}
+ @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);
+ }
+ }
+ );
+ }
+
public void populateList(final Observation[] observations, final Bird[] birds) {
final ListView observationsListView = getView().findViewById(R.id.observations_list_view);