Compare commits

..

4 Commits

Author SHA1 Message Date
Jean-Baptiste
71483808b4 [android] Add switch to enable 3D mode from layers bottomsheet
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-10 18:20:29 +01:00
Jean-Baptiste
cb4472c325 [android] Remove method to start facebook app
Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
2026-01-10 13:36:53 +01:00
Yannik Bloscheck
d432ead844 [styles] Fix label color for minigolf courses
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
2026-01-10 11:46:24 +01:00
x7z4w
c1137bd38a [android] Fix Serbian locale
Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
2026-01-09 20:12:57 +00:00
10 changed files with 48 additions and 48 deletions

View File

@@ -304,8 +304,8 @@ android {
"ru",
"sl",
"sk",
"sr-rCyrl",
"sr-rLatn",
"sr",
"b+sr+Latn",
"sv",
"sw",
"ta",

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,24 +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.yes, ((dialog, which) -> {
onAddButtonClick();
BookmarkManager.INSTANCE.deleteCategory(category.getId());
getAdapter().notifyDataSetChanged();
}))
.setNegativeButton(android.R.string.no,(dialog, which) -> dialog.dismiss())
.show();
}
BookmarkManager.INSTANCE.deleteCategory(category.getId());
getAdapter().notifyDataSetChanged();
}
private void onSettingsActionSelected(@NonNull BookmarkCategory category)

View File

@@ -1,17 +1,22 @@
package app.organicmaps.maplayer;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import app.organicmaps.MwmApplication;
import app.organicmaps.R;
import app.organicmaps.sdk.Framework;
import app.organicmaps.sdk.maplayer.Mode;
import app.organicmaps.sdk.util.SharedPropertiesUtils;
import app.organicmaps.util.ThemeSwitcher;
@@ -19,6 +24,7 @@ import app.organicmaps.util.Utils;
import app.organicmaps.util.bottomsheet.MenuBottomSheetFragment;
import app.organicmaps.widget.recycler.SpanningLinearLayoutManager;
import com.google.android.material.button.MaterialButton;
import com.google.android.material.materialswitch.MaterialSwitch;
import java.util.ArrayList;
import java.util.List;
@@ -36,6 +42,11 @@ public class ToggleMapLayerFragment extends Fragment
{
View mRoot = inflater.inflate(R.layout.fragment_toggle_map_layer, container, false);
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext());
final boolean _3DEnabled = sharedPreferences.getBoolean(ContextCompat.getString(requireContext(), R.string.pref_3d_buildings),true);
MaterialSwitch m3DSwitch = mRoot.findViewById(R.id._3d_button);
m3DSwitch.setChecked(_3DEnabled);
m3DSwitch.setOnCheckedChangeListener((CompoundButton buttonView, boolean isChecked) -> Framework.nativeSet3dMode(true, isChecked));
mMapButtonsController =
(MapButtonsController) requireActivity().getSupportFragmentManager().findFragmentById(R.id.map_buttons);
MaterialButton mCloseButton = mRoot.findViewById(R.id.close_button);

View File

@@ -184,20 +184,6 @@ public class Utils
}
}
public static void showFacebookPage(Activity activity)
{
try
{
// Exception is thrown if we don't have installed Facebook application.
getPackageInfo(activity.getPackageManager(), Constants.Package.FB_PACKAGE, 0);
activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.FB_OM_COMMUNITY_NATIVE)));
}
catch (final Exception e)
{
activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.FB_OM_COMMUNITY_HTTP)));
}
}
public static void openUrl(@NonNull Context context, @Nullable String url)
{
if (TextUtils.isEmpty(url))

View File

@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
<path
android:pathData="M520,600h120q33,0 56.5,-23.5T720,520v-80q0,-33 -23.5,-56.5T640,360L520,360v240ZM580,540v-120h60q8,0 14,6t6,14v80q0,8 -6,14t-14,6h-60ZM260,600h140q17,0 28.5,-11.5T440,560v-40q0,-17 -11.5,-28.5T400,480q17,0 28.5,-11.5T440,440v-40q0,-17 -11.5,-28.5T400,360L260,360v60h120v30h-80v60h80v30L260,540v60ZM160,800q-33,0 -56.5,-23.5T80,720v-480q0,-33 23.5,-56.5T160,160h640q33,0 56.5,23.5T880,240v480q0,33 -23.5,56.5T800,800L160,800ZM160,720h640v-480L160,240v480ZM160,720v-480,480Z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -37,7 +37,25 @@
app:layout_constraintTop_toTopOf="parent"
app:shapeAppearanceOverlay="@style/ShapeAppearanceOverlay.Button.Round" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/margin_quarter">
<com.google.android.material.imageview.ShapeableImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
app:srcCompat="@drawable/ic_3d_layer"
app:tint="?iconTint"/>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/_3d_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="@dimen/margin_half" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"

View File

@@ -975,5 +975,4 @@
<string name="download_resources_custom_url_message">Override the default map download server used for map downloads. Leave empty to use CoMaps default server.</string>
<string name="download_resources_custom_url_summary_none">Not set</string>
<string name="download_resources_custom_url_error_scheme">Please enter a URL starting with http:// or https://</string>
<string name="unable_to_delete_list">The app cannot work without at least one list. Do you want to remove it and create a new one?</string>
</resources>

View File

@@ -49,7 +49,7 @@
<locale android:name="ru" />
<locale android:name="sl" />
<locale android:name="sk" />
<locale android:name="sr-Cyrl" />
<locale android:name="sr" />
<locale android:name="sr-Latn" />
<locale android:name="sv" />
<locale android:name="sw" />

View File

@@ -22,9 +22,6 @@ public final class Constants
public static final String LEMMY = "https://sopuli.xyz/c/CoMaps";
public static final String BLUESKY = "https://bsky.app/profile/comaps.app";
public static final String PIXELFED = "https://pixelfed.social/comaps";
public static final String FB_OM_COMMUNITY_HTTP = "https://www.facebook.com/profile.php?id=61575286559965";
public static final String FB_OM_COMMUNITY_NATIVE = "fb://profile/61575286559965";
public static final String CODE_REPO = "https://codeberg.org/comaps/comaps";
public static final String COPYRIGHT = "file:///android_asset/copyright.html";
@@ -36,13 +33,6 @@ public final class Constants
private Url() {}
}
public static class Package
{
public static final String FB_PACKAGE = "com.facebook.katana";
private Package() {}
}
public static class Vendor
{
public static final String HUAWEI = "HUAWEI";

View File

@@ -103,6 +103,7 @@ node[tourism=wilderness_hut],
node[amenity=dojo],
node[leisure=dance],
node[leisure=fitness_centre],
node[leisure=miniature_golf],
node[leisure=sports_centre],
node[leisure=stadium],
{text-color: @sport_label;text-halo-radius: 0.1;text-halo-opacity: 0.7;text-halo-color: @label_halo_light;}