From 21bf1c7b9d043759cae89aad4d0498f8612cf47b Mon Sep 17 00:00:00 2001 From: Aran Zaiger Date: Sun, 10 Jul 2016 13:18:39 +0300 Subject: [PATCH] finished filters on gmap --- .../sagi/thesocialnotework/GmapFragment.java | 19 +++++++++---------- .../ara/sagi/thesocialnotework/Utils.java | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/GmapFragment.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/GmapFragment.java index 6b935a0..81a2a81 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/GmapFragment.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/GmapFragment.java @@ -85,9 +85,9 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback { private final String day = "24 hours"; private final String week = "Week"; private final String month = "Month"; - private final String hundredMeters = "100 meters"; - private final String kilometer = "1 Km"; - private final String tenKilometers = "10 Km"; + private final String hundredMeters = "1 Km"; + private final String kilometer = "10 Km"; + private final String tenKilometers = "100 Km"; private final String mine = "Mine"; private final String others = "Others"; private final String all = "All"; @@ -167,9 +167,10 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback { // set text button in the right filter string map_small_filter.setText(day); map_medium_filter.setText(week); + map_medium_filter.setText(week); map_large_filter.setText(month); } - updateShowedNotes(); + setButtonsColor(); } }); @@ -190,7 +191,7 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback { map_medium_filter.setText(kilometer); map_large_filter.setText(tenKilometers); } - updateShowedNotes(); + setButtonsColor(); } }); @@ -211,7 +212,7 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback { map_medium_filter.setText(others); map_large_filter.setText(all); } - updateShowedNotes(); + setButtonsColor(); } }); } @@ -568,10 +569,8 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback { } Log.d(TAG, "updateShowedNotes: ======= markers presented: "+ presentedNotes.size()+"============="); -// noteListAdapter.updateList(presentedNotes); -// noteList.setAdapter(noteListAdapter); mMap.clear(); - new getMarkersFromNotes(mMap, eventMarkerMap).execute(listOfNotes); + new getMarkersFromNotes(mMap, eventMarkerMap).execute(presentedNotes); } @@ -616,7 +615,7 @@ public class GmapFragment extends Fragment implements OnMapReadyCallback { //date filters else { - dateFilterSelection = Utils.MONTH_MILI; + dateFilterSelection = Utils.WEEK_MILI; } //change colors of buttons and update visible notes setButtonsColor(); diff --git a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/Utils.java b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/Utils.java index c65a2e4..e580c68 100644 --- a/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/Utils.java +++ b/app/src/main/java/com/android_app/matan/ara/sagi/thesocialnotework/Utils.java @@ -50,7 +50,7 @@ public class Utils { private static SharedPreferences prefs; public static int filterColor = Color.parseColor("#33adff"); public static final long DAY_MILI = 86400000L,WEEK_MILI = 604800000L,MONTH_MILI = 2592000000L; - public static final float DISTANCE_SMALL = 100,DISTANCE_MEDIUM = 1000,DISTANCE_LONG = 10000; + public static final float DISTANCE_SMALL = 1000,DISTANCE_MEDIUM = 10000,DISTANCE_LONG = 100000;