Compare commits

..

2 Commits

Author SHA1 Message Date
Jean-Baptiste
908ba925ae [android] Simplify toolbar styles and themes
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-28 19:26:27 +01:00
Konstantin Pastbin
1ccea5928f [planet] Update map data to 251227
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
2025-12-28 23:14:55 +07:00
10 changed files with 2316 additions and 2375 deletions

View File

@@ -196,7 +196,7 @@ public final class UiUtils
public static void showHomeUpButton(MaterialToolbar toolbar)
{
toolbar.setNavigationIcon(
ThemeUtils.getResource(toolbar.getContext(), androidx.appcompat.R.attr.homeAsUpIndicator));
UiUtils.getStyledResourceId(toolbar.getContext(), androidx.appcompat.R.attr.homeAsUpIndicator));
}
// this method returns the total height of the display (in pixels) including notch and other touchable areas

View File

@@ -6,14 +6,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="end|center_vertical"
android:theme="@style/MwmWidget.ToolbarTheme">
</com.google.android.material.appbar.MaterialToolbar>
<include layout="@layout/toolbar_default"/>
<LinearLayout
android:layout_marginTop="@dimen/margin_half_double_plus"
android:orientation="horizontal"

View File

@@ -30,8 +30,7 @@
android:layout_alignParentStart="true"
android:background="?selectableItemBackgroundBorderless"
app:srcCompat="?homeAsUpIndicator"
android:scaleType="center"
tools:src="@drawable/ic_expand_more" />
android:scaleType="center" />
<RadioGroup
android:id="@+id/route_type"

View File

@@ -8,8 +8,7 @@
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/MwmWidget.ToolbarTheme.DownButton"/>
android:layout_height="wrap_content" />
<View
android:layout_width="match_parent"

View File

@@ -17,7 +17,6 @@
android:background="?selectableItemBackgroundBorderless"
app:srcCompat="?homeAsUpIndicator"
android:scaleType="center"
tools:src="@drawable/ic_expand_more"
android:contentDescription="@string/back"/>
<com.google.android.material.textfield.TextInputEditText

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="@style/MwmWidget.ToolbarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/MwmWidget.ToolbarTheme.Transparent"/>

View File

@@ -148,11 +148,6 @@
<item name="buttonGravity">center_vertical</item>
</style>
<style name="MwmWidget.ToolbarStyle.Light">
<item name="android:titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title.Light</item>
<item name="titleTextAppearance">@style/MwmTextAppearance.Toolbar.Title.Light</item>
</style>
<style name="MwmWidget.ToolbarStyle.NoElevation">
<item name="android:elevation">0dp</item>
</style>
@@ -164,29 +159,6 @@
<item name="iconTint">@color/white_primary</item>
</style>
<style name="MwmWidget.ToolbarTheme.Light" parent="MwmWidget.ToolbarTheme">
<item name="android:gravity">center_vertical</item>
<item name="colorAccent">@android:color/white</item>
<item name="colorSecondary">#FF32363A</item>
</style>
<style name="MwmWidget.ToolbarTheme.Transparent" parent="ThemeOverlay.Material3.Dark.ActionBar">
<item name="android:gravity">center_vertical</item>
<item name="colorAccent">@android:color/white</item>
<item name="colorSecondary">@android:color/white</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="windowActionBarOverlay">true</item>
</style>
<style
name="MwmWidget.ToolbarTheme.DownButton"
parent="ThemeOverlay.Material3.Dark.ActionBar">
<item name="android:gravity">center_vertical</item>
<item name="colorAccent">@android:color/white</item>
<item name="colorSecondary">@android:color/white</item>
<item name="android:homeAsUpIndicator">@drawable/ic_expand_more</item>
</style>
<style name="MwmWidget.ListView" parent="android:Widget.Material.ListView">
<item name="android:fadingEdge">none</item>
<item name="android:divider">@color/divider</item>

File diff suppressed because it is too large Load Diff

View File

@@ -45,9 +45,8 @@
#
# 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 rendering engine in the app doesn't use this file directly, it loads a data/types.txt
# 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

@@ -35,31 +35,24 @@ void TypeToOSMTranslator::LoadFromStream(std::istream & s)
getline(s, line);
strings::Trim(line);
// skip empty lines and comments
if (line.empty() || line.front() == '#')
// skip empty lines, comments, deprecated and moved types
if (line.empty() || line.front() == '#' || line.starts_with("deprecated") || line.starts_with("moved") ||
line.back() != ';')
continue;
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)
std::vector<std::string_view> const rowTokens = strings::Tokenize(line, ";");
if (rowTokens.size() < 2)
{
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() == 3)
if (rowTokens.size() == 2)
{
// Derive OSM tags from type name
ASSERT(featureTypeTokens.size() <= 2, ("OSM tags can not be inferred from name:", line));
@@ -84,11 +77,6 @@ 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