Compare commits

..

1 Commits

Author SHA1 Message Date
map-per
81fc0e9e9a [editor] More reliable check for deprecated and moved features
Signed-off-by: map-per <map-per@gmx.de>
2025-12-28 18:04:20 +01:00
23 changed files with 2344 additions and 2349 deletions

View File

@@ -6,10 +6,12 @@ import android.view.View;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.XmlRes;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.R;
import app.organicmaps.util.Utils;
import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener;
@@ -42,6 +44,7 @@ abstract class BaseXmlSettingsFragment extends PreferenceFragmentCompat
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState)
{
super.onViewCreated(view, savedInstanceState);
view.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.bg_cards));
RecyclerView recyclerView = getListView();
ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new ScrollableContentInsetsListener(recyclerView));
}

View File

@@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground"
android:background="?cardBackground"
android:clipToPadding="false"
android:fadeScrollbars="false"
android:fillViewport="true">

View File

@@ -13,7 +13,7 @@
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground"
android:background="?cardBackground"
android:fadeScrollbars="false"
android:fillViewport="true"
android:clipToPadding="false">

View File

@@ -3,8 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?appBackground">
android:orientation="vertical">
<include
layout="@layout/toolbar_extended"/>
@@ -18,8 +17,7 @@
android:id="@+id/fragment_container"
style="@style/MwmWidget.FrameLayout.Elevation"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground"/>
android:layout_height="match_parent"/>
</com.google.android.material.card.MaterialCardView>
</FrameLayout>

View File

@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground"
android:background="?cardBackground"
android:clipToPadding="false"
android:fadeScrollbars="false"
android:fillViewport="true">

View File

@@ -5,7 +5,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground">
android:background="?cardBackground">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?appBackground"
android:background="?cardBackground"
android:gravity="center"
android:orientation="vertical">

View File

@@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground"
android:background="?cardBackground"
android:gravity="center"
android:orientation="vertical">

View File

@@ -3,8 +3,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?appBackground">
android:orientation="vertical">
<include
layout="@layout/toolbar_default"/>

View File

@@ -2,7 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="?appBackground"
android:background="?cardBackground"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@@ -13,7 +13,7 @@
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?appBackground"
android:background="?cardBackground"
android:fadeScrollbars="false"
android:fillViewport="true"
android:clipToPadding="false">

View File

@@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?appBackground">
android:background="?cardBackground">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"

View File

@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="?appBackground">
android:background="?cardBackground">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/header"

View File

@@ -9,7 +9,7 @@ android:layout_marginHorizontal="@dimen/margin_base"
android:layout_marginTop="@dimen/margin_half"
app:strokeWidth="1dp"
app:strokeColor="@color/base_accent"
app:cardBackgroundColor="?cardBackground">
app:cardBackgroundColor="@color/bg_cards">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -150,8 +150,6 @@
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
<item name="appBackground">?android:attr/colorBackground</item>
</style>
<style name="MwmTheme" parent="MwmTheme.Base"/>

View File

@@ -64,7 +64,6 @@
<color name="bg_cards">@android:color/white</color>
<color name="bg_panel">@color/bg_window</color>
<color name="bg_primary_dark">#37653F</color> <!-- secondary dark -->
<color name="bg_app">@android:color/white</color>
<color name="bg_dialog_translucent">#BB000000</color>
<color name="bg_text_translucent">#99FFFFFF</color>

View File

@@ -6,7 +6,6 @@
<attr name="textDialogTheme" format="reference" />
<attr name="windowBackgroundForced" format="reference|color" />
<attr name="cardBackground" format="reference" />
<attr name="appBackground" format="reference|color" />
<attr name="clickableBackground" format="reference" />
<attr name="statusBar" format="color" />
<attr name="secondary" format="color" />

View File

