Map style, graphics refinements

This commit is contained in:
Daniele Verducci (Slimpenguin) 2024-02-22 07:22:32 +01:00
parent 739399f54b
commit ae9274d646
6 changed files with 32 additions and 14 deletions

View File

@ -19,6 +19,7 @@ import androidx.lifecycle.Observer;
import org.osmdroid.api.IMapController; import org.osmdroid.api.IMapController;
import org.osmdroid.events.MapEventsReceiver; import org.osmdroid.events.MapEventsReceiver;
import org.osmdroid.util.GeoPoint; import org.osmdroid.util.GeoPoint;
import org.osmdroid.views.CustomZoomButtonsController;
import org.osmdroid.views.MapView; import org.osmdroid.views.MapView;
import org.osmdroid.views.overlay.MapEventsOverlay; import org.osmdroid.views.overlay.MapEventsOverlay;
import org.osmdroid.views.overlay.Marker; import org.osmdroid.views.overlay.Marker;
@ -54,6 +55,9 @@ public class GeofavoriteMapFragment extends GeofavoritesFragment implements Main
// Setup map // Setup map
map = v.findViewById(R.id.map); map = v.findViewById(R.id.map);
map.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.NEVER);
map.setMultiTouchControls(true);
MapUtils.setTheme(map);
MapEventsOverlay meo = new MapEventsOverlay(requireContext(), new MapEventsReceiver() { MapEventsOverlay meo = new MapEventsOverlay(requireContext(), new MapEventsReceiver() {
@Override @Override
public boolean singleTapConfirmedHelper(GeoPoint p) { public boolean singleTapConfirmedHelper(GeoPoint p) {

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape
android:shape="oval">
<solid android:color="@color/translucent"/>
</shape>
</item>
</layer-list>

View File

@ -4,7 +4,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<androidx.appcompat.widget.Toolbar <androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar" android:id="@+id/toolbar"

View File

@ -29,7 +29,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="?android:attr/actionBarSize" android:layout_marginTop="?android:attr/actionBarSize"
android:paddingTop="10dp"> android:paddingTop="20dp"
android:paddingStart="5dp"
android:paddingEnd="5dp">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/sort_mode" android:id="@+id/sort_mode"

View File

@ -37,17 +37,19 @@
<include layout="@layout/app_toolbar"/> <include layout="@layout/app_toolbar"/>
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:id="@+id/view_mode_list" android:id="@+id/view_mode_list"
android:layout_width="wrap_content" android:layout_width="@dimen/floating_bar_height"
android:layout_height="@dimen/floating_bar_height" android:layout_height="@dimen/floating_bar_height"
android:layout_gravity="right" android:layout_marginTop="2dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:layout_marginEnd="@dimen/spacer_2x"
android:contentDescription="@string/list_mode" android:layout_gravity="right"
android:paddingStart="@dimen/spacer_2x" android:background="@drawable/unselected_floating_semitransparent_button_background"
android:paddingEnd="@dimen/spacer_2x" android:contentDescription="@string/list_mode"
android:tint="@color/text_color" android:paddingStart="5dp"
android:src="@drawable/ic_view_list" /> android:paddingEnd="5dp"
android:tint="@color/text_color"
android:src="@drawable/ic_view_list" />
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -20,7 +20,7 @@
<!-- Generic Colors --> <!-- Generic Colors -->
<color name="primary">#ffffff</color> <color name="primary">#ffffff</color>
<color name="transparent">#00000000</color> <color name="transparent">#00000000</color>
<color name="translucent">#CFFF</color> <color name="translucent">#AEFFFFFF</color>
<color name="defaultBrand">#0082C9</color> <color name="defaultBrand">#0082C9</color>
<color name="defaultBrandAlpha">#550082C9</color> <color name="defaultBrandAlpha">#550082C9</color>
<color name="disabled">#666</color> <color name="disabled">#666</color>