Compare commits

..

2 Commits

Author SHA1 Message Date
Jean-Baptiste
ee854dd9f2 [android] Fix camera cutout offset in navigation
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2025-12-29 21:54:33 +01:00
Yannik Bloscheck
33e4894a56 [core] Add language data to world files
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2025-12-29 16:13:18 +01:00
7 changed files with 27 additions and 22 deletions

View File

@@ -197,8 +197,10 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
() -> onShareActionSelected(mSelectedCategory, KmlFileType.Text)));
items.add(new MenuBottomSheetItem(R.string.export_file_gpx, R.drawable.ic_file_gpx,
() -> onShareActionSelected(mSelectedCategory, KmlFileType.Gpx)));
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete,
() -> onDeleteActionSelected(mSelectedCategory)));
// Disallow deleting the last category
if (getAdapter().getBookmarkCategories().size() > 1)
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete,
() -> onDeleteActionSelected(mSelectedCategory)));
}
return items;
}
@@ -295,19 +297,8 @@ public class BookmarkCategoriesFragment extends BaseMwmRecyclerFragment<Bookmark
private void onDeleteActionSelected(@NonNull BookmarkCategory category)
{
// Disallow deleting the last category
if ((getAdapter().getBookmarkCategories().size() > 1))
{
BookmarkManager.INSTANCE.deleteCategory(category.getId());
getAdapter().notifyDataSetChanged();
}
else
{
new MaterialAlertDialogBuilder(requireActivity())
.setMessage(R.string.unable_to_delete_list)
.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss())
.show();
}
BookmarkManager.INSTANCE.deleteCategory(category.getId());
getAdapter().notifyDataSetChanged();
}
private void onSettingsActionSelected(@NonNull BookmarkCategory category)

View File

@@ -98,6 +98,11 @@ public class NavigationController implements TrafficManager.TrafficCallback, Nav
mSpeedLimit = topFrame.findViewById(R.id.nav_speed_limit);
mCurrentSpeed = topFrame.findViewById(R.id.nav_current_speed);
View mTopbar = topFrame.findViewById(R.id.statutbar);
ViewCompat.setOnApplyWindowInsetsListener(mTopbar,(v, windowInsets) -> {
UiUtils.setViewNavigationTopInsetsMargin(v, windowInsets);
return windowInsets;
});
// Show a blank view below the navbar to hide the menu content
final View navigationBarBackground = mFrame.findViewById(R.id.nav_bottom_sheet_nav_bar);
final View nextTurnContainer = mFrame.findViewById(R.id.nav_next_turn_container);

View File

@@ -281,6 +281,14 @@ public final class UiUtils
view.setPadding(systemInsets.left, systemInsets.top, systemInsets.right, view.getPaddingBottom());
}
public static void setViewNavigationTopInsetsMargin(View view, WindowInsetsCompat windowInsets)
{
final Insets systemInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) view.getLayoutParams();
lp.topMargin = systemInsets.top;
view.setLayoutParams(lp);
}
public static void setupNavigationIcon(@NonNull MaterialToolbar toolbar, @NonNull View.OnClickListener listener)
{
View customNavigationButton = toolbar.findViewById(R.id.back);

View File

@@ -11,13 +11,12 @@
<FrameLayout
android:layout_width="match_parent"
android:id="@+id/statutbar"
android:layout_height="15dp"
android:layout_height="1dp"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/street_frame"
android:layout_width="500dp"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_plus_eight"
android:layout_marginEnd="@dimen/margin_quarter"
app:cardCornerRadius="@dimen/margin_half"
android:elevation="@dimen/nav_elevation"
@@ -52,7 +51,6 @@
app:layout_constraintEnd_toStartOf="@+id/street_frame"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/statutbar"
android:layout_marginTop="@dimen/margin_half_plus_eight"
android:layout_marginStart="@dimen/margin_quarter"
android:clickable="true"
android:elevation="@dimen/nav_elevation">

View File

@@ -11,13 +11,12 @@
<FrameLayout
android:layout_width="match_parent"
android:id="@+id/statutbar"
android:layout_height="25dp"
android:layout_height="1dp"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/street_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_half_plus"
android:layout_marginStart="@dimen/nav_street_left"
android:layout_marginEnd="@dimen/margin_quarter"
app:cardCornerRadius="@dimen/margin_half"
@@ -55,7 +54,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/statutbar"
android:layout_marginStart="@dimen/margin_half"
android:layout_marginTop="@dimen/margin_half_plus"
android:clickable="true"
android:elevation="@dimen/nav_elevation">
<LinearLayout

View File

@@ -974,5 +974,4 @@
<string name="download_resources_custom_url_hint">https://cdn-fi-1.comaps.app/</string>
<string name="download_resources_custom_url_summary_none">Not set</string>
<string name="download_resources_custom_url_error_scheme">Please enter a full URL starting with https:// and ending with /</string>
<string name="unable_to_delete_list">The last list cannot be deleted. Create a new list to remove it</string>
</resources>

View File

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