Changed position icon

This commit is contained in:
Daniele Verducci (Slimpenguin) 2024-02-28 13:59:05 +01:00
parent 8b470c1927
commit 1bbf8d0c5c
6 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,8 @@ package it.danieleverducci.nextcloudmaps.fragments;
import android.Manifest; import android.Manifest;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
@ -15,6 +17,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.content.res.AppCompatResources; import androidx.appcompat.content.res.AppCompatResources;
import androidx.core.app.ActivityCompat; import androidx.core.app.ActivityCompat;
import androidx.core.content.res.ResourcesCompat;
import androidx.core.graphics.drawable.DrawableCompat; import androidx.core.graphics.drawable.DrawableCompat;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
@ -161,6 +164,11 @@ public class GeofavoriteMapFragment extends GeofavoritesFragment implements Main
// Display user position on screen // Display user position on screen
mLocationOverlay = new MyLocationNewOverlay(new GpsMyLocationProvider(requireContext()), map); 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 // On first gps fix, show "center to my position" icon
mLocationOverlay.runOnFirstFix(() -> { mLocationOverlay.runOnFirstFix(() -> {
if(getActivity() != null) { if(getActivity() != null) {

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 962 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB