|
4 | 4 | import android.content.pm.PackageManager;
|
5 | 5 | import android.graphics.Bitmap;
|
6 | 6 | import android.graphics.BitmapFactory;
|
| 7 | +import android.graphics.Color; |
7 | 8 | import android.location.Location;
|
8 | 9 | import android.os.Bundle;
|
9 | 10 | import android.support.annotation.Nullable;
|
|
35 | 36 | import com.omkarmoghe.pokemap.controllers.app_preferences.PokemapAppPreferences;
|
36 | 37 | import com.omkarmoghe.pokemap.controllers.app_preferences.PokemapSharedPreferences;
|
37 | 38 | import com.omkarmoghe.pokemap.controllers.map.LocationManager;
|
| 39 | +import com.omkarmoghe.pokemap.helpers.MapHelper; |
38 | 40 | import com.omkarmoghe.pokemap.helpers.RemoteImageLoader;
|
39 | 41 | import com.omkarmoghe.pokemap.models.events.CatchablePokemonEvent;
|
40 | 42 | import com.omkarmoghe.pokemap.models.events.ClearMapEvent;
|
@@ -303,6 +305,7 @@ public void onFetch(Bitmap bitmap) {
|
303 | 305 |
|
304 | 306 | BitmapDescriptor bitmapDescriptor = BitmapDescriptorFactory.fromBitmap(bitmap);
|
305 | 307 | marker.setIcon(bitmapDescriptor);
|
| 308 | + marker.setZIndex(pokestop.hasLurePokemon() ? 1.0f : 0.5f); |
306 | 309 | }
|
307 | 310 | }
|
308 | 311 | );
|
@@ -405,6 +408,8 @@ public void onFetch(Bitmap bitmap) {
|
405 | 408 | .position(new LatLng(pokestop.getLatitude(), pokestop.getLongitude()))
|
406 | 409 | .title(getString(R.string.pokestop))
|
407 | 410 | .icon(bitmapDescriptor)
|
| 411 | + .zIndex(MapHelper.LAYER_POKESTOPS) |
| 412 | + .alpha(pokestop.hasLurePokemon() ? 1.0f : 0.5f) |
408 | 413 | .anchor(0.5f, 0.5f));
|
409 | 414 |
|
410 | 415 | //adding pokemons to list to be removed on next search
|
@@ -456,6 +461,7 @@ public void onFetch(Bitmap bitmap) {
|
456 | 461 | .position(new LatLng(gym.getLatitude(), gym.getLongitude()))
|
457 | 462 | .title(getString(R.string.gym))
|
458 | 463 | .icon(bitmapDescriptor)
|
| 464 | + .zIndex(MapHelper.LAYER_GYMS) |
459 | 465 | .anchor(0.5f, 0.5f));
|
460 | 466 |
|
461 | 467 | // adding gyms to list to be removed on next search
|
@@ -503,6 +509,7 @@ public void onFetch(Bitmap bitmap) {
|
503 | 509 | .position(new LatLng(poke.getLatitude(), poke.getLongitude()))
|
504 | 510 | .title(PokemonIdUtils.getLocalePokemonName(getContext(), poke.getPokemonId().name()))
|
505 | 511 | .icon(bitmapDescriptor)
|
| 512 | + .zIndex(MapHelper.LAYER_POKEMONS) |
506 | 513 | .anchor(0.5f, 0.5f));
|
507 | 514 | //adding pokemons to list to be removed on next search
|
508 | 515 | markerList.put(poke.getSpawnPointId(), new PokemonMarkerExtended(poke, marker));
|
@@ -677,10 +684,12 @@ private void drawCatchedPokemonCircle(double latitude, double longitude) {
|
677 | 684 | if (mPref.getShowScannedPlaces()) {
|
678 | 685 |
|
679 | 686 | double radiusInMeters = 100.0;
|
680 |
| - int strokeColor = 0x4400CCFF; // outline |
681 |
| - int shadeColor = 0x4400CCFF; // fill |
682 |
| - |
683 |
| - CircleOptions circleOptions = new CircleOptions().center(new LatLng(latitude, longitude)).radius(radiusInMeters).fillColor(shadeColor).strokeColor(strokeColor).strokeWidth(8); |
| 687 | + int shadeColor = 0x2200CCFF; // fill |
| 688 | + CircleOptions circleOptions = new CircleOptions() |
| 689 | + .center(new LatLng(latitude, longitude)) |
| 690 | + .radius(radiusInMeters).fillColor(shadeColor) |
| 691 | + .strokeColor(Color.TRANSPARENT) |
| 692 | + .zIndex(MapHelper.LAYER_SCANNED_LOCATIONS); |
684 | 693 | userSelectedPositionCircles.add(mGoogleMap.addCircle(circleOptions));
|
685 | 694 | }
|
686 | 695 | }
|
@@ -730,6 +739,7 @@ private void drawMarker(LatLng position){
|
730 | 739 | .title(getString(R.string.position_picked))
|
731 | 740 | .icon(BitmapDescriptorFactory.fromBitmap(BitmapFactory.decodeResource(getContext().getResources(),
|
732 | 741 | R.drawable.ic_my_location_white_24dp)))
|
| 742 | + .zIndex(MapHelper.LAYER_MY_SEARCH) |
733 | 743 | .anchor(0.5f, 0.5f));
|
734 | 744 | } else {
|
735 | 745 | showMapNotInitializedError();
|
|
0 commit comments