Browse Source

show help message on map only when clicking a stop

develop
Robin Thoni 8 years ago
parent
commit
d799b298e4

+ 4
- 1
app/src/main/java/com/rthoni/stssaguenay/ui/fragments/StopMapPickerFragment.java View File

82
         @Override
82
         @Override
83
         protected void onClusterItemRendered(StopDboMapItem clusterItem, Marker marker) {
83
         protected void onClusterItemRendered(StopDboMapItem clusterItem, Marker marker) {
84
             _items.put(marker.getId(), clusterItem);
84
             _items.put(marker.getId(), clusterItem);
85
+            marker.setTag(clusterItem);
85
             super.onClusterItemRendered(clusterItem, marker);
86
             super.onClusterItemRendered(clusterItem, marker);
86
         }
87
         }
87
 
88
 
189
         _map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
190
         _map.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() {
190
             @Override
191
             @Override
191
             public boolean onMarkerClick(Marker marker) {
192
             public boolean onMarkerClick(Marker marker) {
192
-                Toast.makeText(getContext(), R.string.stop_add_map_help, Toast.LENGTH_LONG).show();
193
+                if (marker.getTag() instanceof StopDboMapItem) {
194
+                    Toast.makeText(getContext(), R.string.stop_add_map_help, Toast.LENGTH_LONG).show();
195
+                }
193
                 return false;
196
                 return false;
194
             }
197
             }
195
         });
198
         });

Loading…
Cancel
Save