mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-11 23:04:18 +00:00
Compare commits
1 Commits
jb_3d_laye
...
pnx_link
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ec25e0822 |
@@ -304,8 +304,8 @@ android {
|
||||
"ru",
|
||||
"sl",
|
||||
"sk",
|
||||
"sr",
|
||||
"b+sr+Latn",
|
||||
"sr-rCyrl",
|
||||
"sr-rLatn",
|
||||
"sv",
|
||||
"sw",
|
||||
"ta",
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
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;
|
||||
@@ -24,7 +19,6 @@ 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;
|
||||
|
||||
@@ -42,11 +36,6 @@ 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);
|
||||
|
||||
@@ -184,6 +184,20 @@ 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))
|
||||
|
||||
@@ -105,4 +105,12 @@ public class PlacePageUtils
|
||||
});
|
||||
popup.show();
|
||||
}
|
||||
|
||||
public static String buildPanoramaxURL(double lat, double lon)
|
||||
{
|
||||
final String panoramaxURL = "https://api.panoramax.xyz/?map=";
|
||||
final String levelZoom = "16";
|
||||
final String quality_score = "&pic_score=ABC";
|
||||
return panoramaxURL + levelZoom + "/" + lat + "/" + lon + quality_score;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import static android.view.View.GONE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static app.organicmaps.sdk.util.Utils.getLocalizedFeatureType;
|
||||
import static app.organicmaps.sdk.util.Utils.getTagValueLocalized;
|
||||
import static app.organicmaps.widget.placepage.PlacePageUtils.buildPanoramaxURL;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
@@ -290,6 +291,9 @@ public class PlacePageView extends Fragment
|
||||
openIn.setOnClickListener(this);
|
||||
openIn.setOnLongClickListener(this);
|
||||
openIn.setVisibility(VISIBLE);
|
||||
LinearLayout openPhotoViewer = mFrame.findViewById(R.id.ll__place_open_phviewer);
|
||||
openPhotoViewer.setOnClickListener(this);
|
||||
openPhotoViewer.setVisibility(VISIBLE);
|
||||
mTvLatlon = mFrame.findViewById(R.id.tv__place_latlon);
|
||||
mWifi = mFrame.findViewById(R.id.ll__place_wifi);
|
||||
mTvWiFi = mFrame.findViewById(R.id.tv__place_wifi);
|
||||
@@ -1005,6 +1009,8 @@ public class PlacePageView extends Fragment
|
||||
mMapObject.getName());
|
||||
Utils.openUri(requireContext(), Uri.parse(uri), R.string.uri_open_location_failed);
|
||||
}
|
||||
else if (id == R.id.ll__place_open_phviewer)
|
||||
Utils.openUrl(requireContext(), buildPanoramaxURL(mMapObject.getLat(),mMapObject.getLon()));
|
||||
else if (id == R.id.direction_frame)
|
||||
showBigDirection();
|
||||
else if (id == R.id.item_icon)
|
||||
@@ -1052,6 +1058,10 @@ public class PlacePageView extends Fragment
|
||||
mMapObject.getName());
|
||||
PlacePageUtils.copyToClipboard(requireContext(), mFrame, uri);
|
||||
}
|
||||
else if (id == R.id.ll__place_open_phviewer)
|
||||
{
|
||||
PlacePageUtils.copyToClipboard(requireContext(),mFrame, buildPanoramaxURL(mMapObject.getLat(),mMapObject.getLon()));
|
||||
}
|
||||
else if (id == R.id.ll__place_operator)
|
||||
items.add(mTvOperator.getText().toString());
|
||||
else if (id == R.id.ll__place_network)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
<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>
|
||||
@@ -37,25 +37,7 @@
|
||||
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"
|
||||
|
||||
@@ -71,6 +71,8 @@
|
||||
<include layout="@layout/place_page_latlon"/>
|
||||
|
||||
<include layout="@layout/place_page_open_in"/>
|
||||
|
||||
<include layout="@layout/place_page_open_photoviewer" />
|
||||
</LinearLayout>
|
||||
|
||||
<include
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/ll__place_open_phviewer"
|
||||
style="@style/PlacePageItemFrame"
|
||||
tools:background="#20FF0000"
|
||||
tools:visibility="visible">
|
||||
|
||||
<com.google.android.material.imageview.ShapeableImageView
|
||||
android:id="@+id/iv__place_open_phviewer"
|
||||
style="@style/PlacePageMetadataIcon"
|
||||
app:srcCompat="@drawable/ic_panoramax"
|
||||
app:tint="?colorSecondary"/>
|
||||
|
||||
<com.google.android.material.textview.MaterialTextView
|
||||
android:id="@+id/tv__place_open_phviewer"
|
||||
android:textAlignment="viewStart"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/open_place_in_pnx"
|
||||
android:textAppearance="@style/MwmTextAppearance.PlacePage.Accent"/>
|
||||
</LinearLayout>
|
||||
@@ -975,4 +975,5 @@
|
||||
<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="open_place_in_pnx">Open in Panoramax</string>
|
||||
</resources>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<locale android:name="ru" />
|
||||
<locale android:name="sl" />
|
||||
<locale android:name="sk" />
|
||||
<locale android:name="sr" />
|
||||
<locale android:name="sr-Cyrl" />
|
||||
<locale android:name="sr-Latn" />
|
||||
<locale android:name="sv" />
|
||||
<locale android:name="sw" />
|
||||
|
||||
@@ -22,6 +22,9 @@ 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";
|
||||
@@ -33,6 +36,13 @@ 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";
|
||||
|
||||
@@ -103,7 +103,6 @@ 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;}
|
||||
|
||||
Reference in New Issue
Block a user