Example #1
0
 private void showPostFragment(Bundle args) {
   mPostButton.setVisibility(View.GONE);
   setMapGestureEnabled(false);
   if (mInfoWindowMarker != null) {
     mInfoWindowMarker.hideInfoWindow();
     mInfoWindowMarker = null;
   }
   getLoaderManager().destroyLoader(LOADER_OBSERVATION);
   if (getPostFragment() == null) {
     FragmentManager fm = getFragmentManager();
     PostFragment postFragment = new PostFragment();
     postFragment.setArguments(args);
     postFragment.setTargetFragment(this, REQUEST_POST);
     fm.beginTransaction().replace(R.id.overlay_host, postFragment).commit();
   }
 }
Example #2
0
 private void showHomeFragment() {
   mWeatherModeBtn.setVisibility(View.GONE);
   mTemperatureModeBtn.setVisibility(View.GONE);
   mLogoView.setVisibility(View.VISIBLE);
   setMapGestureEnabled(false);
   if (mInfoWindowMarker != null) {
     mInfoWindowMarker.hideInfoWindow();
     mInfoWindowMarker = null;
   }
   getLoaderManager().destroyLoader(LOADER_OBSERVATION);
   if (getHomeFragment() == null) {
     FragmentManager fm = getFragmentManager();
     HomeFragment homeFragment = new HomeFragment();
     homeFragment.setTargetFragment(this, -1);
     fm.beginTransaction().replace(R.id.overlay_host, homeFragment).commit();
   }
 }
Example #3
0
 @Override
 public void onMarkerDragEnd(Marker marker) {
   marker.hideInfoWindow();
   currentLatLng = marker.getPosition();
   localizacion = new Localizacion(MapsActivity.this, currentLatLng);
   information = Arrays.toString(localizacion.gps()).replaceAll("\\[|\\]", "");
   marker.setTitle(information);
   preferences =
       new Preferences(
           getApplicationContext(),
           "Latitude,Longitude, CountryCode,Country, State, City, Address",
           String.valueOf(currentLatLng.latitude)
               + ","
               + String.valueOf(currentLatLng.longitude)
               + ","
               + information,
           "Laundry");
   preferences.savePreferences();
 }
 @Override
 public boolean onMarkerClick(Marker marker) {
   if (lastMarkerClicked == null) {
     boolean isMarkerAFixedMarker = false;
     for (int i = 0; i < fixedMarkersList.size() && !isMarkerAFixedMarker; i++) {
       if (marker.getId().equals(fixedMarkersList.get(i).getId())) {
         isMarkerAFixedMarker = true;
       }
     }
     if (isMarkerAFixedMarker) {
       lastMarkerClicked = marker;
       return false;
     } else {
       marker.remove();
       return true;
     }
   } else {
     boolean isMarkerAFixedMarker = false;
     for (int i = 0; i < fixedMarkersList.size() && !isMarkerAFixedMarker; i++) {
       if (marker.getId().equals(fixedMarkersList.get(i).getId())) {
         isMarkerAFixedMarker = true;
       }
     }
     if (isMarkerAFixedMarker) {
       if (lastMarkerClicked.equals(marker)) {
         marker.hideInfoWindow();
         lastMarkerClicked = null;
         return true;
       }
       return false;
     } else {
       marker.remove();
       lastMarkerClicked = null;
       return true;
     }
   }
 }
 @ReactProp(name = PROP_CLICK_MARKER)
 public void setPropClickMarker(MapView view, @Nullable Integer clickMarker) {
   WritableMap properties = getProperties();
   String key = String.valueOf(clickMarker);
   if (clickMarker == null) {
     if (properties.hasKey(PROP_CLICK_MARKER)) {
       if (markerLookup.containsKey(String.valueOf(properties.getInt(PROP_CLICK_MARKER)))) {
         Marker marker =
             mapMarkers.get(
                 Integer.parseInt(
                     markerLookup.get(String.valueOf(properties.getInt(PROP_CLICK_MARKER)))));
         marker.hideInfoWindow();
         Log.i(REACT_CLASS, "hideInfoWindow");
       }
     }
   } else {
     properties.putInt(PROP_CLICK_MARKER, clickMarker);
     if (markerLookup.containsKey(key)) {
       Marker marker = mapMarkers.get(Integer.parseInt(markerLookup.get(key)));
       marker.showInfoWindow();
       Log.i(REACT_CLASS, "showInfoWindow" + String.valueOf(marker));
     }
   }
 }
 @Override
 public void hideInfoWindow() {
   if (virtual != null) {
     virtual.hideInfoWindow();
   }
 }
Example #7
0
 @Override
 public void onMarkerDragStart(Marker marker) {
   marker.hideInfoWindow();
 }