Merge branch 'master' into export_ui_fixes
This commit is contained in:
commit
246af24ec3
16 changed files with 130 additions and 57 deletions
|
@ -17,6 +17,7 @@ android {
|
|||
}
|
||||
|
||||
lintOptions {
|
||||
tasks.lint.enabled = false
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
|
@ -339,17 +340,25 @@ task appStart(type: Exec) {
|
|||
// commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives(file("../OsmAnd-java/build/libs/OsmAnd-java-android-1.0.jar")) {
|
||||
name "OsmAnd-java-android"
|
||||
type "jar"
|
||||
}
|
||||
}
|
||||
|
||||
// Uploading artifacts to local path
|
||||
group = "net.osmand"
|
||||
group = 'net.osmand'
|
||||
uploadArchives {
|
||||
repositories.ivy {
|
||||
// credentials {
|
||||
// username ""
|
||||
// password ""
|
||||
// }
|
||||
|
||||
url = System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./"
|
||||
layout "pattern" , {
|
||||
artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
|
||||
artifact "[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"
|
||||
}
|
||||
|
||||
// def gitInfo = "git describe --long".execute().text.trim()
|
||||
|
|
|
@ -75,7 +75,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/route_info_bg"
|
||||
android:foreground="@drawable/bg_contextmenu_shadow"
|
||||
android:foregroundGravity="top|fill_horizontal">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
|
|
@ -117,7 +117,7 @@
|
|||
<string name="poi_police">شرطة</string>
|
||||
<string name="poi_artwork_type_fountain">نوع العمل الفني : نافورة</string>
|
||||
<string name="poi_craft_carpenter">نجار</string>
|
||||
<string name="poi_craft_plumber">سباك</string>
|
||||
<string name="poi_craft_plumber">سباكة</string>
|
||||
<string name="poi_car">معرض سيارات</string>
|
||||
<string name="poi_car_repair">ورشة تصليح السيارات</string>
|
||||
<string name="poi_recycling_printer_cartridges">خراطيش الطابعة</string>
|
||||
|
@ -702,7 +702,7 @@
|
|||
<string name="poi_beauty_salon_nails">تجميل الاظافر</string>
|
||||
<string name="poi_massage">صالون تدليك</string>
|
||||
<string name="poi_tattoo">صالون وشم</string>
|
||||
<string name="poi_dry_cleaning">التنظيف الجاف</string>
|
||||
<string name="poi_dry_cleaning">مغسلة ملابس</string>
|
||||
<string name="poi_laundry">غسيل الملابس</string>
|
||||
<string name="poi_car_rental">تأجير سيارات</string>
|
||||
<string name="poi_car_sharing">مشاركة السيارات</string>
|
||||
|
@ -1369,7 +1369,7 @@
|
|||
<string name="poi_health_specialty_social_paediatrics_yes">طب الأطفال الاجتماعي</string>
|
||||
<string name="poi_health_specialty_obstetrics_caesarean_section_yes">طب التوليد (القيصرية)</string>
|
||||
<string name="poi_health_specialty_addiction_medicine_yes">طب الإدمان</string>
|
||||
<string name="poi_health_specialty_optometry_yes">بصريات</string>
|
||||
<string name="poi_health_specialty_optometry_yes">نظارات/بصريات</string>
|
||||
<string name="poi_health_specialty_speech_therapy_yes">علاج النطق</string>
|
||||
<string name="poi_health_specialty_sports_medicine_yes">الطب الرياضي</string>
|
||||
<string name="poi_health_specialty_acupuncture_yes">الوخز بالإبر</string>
|
||||
|
@ -1739,7 +1739,7 @@
|
|||
<string name="poi_craft_plasterer">جصاص</string>
|
||||
<string name="poi_craft_parquet_layer">طبقة الباركيه</string>
|
||||
<string name="poi_craft_painter">دهان</string>
|
||||
<string name="poi_craft_optician">أخصائي بصريات</string>
|
||||
<string name="poi_craft_optician">محل نظارات/بصريات</string>
|
||||
<string name="poi_craft_metal_construction">حرفة الصناعات المعدنية</string>
|
||||
<string name="poi_craft_key_cutter">ناسخ مفاتيح</string>
|
||||
<string name="poi_craft_locksmith">صانع ومصلح المفاتيح</string>
|
||||
|
@ -2116,7 +2116,7 @@
|
|||
<string name="poi_piste_difficulty_easy">سهل</string>
|
||||
<string name="poi_rtsa_scale">مقياس RTSA</string>
|
||||
<string name="poi_windfall">متضرره من الرياح</string>
|
||||
<string name="poi_scrub">فيضة/شجيرات ربيعية</string>
|
||||
<string name="poi_scrub">فيضة/روضة</string>
|
||||
<string name="poi_heath">براح</string>
|
||||
<string name="poi_railway_level_crossing">مستوى العبور</string>
|
||||
<string name="poi_railway_crossing">معبر خط القطار</string>
|
||||
|
|
|
@ -400,7 +400,7 @@
|
|||
<string name="poi_diving">Buceo</string>
|
||||
<string name="poi_scuba_diving">Submarinismo</string>
|
||||
<string name="poi_dog_racing">Canódromo</string>
|
||||
<string name="poi_equestrian">Equitación</string>
|
||||
<string name="poi_equestrian">Deportes ecuestres</string>
|
||||
<string name="poi_field_hockey">Hockey sobre césped</string>
|
||||
<string name="poi_golf">Golf</string>
|
||||
<string name="poi_gymnastics">Gimnasia</string>
|
||||
|
@ -1234,7 +1234,7 @@
|
|||
<string name="poi_railway_crossing">Paso a nivel peatonal;Cruce peatonal ferroviario</string>
|
||||
<string name="poi_railway_level_crossing">Paso a nivel;Cruce ferroviario</string>
|
||||
<string name="poi_bird_hide">Observatorio de aves</string>
|
||||
<string name="poi_horse_riding">Equitación</string>
|
||||
<string name="poi_horse_riding">Centro ecuestre</string>
|
||||
<string name="poi_garden">Jardín</string>
|
||||
<string name="poi_grass">Césped</string>
|
||||
<string name="poi_grassland">Pastizal</string>
|
||||
|
|
|
@ -3948,17 +3948,17 @@
|
|||
<string name="icon_group_emergency">Emergencia</string>
|
||||
<string name="icon_group_amenity">Comodidad</string>
|
||||
<string name="file_already_imported">El archivo ya fue importado en OsmAnd</string>
|
||||
<string name="user_login">Nombre de usuario</string>
|
||||
<string name="use_login_password">Ingresar nombre de usuario y contraseña</string>
|
||||
<string name="user_login">Ingresar</string>
|
||||
<string name="use_login_password">Ingresar con usuario y contraseña</string>
|
||||
<string name="subscription_payment_issue_title">Hay un problema con la suscripción. Pulsa el botón para ir a los ajustes de la suscripción de Google Play y corregir el método de pago.</string>
|
||||
<string name="subscription_paused_title">La suscripción a OsmAnd Live se ha pausado</string>
|
||||
<string name="subscription_on_hold_title">La suscripción a OsmAnd Live está en espera</string>
|
||||
<string name="subscription_expired_title">La suscripción a OsmAnd Live ha caducado</string>
|
||||
<string name="sign_in_with_open_street_map">Ingresar con OpenStreetMap</string>
|
||||
<string name="send_files_to_openstreetmap">Enviar archivo GPX a OpenStreetMap</string>
|
||||
<string name="open_street_map_login_mode">Inicia sesión para subir los cambios nuevos o modificados,
|
||||
<string name="open_street_map_login_mode">Debes iniciar sesión para subir los cambios nuevos o modificados.
|
||||
\n
|
||||
\nya sea con OAuth o usando el nombre de usuario y contraseña.</string>
|
||||
\nPuedes ingresar usando el método seguro de OAuth o con nombre de usuario y contraseña.</string>
|
||||
<string name="message_you_need_add_two_points_to_show_graphs">Debes añadir al menos dos puntos</string>
|
||||
<string name="markers_history">Historial de marcadores</string>
|
||||
<string name="manage_subscription">Gestionar suscripción</string>
|
||||
|
@ -3973,10 +3973,10 @@
|
|||
<string name="shared_string_add_photo">Añadir foto</string>
|
||||
<string name="register_opr_have_account">Ya tengo cuenta</string>
|
||||
<string name="register_opr_create_new_account">Crear nueva cuenta</string>
|
||||
<string name="register_on_openplacereviews_desc">Ingresa en el sitio web del proyecto de datos abiertos OpenPlaceReviews.org para subir más fotos.</string>
|
||||
<string name="register_on_openplacereviews_desc">Las fotos son provistas por el proyecto de datos abiertos OpenPlaceReviews.org. Para subir fotos debes registrarte en el sitio web.</string>
|
||||
<string name="register_on_openplacereviews">Registrarse en
|
||||
\nOpenPlaceReviews.org</string>
|
||||
<string name="osm_login_descr">Ingresa usando el método seguro de OAuth o usa el nombre de usuario y contraseña.</string>
|
||||
<string name="osm_login_descr">Puedes iniciar sesión con el método seguro de OAuth o usar el nombre de usuario y contraseña.</string>
|
||||
<string name="osm_edit_comment_note">Comentar nota de OSM</string>
|
||||
<string name="osm_edit_close_note">Cerrar nota de OSM</string>
|
||||
<string name="shared_string_search_history">Historial de búsqueda</string>
|
||||
|
@ -3994,4 +3994,11 @@
|
|||
\nOpenPlaceReviews (fotos de PDI);
|
||||
\nMapillary (imágenes a nivel de calle);
|
||||
\nWeb / Wikimedia (fotos de PDI incluidas en los datos de OpenStreetMap).</string>
|
||||
<string name="use_dev_url_descr">Cambia a la versión para desarrolladores «dev.openstreetmap.org» en lugar de openstreetmap.org para probar la carga de PDI, notas de OSM y archivos GPX.</string>
|
||||
<string name="use_dev_url">Usar dev.openstreetmap.org</string>
|
||||
<string name="select_picture">Elegir imagen</string>
|
||||
<string name="select_items_for_import">Marca los elementos que serán importados.</string>
|
||||
<string name="select_groups_for_import">Marca los grupos que serán importados.</string>
|
||||
<string name="cannot_upload_image">No se puede subir la imagen, inténtalo más tarde</string>
|
||||
<string name="app_mode_gap">Separador</string>
|
||||
</resources>
|
|
@ -3815,7 +3815,7 @@ Area honi dagokio: %1$s x %2$s</string>
|
|||
<string name="save_global_track_interval_descr">Zehaztu lorratz orokorreko grabazio erregistroaren tartea (mapan \'Bidaia grabaketa\' trepetaren bidez aktibatuta dago).</string>
|
||||
<string name="open_saved_track">Ireki gordetako lorratza</string>
|
||||
<string name="gpx_upload_trackable_visibility_descr">\"Jarraigarria\" esan nahi du lorratza ez dela inolako zerrenda publikoetan agertzen, baina prozesatutako puntuak bere denbora markekin (zurekin zuzenean lotu ezin direnak) GPS API publikoaren deskargen bidez agertzen dira.</string>
|
||||
<string name="app_mode_wheelchair_forward"></string>
|
||||
<string name="app_mode_wheelchair_forward"/>
|
||||
<string name="icon_group_amenity">Prestazioa</string>
|
||||
<string name="login_open_street_map">OpenStreetMap-eko saio hasiera</string>
|
||||
<string name="login_open_street_map_org">OpenStreetMap.org-eko saio hasiera</string>
|
||||
|
@ -3876,7 +3876,7 @@ Area honi dagokio: %1$s x %2$s</string>
|
|||
\nbai OAuth-ekin edo zure erabiltzaile izena eta pasahitza erabiliz.</string>
|
||||
<string name="use_login_password">Hasi saioa erabiltzaile izenarekin eta pasahitzarekin</string>
|
||||
<string name="login_account">Kontua</string>
|
||||
<string name="user_login">Erabiltzaile-izena</string>
|
||||
<string name="user_login">Hasi saioa</string>
|
||||
<string name="manage_subscription">Kudeatu harpidetza</string>
|
||||
<string name="subscription_payment_issue_title">Arazo bat dago zure harpidetzarekin. Egin klik botoian Google Play harpidetzaren ezarpenetara joateko zure ordainketa-metodoa konpontzeko.</string>
|
||||
<string name="subscription_expired_title">OsmAnd Live harpidetza iraungi egin da</string>
|
||||
|
@ -3998,4 +3998,6 @@ Area honi dagokio: %1$s x %2$s</string>
|
|||
<string name="markers_history">Markatzaileen historia</string>
|
||||
<string name="send_files_to_openstreetmap">Bidali GPX fitxategia OpenStreetMap-era</string>
|
||||
<string name="osm_edit_comment_note">Egin iruzkina OSM oharrean</string>
|
||||
<string name="select_picture">Hautatu argazkia</string>
|
||||
<string name="use_dev_url">Erabili dev.openstreetmap.org</string>
|
||||
</resources>
|
|
@ -3838,4 +3838,30 @@
|
|||
<string name="poi_radar_tower">Радиолокационная вышка</string>
|
||||
<string name="poi_parking_layby">Придорожная стоянка</string>
|
||||
<string name="poi_parking_rooftop">На крыше</string>
|
||||
<string name="poi_diplomatic_services_citizen_services_no">Нет</string>
|
||||
<string name="poi_diplomatic_services_citizen_services_yes">Да</string>
|
||||
<string name="poi_diplomatic_services_immigrant_visas_no">Нет</string>
|
||||
<string name="poi_diplomatic_services_immigrant_visas_yes">Да</string>
|
||||
<string name="poi_diplomatic_services_non_immigrant_visas_no">Нет</string>
|
||||
<string name="poi_diplomatic_services_non_immigrant_visas_yes">Да</string>
|
||||
<string name="poi_liaison_representative_office">Представительство</string>
|
||||
<string name="poi_liaison_liaison_office">Офис</string>
|
||||
<string name="poi_consulate_honorary_consul">Почетный консул</string>
|
||||
<string name="poi_consulate_consulate_general">Генеральное консульство</string>
|
||||
<string name="poi_consulate_consular_office">Консульский офис</string>
|
||||
<string name="poi_consulate_yes">Во главе с консулом</string>
|
||||
<string name="poi_embassy_residence">Резиденция</string>
|
||||
<string name="poi_embassy_nunciature">Нунциатура</string>
|
||||
<string name="poi_embassy_mission">Миссия</string>
|
||||
<string name="poi_embassy_high_commission">Верховный комиссариат</string>
|
||||
<string name="poi_embassy_delegation">Делегация</string>
|
||||
<string name="poi_embassy_branch_embassy">Филиал</string>
|
||||
<string name="poi_embassy_yes">Во главе с послом</string>
|
||||
<string name="poi_diplomatic_liaison">Связь</string>
|
||||
<string name="poi_diplomatic_embassy">Посольство</string>
|
||||
<string name="poi_diplomatic_services_citizen_services_filter">Гражданские услуги</string>
|
||||
<string name="poi_diplomatic_services_immigrant_visas_filter">Иммиграционные визы</string>
|
||||
<string name="poi_diplomatic_services_non_immigrant_visas_filter">Неиммиграционные визы</string>
|
||||
<string name="poi_liaison_filter">Связь</string>
|
||||
<string name="poi_embassy_filter">Посольство</string>
|
||||
</resources>
|
|
@ -3991,4 +3991,5 @@
|
|||
<string name="register_on_openplacereviews_desc">Фотографии предоставлены проектом открытых данных OpenPlaceReviews.org. Чтобы отправить свои фотографии, необходимо зарегистрироваться на сайте.</string>
|
||||
<string name="cannot_upload_image">Невозможно отправить изображение, попробуйте позже</string>
|
||||
<string name="select_picture">Выбор изображения</string>
|
||||
<string name="app_mode_kayak">Каяк</string>
|
||||
</resources>
|
|
@ -27,7 +27,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
|
||||
private final static Log LOG = PlatformUtil.getLog(AnalyticsHelper.class);
|
||||
|
||||
private final static String ANALYTICS_UPLOAD_URL = "https://test.osmand.net/api/submit_analytics";
|
||||
private final static String ANALYTICS_UPLOAD_URL = "https://osmand.net/api/submit_analytics";
|
||||
private final static String ANALYTICS_FILE_NAME = "analytics.json";
|
||||
|
||||
private final static int DATA_PARCEL_SIZE = 500; // 500 events
|
||||
|
|
|
@ -27,14 +27,12 @@ import android.widget.ImageView;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.view.ContextThemeWrapper;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.data.Amenity;
|
||||
|
@ -42,11 +40,7 @@ import net.osmand.data.LatLon;
|
|||
import net.osmand.data.PointDescription;
|
||||
import net.osmand.data.QuadRect;
|
||||
import net.osmand.osm.io.NetworkUtils;
|
||||
import net.osmand.plus.OsmAndFormatter;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandPlugin;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.*;
|
||||
import net.osmand.plus.activities.ActivityResultListener;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
|
@ -69,7 +63,6 @@ import net.osmand.plus.widgets.TextViewEx;
|
|||
import net.osmand.plus.widgets.tools.ClickableSpanTouchListener;
|
||||
import net.osmand.util.Algorithms;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.openplacereviews.opendb.util.exception.FailedVerificationException;
|
||||
|
||||
|
@ -77,13 +70,7 @@ import java.io.BufferedInputStream;
|
|||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import static net.osmand.plus.mapcontextmenu.builders.cards.ImageCard.GetImageCardsTask.GetImageCardsListener;
|
||||
|
||||
|
@ -443,10 +430,12 @@ public class MenuBuilder {
|
|||
try {
|
||||
inputStream = app.getContentResolver().openInputStream(uri);
|
||||
if (inputStream != null) {
|
||||
uploadImageToPlace(view, inputStream);
|
||||
uploadImageToPlace(inputStream);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
String str = app.getString(R.string.cannot_upload_image);
|
||||
app.showToastMessage(str);
|
||||
} finally {
|
||||
Algorithms.closeStream(inputStream);
|
||||
}
|
||||
|
@ -455,7 +444,7 @@ public class MenuBuilder {
|
|||
t.start();
|
||||
}
|
||||
|
||||
private void uploadImageToPlace(View view, InputStream image) {
|
||||
private void uploadImageToPlace(InputStream image) {
|
||||
InputStream serverData = new ByteArrayInputStream(compressImage(image));
|
||||
final String baseUrl = OPRWebviewActivity.getBaseUrl(app);
|
||||
String url = baseUrl + "api/ipfs/image";
|
||||
|
@ -471,18 +460,35 @@ public class MenuBuilder {
|
|||
response);
|
||||
} catch (FailedVerificationException e) {
|
||||
LOG.error(e);
|
||||
app.showToastMessage(R.string.cannot_upload_image);
|
||||
checkTokenAndShowScreen();
|
||||
}
|
||||
if (res != 200) {
|
||||
//image was uploaded but not added to blockchain
|
||||
app.showToastMessage(R.string.cannot_upload_image);
|
||||
checkTokenAndShowScreen();
|
||||
} else {
|
||||
app.showToastMessage(R.string.successfully_uploaded_pattern, 1, 1);
|
||||
//refresh the image
|
||||
execute(new GetImageCardsTask(mapActivity, getLatLon(), getAdditionalCardParams(), imageCardListener));
|
||||
}
|
||||
} else {
|
||||
checkTokenAndShowScreen();
|
||||
}
|
||||
}
|
||||
|
||||
//This method runs on non main thread
|
||||
private void checkTokenAndShowScreen() {
|
||||
final String baseUrl = OPRWebviewActivity.getBaseUrl(app);
|
||||
final String name = OPRWebviewActivity.getUsernameFromCookie(app);
|
||||
final String privateKey = OPRWebviewActivity.getPrivateKeyFromCookie(app);
|
||||
if (openDBAPI.checkPrivateKeyValid(baseUrl, name, privateKey)) {
|
||||
app.showToastMessage(R.string.cannot_upload_image);
|
||||
} else {
|
||||
app.runInUIThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
OprStartFragment.showInstance(mapActivity.getSupportFragmentManager());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,9 @@ import net.osmand.util.OpeningHoursParser;
|
|||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.RoundingMode;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.ArrayList;
|
||||
|
@ -784,20 +786,29 @@ public class AmenityMenuBuilder extends MenuBuilder {
|
|||
String wikidataValue = amenity.getAdditionalInfo(Amenity.WIKIDATA);
|
||||
String wikimediaValue = amenity.getAdditionalInfo(Amenity.WIKIMEDIA_COMMONS);
|
||||
if (!Algorithms.isEmpty(imageValue)) {
|
||||
params.put("osm_image", imageValue);
|
||||
params.put("osm_image", getDecodedAdditionalInfo(imageValue));
|
||||
}
|
||||
if (!Algorithms.isEmpty(mapillaryValue)) {
|
||||
params.put("osm_mapillary_key", mapillaryValue);
|
||||
params.put("osm_mapillary_key", getDecodedAdditionalInfo(mapillaryValue));
|
||||
}
|
||||
if (!Algorithms.isEmpty(wikidataValue)) {
|
||||
params.put(Amenity.WIKIDATA, wikidataValue);
|
||||
params.put(Amenity.WIKIDATA, getDecodedAdditionalInfo(wikidataValue));
|
||||
}
|
||||
if (!Algorithms.isEmpty(wikimediaValue)) {
|
||||
params.put(Amenity.WIKIMEDIA_COMMONS, wikimediaValue);
|
||||
params.put(Amenity.WIKIMEDIA_COMMONS, getDecodedAdditionalInfo(wikimediaValue));
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
private String getDecodedAdditionalInfo(String additionalInfo) {
|
||||
try {
|
||||
return URLDecoder.decode(additionalInfo, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
return additionalInfo;
|
||||
}
|
||||
|
||||
private CollapsableView getPoiTypeCollapsableView(final Context context, boolean collapsed,
|
||||
@NonNull final List<PoiType> categoryTypes,
|
||||
final boolean poiAdditional, AmenityInfoRow textRow) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package net.osmand.plus.mapcontextmenu.builders.cards;
|
||||
|
||||
|
||||
import android.view.View;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import net.osmand.AndroidNetworkUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
|
@ -12,7 +12,6 @@ import org.json.JSONException;
|
|||
import org.json.JSONObject;
|
||||
|
||||
public class IPFSImageCard extends ImageCard {
|
||||
private static final String BASE_URL = "https://test.openplacereviews.org/api/ipfs/image-ipfs?cid=";
|
||||
private static final Log LOG = PlatformUtil.getLog(IPFSImageCard.class);
|
||||
|
||||
public IPFSImageCard(MapActivity mapActivity, JSONObject imageObject) {
|
||||
|
@ -23,6 +22,7 @@ public class IPFSImageCard extends ImageCard {
|
|||
} catch (JSONException e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
String BASE_URL = mapActivity.getString(R.string.opr_base_url) + "api/ipfs/image-ipfs?cid=";
|
||||
url = BASE_URL + cid;
|
||||
imageHiresUrl = BASE_URL + cid;
|
||||
imageUrl = BASE_URL + cid;
|
||||
|
|
|
@ -11,19 +11,21 @@ import android.webkit.CookieManager;
|
|||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
import net.osmand.plus.settings.backend.OsmandSettings;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class OPRWebviewActivity extends OsmandActionBarActivity {
|
||||
public static final String KEY_LOGIN = "LOGIN_KEY";
|
||||
public static String KEY_TITLE = "TITLE_KEY";
|
||||
public static final String KEY_TITLE = "TITLE_KEY";
|
||||
private static final String USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)";
|
||||
private WebView webView;
|
||||
private boolean isLogin = false;
|
||||
|
||||
|
@ -43,8 +45,13 @@ public class OPRWebviewActivity extends OsmandActionBarActivity {
|
|||
return getBaseUrl(ctx) + "signup";
|
||||
}
|
||||
|
||||
public static String getFinishUrl(Context ctx) {
|
||||
return getCookieUrl(ctx);
|
||||
public static List<String> getFinishUrls(Context ctx) {
|
||||
String googleOAuthFinishUrl = getBaseUrl(ctx) + "auth?code=4";
|
||||
String profileUrl = getCookieUrl(ctx);
|
||||
List<String> urls = new ArrayList<>();
|
||||
urls.add(googleOAuthFinishUrl);
|
||||
urls.add(profileUrl);
|
||||
return urls;
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
|
@ -76,6 +83,7 @@ public class OPRWebviewActivity extends OsmandActionBarActivity {
|
|||
}
|
||||
});
|
||||
webView = findViewById(R.id.printDialogWebview);
|
||||
webView.getSettings().setUserAgentString(USER_AGENT);
|
||||
webView.setWebViewClient(new CloseOnSuccessWebViewClient());
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
WebView.setWebContentsDebuggingEnabled(true);
|
||||
|
@ -124,9 +132,11 @@ public class OPRWebviewActivity extends OsmandActionBarActivity {
|
|||
public class CloseOnSuccessWebViewClient extends WebViewClient {
|
||||
@Override
|
||||
public void onPageFinished(WebView view, String url) {
|
||||
if (url.contains(getFinishUrl(OPRWebviewActivity.this)) && isLogin) {
|
||||
for (String furl : getFinishUrls(OPRWebviewActivity.this)) {
|
||||
if (url.contains(furl) && isLogin) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
super.onPageFinished(view, url);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import androidx.annotation.Nullable;
|
|||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.BuildConfig;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.UiUtilities;
|
||||
import net.osmand.plus.base.BaseOsmAndFragment;
|
||||
|
@ -74,7 +75,7 @@ public class OprStartFragment extends BaseOsmAndFragment {
|
|||
private void setURLSpan(View v) {
|
||||
String desc = requireContext().getString(R.string.register_on_openplacereviews_desc);
|
||||
SpannableString ss = new SpannableString(desc);
|
||||
ss.setSpan(new URLSpanNoUnderline("https://" + openPlaceReviewsUrl), desc.indexOf(openPlaceReviewsUrl),
|
||||
ss.setSpan(new URLSpanNoUnderline(getActivity().getString(R.string.opr_base_url)), desc.indexOf(openPlaceReviewsUrl),
|
||||
desc.indexOf(openPlaceReviewsUrl) + openPlaceReviewsUrl.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
v.<TextView>findViewById(R.id.start_opr_description).setText(ss);
|
||||
v.<TextView>findViewById(R.id.start_opr_description).setMovementMethod(LinkMovementMethod.getInstance());
|
||||
|
|
|
@ -92,11 +92,9 @@ public class OpenDBAPI {
|
|||
List<String> ids = new ArrayList<>(Arrays.asList(placeId));
|
||||
Map<String, Object> change = new TreeMap<>();
|
||||
Map<String, Object> images = new TreeMap<>();
|
||||
Map<String, Object> outdoor = new TreeMap<>();
|
||||
outdoor.put("outdoor", imageResponseList);
|
||||
images.put("append", outdoor);
|
||||
images.put("append", imageMap);
|
||||
change.put("version", "increment");
|
||||
change.put("images", images);
|
||||
change.put("images.review", images);
|
||||
edit.put("id", ids);
|
||||
edit.put("change", change);
|
||||
edit.put("current", new Object());
|
||||
|
|
|
@ -156,6 +156,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
if (view != null) {
|
||||
ImageButton closeButton = view.findViewById(R.id.close_button);
|
||||
buttonsShadow = view.findViewById(R.id.buttons_shadow);
|
||||
sortButton = view.findViewById(R.id.sort_button);
|
||||
closeButton.setImageDrawable(getContentIcon(AndroidUtils.getNavigationIconResId(app)));
|
||||
closeButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -219,6 +220,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
if (Algorithms.isEmpty(fileName)) {
|
||||
fileName = app.getString(R.string.shared_string_gpx_track);
|
||||
}
|
||||
sortButton.setVisibility(View.GONE);
|
||||
GPXInfo gpxInfo = new GPXInfo(fileName, file != null ? file.lastModified() : 0, file != null ? file.length() : 0);
|
||||
TrackEditCard importTrackCard = new TrackEditCard(mapActivity, gpxInfo);
|
||||
importTrackCard.setListener(this);
|
||||
|
@ -268,6 +270,7 @@ public class FollowTrackFragment extends ContextMenuScrollFragment implements Ca
|
|||
tracksCard = new TracksToFollowCard(mapActivity, list, defaultCategory);
|
||||
tracksCard.setListener(FollowTrackFragment.this);
|
||||
getCardsContainer().addView(tracksCard.build(mapActivity));
|
||||
sortButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue