diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/fragments/GeofavoriteMapFragment.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/fragments/GeofavoriteMapFragment.java index c2375b6..5e3f315 100644 --- a/app/src/main/java/it/danieleverducci/nextcloudmaps/fragments/GeofavoriteMapFragment.java +++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/fragments/GeofavoriteMapFragment.java @@ -3,6 +3,8 @@ package it.danieleverducci.nextcloudmaps.fragments; import android.Manifest; import android.content.Intent; import android.content.pm.PackageManager; +import android.graphics.Bitmap; +import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; @@ -15,6 +17,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.content.res.AppCompatResources; import androidx.core.app.ActivityCompat; +import androidx.core.content.res.ResourcesCompat; import androidx.core.graphics.drawable.DrawableCompat; import androidx.lifecycle.Observer; @@ -161,6 +164,11 @@ public class GeofavoriteMapFragment extends GeofavoritesFragment implements Main // Display user position on screen mLocationOverlay = new MyLocationNewOverlay(new GpsMyLocationProvider(requireContext()), map); + Bitmap personIcon = ((BitmapDrawable)AppCompatResources.getDrawable(requireContext(), R.mipmap.ic_person)).getBitmap(); + mLocationOverlay.setPersonIcon(personIcon); + mLocationOverlay.setDirectionIcon(personIcon); + mLocationOverlay.setPersonAnchor(.5f, .5f); + mLocationOverlay.setDirectionAnchor(.5f, .5f); // On first gps fix, show "center to my position" icon mLocationOverlay.runOnFirstFix(() -> { if(getActivity() != null) { diff --git a/app/src/main/res/mipmap-hdpi/ic_person.png b/app/src/main/res/mipmap-hdpi/ic_person.png new file mode 100644 index 0000000..a8eb2b8 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_person.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_person.png b/app/src/main/res/mipmap-mdpi/ic_person.png new file mode 100644 index 0000000..e37f130 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_person.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_person.png b/app/src/main/res/mipmap-xhdpi/ic_person.png new file mode 100644 index 0000000..4d7bd41 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_person.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_person.png b/app/src/main/res/mipmap-xxhdpi/ic_person.png new file mode 100644 index 0000000..d9976a3 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_person.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_person.png b/app/src/main/res/mipmap-xxxhdpi/ic_person.png new file mode 100644 index 0000000..fdbb7f7 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_person.png differ