Changed position icon
This commit is contained in:
parent
8b470c1927
commit
1bbf8d0c5c
@ -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) {
|
||||
|
BIN
app/src/main/res/mipmap-hdpi/ic_person.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/ic_person.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
app/src/main/res/mipmap-mdpi/ic_person.png
Normal file
BIN
app/src/main/res/mipmap-mdpi/ic_person.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 962 B |
BIN
app/src/main/res/mipmap-xhdpi/ic_person.png
Normal file
BIN
app/src/main/res/mipmap-xhdpi/ic_person.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/mipmap-xxhdpi/ic_person.png
Normal file
BIN
app/src/main/res/mipmap-xxhdpi/ic_person.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.2 KiB |
BIN
app/src/main/res/mipmap-xxxhdpi/ic_person.png
Normal file
BIN
app/src/main/res/mipmap-xxxhdpi/ic_person.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
Loading…
Reference in New Issue
Block a user