@@ -158,8 +158,6 @@
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
<item name="appBackground">@color/bg_app</item>
</style>
<style name="MwmTheme" parent="MwmTheme.Base"/>

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,4 @@
{
"World": {
"languages": ["int_name", "en", "default"]
},
"WorldCoasts": {
"languages": ["int_name", "en", "default"]
},
"Abkhazia": {
"languages": ["ab", "ru"]
},

View File

@@ -45,8 +45,9 @@
#
# A C++ parser implementation used by the generator is in generator/utils.cpp::ParseMapCSS().
# A python parser implementation used to compile *.mapcss style files is in tools/kothic/src/libkomwm.py::komap_mapswithme().
# The app doesn't use this file directly, it loads a data/types.txt
# The rendering engine in the app doesn't use this file directly, it loads a data/types.txt
# which is derived from this file during style files compilation.
# A C++ parser for matching types to OSM tags is implemented in editor/feature_type_to_osm.cpp.
#
# Types that don't have any style defined are discarded by the generator.
# To prevent discarding, add them to the exceptions in indexer/feature_visibility.cpp::IsUsefulNondrawableType()
Can't render this file because it contains an unexpected character in line 7 and column 16.

View File

@@ -1,7 +1,7 @@
{
"data_format": 1,
"data_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/taginfo.json",
"data_updated": "20251228T203737Z",
"data_updated": "20251120T121118Z",
"project": {
"name": "CoMaps",
"description": "CoMaps is a community-focused privacy navigation iOS & Android app for travelers - drivers, hikers, and cyclists.",
@@ -176,7 +176,7 @@
"description": "amenity=car_pooling",
"key": "amenity",
"value": "car_pooling",
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/parking_pooling-m.svg"
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/parking-pooling-m.svg"
},
{
"description": "amenity=car_rental",
@@ -431,12 +431,6 @@
"value": "hunting_stand",
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/hunting-tower-m.svg"
},
{
"description": "amenity=hydrant",
"key": "amenity",
"value": "hydrant",
"icon_url": "https://codeberg.org/comaps/comaps/raw/branch/main/data/styles/default/light/symbols/hydrant-m.svg"
},
{
"description": "amenity=ice_cream",
"key": "amenity",

View File

@@ -35,24 +35,31 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
getline(s, line);
strings::Trim(line);
// skip empty lines, comments, deprecated and moved types
if (line.empty() || line.front() == '#' || line.starts_with("deprecated") || line.starts_with("moved") ||
line.back() != ';')
// skip empty lines and comments
if (line.empty() || line.front() == '#')
continue;
std::vector<std::string_view> const rowTokens = strings::Tokenize(line, ";");
if (rowTokens.size() < 2)
std::vector<std::string> rowTokens;
strings::ParseCSVRow(line, ';', rowTokens);
// make sure entry is in full or short format
if (rowTokens.size() != 3 && rowTokens.size() != 7)
{
ASSERT(false, ("Invalid feature type definition:", line));
continue;
}
// skip deprecated and moved types
if ((rowTokens.size() == 3 && !rowTokens[2].empty()) || (rowTokens.size() == 7 && rowTokens[2] == "x"))
continue;
// Get internal feature type
ASSERT(!rowTokens[0].empty(), ("No feature type found:", line));
std::vector<std::string_view> const featureTypeTokens = strings::Tokenize(rowTokens[0], "|");
uint32_t const type = classif().GetTypeByPathSafe(featureTypeTokens);
ASSERT(type != IndexAndTypeMapping::INVALID_TYPE, ("Feature with invalid type:", line));
if (rowTokens.size() == 2)
if (rowTokens.size() == 3)
{
// Derive OSM tags from type name
ASSERT(featureTypeTokens.size() <= 2, ("OSM tags can not be inferred from name:", line));
@@ -77,6 +84,11 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
else
{
// OSM tags are listed in the feature type entry
if (rowTokens[1].empty())
{
ASSERT(false, ("No OSM tags found:", line));
continue;
}
std::vector<std::string_view> const osmTagTokens = strings::Tokenize(rowTokens[1], ",");
// First entry is the best practice way to tag a feature