Merge branch 'master' into nav_settings_issues
# Conflicts: # OsmAnd/res/values/strings.xml
This commit is contained in:
commit
28d9cd4585
81 changed files with 1773 additions and 421 deletions
|
@ -61,7 +61,11 @@ task collectExternalResources {
|
|||
}
|
||||
|
||||
task androidJar(type: Jar) {
|
||||
dependsOn collectExternalResources, build
|
||||
if (!project.hasProperty('osmandCoreSimple')) {
|
||||
dependsOn collectExternalResources, build
|
||||
} else {
|
||||
dependsOn build
|
||||
}
|
||||
appendix = "android"
|
||||
from (sourceSets.main.java.outputDir) {
|
||||
exclude("**/PlatformUtil.*")
|
||||
|
@ -70,7 +74,9 @@ task androidJar(type: Jar) {
|
|||
}
|
||||
|
||||
compileJava {
|
||||
dependsOn collectExternalResources
|
||||
if (!project.hasProperty('osmandCoreSimple')) {
|
||||
dependsOn collectExternalResources
|
||||
}
|
||||
}
|
||||
|
||||
artifacts {
|
||||
|
|
|
@ -407,7 +407,7 @@ public class BinaryMapTransportReaderAdapter {
|
|||
int tag = WireFormat.getTagFieldNumber(t);
|
||||
switch (tag) {
|
||||
case 0:
|
||||
return;
|
||||
break;
|
||||
case OsmandOdb.StringTable.S_FIELD_NUMBER:
|
||||
if (current == values[i]) {
|
||||
String value = codedIS.readString();
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.apache.commons.logging.Log;
|
|||
public class RoutePlannerFrontEnd {
|
||||
|
||||
protected static final Log log = PlatformUtil.getLog(RoutePlannerFrontEnd.class);
|
||||
protected static final double GPS_POSSIBLE_ERROR = 10;
|
||||
public boolean useSmartRouteRecalculation = true;
|
||||
|
||||
|
||||
|
@ -78,13 +79,24 @@ public class RoutePlannerFrontEnd {
|
|||
double currentsDistSquare = squareDist((int) pr.x, (int) pr.y, px, py);
|
||||
if (road == null || currentsDistSquare < road.distSquare) {
|
||||
RouteDataObject ro = new RouteDataObject(r);
|
||||
|
||||
road = new RouteSegmentPoint(ro, j, currentsDistSquare);
|
||||
road.preciseX = (int) pr.x;
|
||||
road.preciseY = (int) pr.y;
|
||||
}
|
||||
}
|
||||
if (road != null) {
|
||||
list.add(road);
|
||||
if(!transportStop) {
|
||||
float prio = ctx.getRouter().defineSpeedPriority(road.road);
|
||||
if (prio > 0) {
|
||||
road.distSquare = (road.distSquare + GPS_POSSIBLE_ERROR * GPS_POSSIBLE_ERROR)
|
||||
/ (prio * prio);
|
||||
list.add(road);
|
||||
}
|
||||
} else {
|
||||
list.add(road);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +111,7 @@ public class RoutePlannerFrontEnd {
|
|||
RouteSegmentPoint ps = null;
|
||||
if (ctx.publicTransport) {
|
||||
for (RouteSegmentPoint p : list) {
|
||||
if (transportStop && p.distSquare > 100) {
|
||||
if (transportStop && p.distSquare > GPS_POSSIBLE_ERROR * GPS_POSSIBLE_ERROR) {
|
||||
break;
|
||||
}
|
||||
boolean platform = p.road.platform();
|
||||
|
|
|
@ -222,6 +222,11 @@ public class RouteResultPreparation {
|
|||
}
|
||||
}
|
||||
|
||||
// decrease speed proportionally from 15ms (50kmh)
|
||||
private static final double SLOW_DOWN_SPEED_THRESHOLD = 15;
|
||||
// reference speed 30ms (108kmh) - 2ms (7kmh)
|
||||
private static final double SLOW_DOWN_SPEED = 2;
|
||||
|
||||
private void calculateTimeSpeed(RoutingContext ctx, List<RouteSegmentResult> result) throws IOException {
|
||||
//for Naismith
|
||||
boolean usePedestrianHeight = ((((GeneralRouter) ctx.getRouter()).getProfile() == GeneralRouterProfile.PEDESTRIAN) && ((GeneralRouter) ctx.getRouter()).getHeightObstacles());
|
||||
|
@ -234,10 +239,8 @@ public class RouteResultPreparation {
|
|||
if (speed == 0) {
|
||||
speed = ctx.getRouter().getMinDefaultSpeed();
|
||||
} else {
|
||||
if(speed > 15) {
|
||||
// decrease speed proportionally from 15ms=50kmh -
|
||||
// reference speed 30ms=108kmh - 7kmh
|
||||
speed = speed - ((speed - 15f) / (30f - 15f) * 2f);
|
||||
if (speed > SLOW_DOWN_SPEED_THRESHOLD) {
|
||||
speed = speed - (speed / SLOW_DOWN_SPEED_THRESHOLD - 1) * SLOW_DOWN_SPEED;
|
||||
}
|
||||
}
|
||||
boolean plus = rr.getStartPointIndex() < rr.getEndPointIndex();
|
||||
|
|
|
@ -218,7 +218,8 @@ public class SearchUICore {
|
|||
}
|
||||
|
||||
public boolean sameSearchResult(SearchResult r1, SearchResult r2) {
|
||||
if (r1.location != null && r2.location != null) {
|
||||
if (r1.location != null && r2.location != null &&
|
||||
!ObjectType.isTopVisible(r1.objectType) && !ObjectType.isTopVisible(r2.objectType)) {
|
||||
if (r1.objectType == r2.objectType) {
|
||||
if (r1.objectType == ObjectType.STREET) {
|
||||
Street st1 = (Street) r1.object;
|
||||
|
|
|
@ -516,16 +516,14 @@ public class SearchCoreFactory {
|
|||
if (!phrase.isUnknownSearchWordPresent()) {
|
||||
return false;
|
||||
}
|
||||
if (phrase.isNoSelectedType() && phrase.isUnknownSearchWordPresent()
|
||||
&& phrase.isUnknownSearchWordComplete() && phrase.hasUnknownSearchWordPoiTypes()) {
|
||||
return false;
|
||||
}
|
||||
boolean hasUnselectedType = phrase.isNoSelectedType() && phrase.isUnknownSearchWordPresent()
|
||||
&& phrase.isUnknownSearchWordComplete() && phrase.hasUnknownSearchWordPoiTypes();
|
||||
final BinaryMapIndexReader[] currentFile = new BinaryMapIndexReader[1];
|
||||
Iterator<BinaryMapIndexReader> offlineIterator = phrase.getRadiusOfflineIndexes(BBOX_RADIUS,
|
||||
SearchPhraseDataType.POI);
|
||||
String searchWord = phrase.getUnknownWordToSearch();
|
||||
final NameStringMatcher nm = phrase.getNameStringMatcher(searchWord, phrase.isUnknownSearchWordComplete());
|
||||
String unknownSearchPhrase = phrase.getUnknownSearchPhrase().trim();
|
||||
String searchWord = hasUnselectedType ? unknownSearchPhrase : phrase.getUnknownWordToSearch();
|
||||
final NameStringMatcher nm = phrase.getNameStringMatcher(searchWord, phrase.isUnknownSearchWordComplete());
|
||||
final NameStringMatcher phraseMatcher;
|
||||
if (!Algorithms.isEmpty(unknownSearchPhrase)) {
|
||||
phraseMatcher = new NameStringMatcher(unknownSearchPhrase, StringMatcherMode.CHECK_EQUALS);
|
||||
|
|
|
@ -88,6 +88,10 @@ android {
|
|||
disable 'InvalidPackage'
|
||||
disable 'MissingTranslation'
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
exclude 'META-INF/proguard/androidx-annotations.pro'
|
||||
}
|
||||
}
|
||||
|
||||
task downloadTdLibzip {
|
||||
|
@ -149,4 +153,5 @@ dependencies {
|
|||
exclude group: 'com.android.support'
|
||||
}
|
||||
implementation 'org.jetbrains:annotations-java5:15.0'
|
||||
implementation 'androidx.annotation:annotation:1.1.0'
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
<string name="disable_monitoring">تعطيل العرض</string>
|
||||
<string name="location_recording_enabled">تسجيل الموقع ممكن</string>
|
||||
<string name="timeline_description">تمكين العرض لتوفير جميع المواقع في السجل.</string>
|
||||
<string name="app_name_short_online">المتتبع عبر النت</string>
|
||||
<string name="app_name_short">متتبعOsmAnd</string>
|
||||
<string name="shared_string_telegram">تيليجرام</string>
|
||||
<string name="privacy_policy_use_telegram">يستخدم تيليجرام (تطبيق المراسلة) للاتصال والتواصل مع الأشخاص.</string>
|
||||
|
|
|
@ -199,7 +199,6 @@
|
|||
<string name="disable_monitoring">Выключыць маніторынг</string>
|
||||
<string name="location_recording_enabled">Запіс месцазнаходжання ўключаны</string>
|
||||
<string name="timeline_description">Уключыць маніторынг, каб захоўваць пункты месцазнаходжання ў гісторыі.</string>
|
||||
<string name="app_name_short_online">Сеціўны назіральнік</string>
|
||||
<string name="app_name_short">Назіральнік OsmAnd</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (дадатак для ліставання) выкарыстоўваецца для зносін паміж людзьмі.</string>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<string name="privacy_policy_use_telegram">Telegram (l\'aplicació de missatgeria) s\'utilitza per connectar i comunicar amb la gent.</string>
|
||||
<string name="please_update_osmand">Actualitzeu OsmAnd per veure les dades al mapa</string>
|
||||
<string name="device_added_successfully">S\'ha afegit %1$s.</string>
|
||||
<string name="battery_optimization_description">Desactiveu l\'optimització de bateria per OsmAnd Telegram perquè no s\'aturi sobtadament quan quedi en procés de fons.</string>
|
||||
<string name="battery_optimization_description">Desactiveu l\'optimització de bateria per OsmAnd Tracker perquè no s\'aturi sobtadament quan quedi en procés de fons.</string>
|
||||
<string name="go_to_settings">Ves a la configuració</string>
|
||||
<string name="choose_osmand_desc">Seleccioneu la versió d\'OsmAnd on els contactes es situaran al mapa.</string>
|
||||
<string name="choose_osmand">Seleccioneu la versió d\'OsmAnd a utilitzar</string>
|
||||
|
@ -19,11 +19,11 @@
|
|||
<string name="time_ago">ja fa</string>
|
||||
<string name="last_response">Darrera resposta</string>
|
||||
<string name="logout_no_internet_msg">Connecteu a Internet per sortir correctament de Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Per aturar l\'accés a compartir la posició. Obriu Telegram, aneu a Configuració → Seguretat i Privacitat→ Sessions, i tanqueu la sessió d\'OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Per aturar l\'accés a compartir la posició. Obriu Telegram, aneu a Configuració → Seguretat i Privacitat→ Sessions, i tanqueu la sessió d\'OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Com aturar des de Telegram l\'enregistrador OsmAnd</string>
|
||||
<string name="logout_help_desc">Com aturar des de Telegram l\'enregistrador OsmAnd</string>
|
||||
<string name="in_time">dins %@</string>
|
||||
<string name="osmand_connect_desc">Seleccioneu la versió d\'OsmAnd que OsmAnd Telegram utilitzarà per mostrar la posició.</string>
|
||||
<string name="osmand_connect_desc">Seleccioneu la versió d\'OsmAnd que OsmAnd Tracker utilitzarà per mostrar la posició.</string>
|
||||
<string name="osmand_connect">Connecta a OsmAnd</string>
|
||||
<string name="location_history_desc">Amaga els contactes quiets més d\'un temps determinat.</string>
|
||||
<string name="stale_location">Aturat</string>
|
||||
|
@ -44,7 +44,6 @@
|
|||
<string name="my_location_search_hint">Cerca: Grup o contacte</string>
|
||||
<string name="authentication_code_descr">Telegram us ha enviat un codi perquè OsmAnd pugui entrar en el vostre compte.</string>
|
||||
<string name="closing">S\'està tancant</string>
|
||||
<string name="app_name_short_online">Rastrejador en línia</string>
|
||||
<string name="app_name_short">Rastrejador OsmAnd</string>
|
||||
<string name="privacy_policy_telegram_client">El rastrejador d\'OsmAnd és un dels clients que usen la plataforma oberta de Telegram. Els vostres contactes poden usar qualsevol altra client de Telegram.</string>
|
||||
<string name="privacy_policy_agree">En fer clic a continuar, accepteu les condicions de la Política de Privadesa de Telegram i de la Política de Privadesa d\'OsmAnd.</string>
|
||||
|
@ -113,8 +112,8 @@
|
|||
<string name="add_device">Afegeix un aparell</string>
|
||||
<string name="share_location_as">Comparteix la ubicació com a</string>
|
||||
<string name="live_now_description">Contactes i grups que compateixen la ubicació amb vós.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Esteu segur de voler tancar la sessió a OsmAnd Telegram i deixar de poder compartir la ubicació o veure la ubicació d\'altres usuaris\?</string>
|
||||
<string name="logout_from_osmand_telegram">Voleu tancar la sessió de l\'OsmAnd Telegram\?</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Esteu segur de voler tancar la sessió a OsmAnd Tracker i deixar de poder compartir la ubicació o veure la ubicació d\'altres usuaris\?</string>
|
||||
<string name="logout_from_osmand_telegram">Voleu tancar la sessió de l\'OsmAnd Tracker\?</string>
|
||||
<string name="shared_string_name">Nom</string>
|
||||
<string name="by_distance">Per distància</string>
|
||||
<string name="by_name">Per nom</string>
|
||||
|
@ -147,7 +146,7 @@
|
|||
<string name="shared_string_back">Enrere</string>
|
||||
<string name="start_location_sharing">Comparteix la ubicació</string>
|
||||
<string name="show_on_map">Mostra-ho al mapa</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Número de telèfon</string>
|
||||
<string name="phone_number_descr">Número de telèfon en format internacional</string>
|
||||
<string name="shared_string_password">Contrasenya</string>
|
||||
|
@ -170,7 +169,7 @@
|
|||
<string name="osmand_service">Mode en segon pla</string>
|
||||
<string name="shared_string_distance">Distància</string>
|
||||
<string name="share_location">Comparteix la ubicació</string>
|
||||
<string name="process_service">Servei d\'OsmAnd Telegram</string>
|
||||
<string name="process_service">Servei d\'OsmAnd Tracker</string>
|
||||
<string name="osmand_logo">Logo de l\'OsmAnd</string>
|
||||
<string name="install_osmand_dialog_message">Cal que primer instal·leu la versió gratuïta o la de pagament de l\'OsmAnd</string>
|
||||
<string name="install_osmand">Instal·la l\'OsmAnd</string>
|
||||
|
@ -207,7 +206,7 @@
|
|||
<string name="search_contacts_descr">Cerca per tots els grups i contactes.</string>
|
||||
<string name="type_contact_or_group_name">Escriviu un nom de contacte o de grup</string>
|
||||
<string name="shared_string_search">Cerca</string>
|
||||
<string name="osmand_service_descr">OsmAnd Telegram s\'executa en procés de fons amb la pantalla tancada.</string>
|
||||
<string name="osmand_service_descr">OsmAnd Tracker s\'executa en procés de fons amb la pantalla tancada.</string>
|
||||
<string name="sharing_location">S\'està compartint la ubicació</string>
|
||||
<string name="min_mile">min/m</string>
|
||||
<string name="min_km">min/km</string>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<string name="share_location_as">Del placering som</string>
|
||||
<string name="live_now_description">Kontakter og grupper som der deles placering med.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">"Bekræft log af OsmAnd Tracker, der kan ikke deles placering eller se placering af andre\?"</string>
|
||||
<string name="logout_from_osmand_telegram">Log ud af OsmAnd Telegram\?</string>
|
||||
<string name="logout_from_osmand_telegram">Log ud af OsmAnd Tracker\?</string>
|
||||
<string name="shared_string_name">Navn</string>
|
||||
<string name="by_distance">Efter afstand</string>
|
||||
<string name="by_name">Efter navn</string>
|
||||
|
@ -38,7 +38,7 @@
|
|||
<string name="shared_string_group">Gruppe</string>
|
||||
<string name="logout_no_internet_msg">Opret forbindelse til Internettet for at logge ud af Telegram.</string>
|
||||
<string name="shared_string_close">Luk</string>
|
||||
<string name="disconnect_from_telegram_desc">Sådan tilbagekaldes adgang til placeringsdeling. Åbn Telegram, gå til Settings - Privacy and Security - Sessions og afslut OsmAnd Telegram session.</string>
|
||||
<string name="disconnect_from_telegram_desc">Sådan tilbagekaldes adgang til placeringsdeling. Åbn Telegram, gå til Settings - Privacy and Security - Sessions og afslut OsmAnd Tracker session.</string>
|
||||
<string name="disconnect_from_telegram">Sådan afbrydes OsmAnd Tracker fra Telegram</string>
|
||||
<string name="logout_help_desc">Sådan afbrydes OsmAnd Tracker fra Telegram</string>
|
||||
<string name="connected_account">Tilsluttet konto</string>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<string name="my_location_search_hint">Søg: gruppe eller kontakt</string>
|
||||
<string name="start_location_sharing">Del placering</string>
|
||||
<string name="show_on_map">Vis på kort</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Telefonnummer</string>
|
||||
<string name="phone_number_descr">Telefonnummer i internationalt format</string>
|
||||
<string name="shared_string_password">Adgangskode</string>
|
||||
|
@ -199,7 +199,6 @@
|
|||
<string name="disable_monitoring">Deaktiver overvågning</string>
|
||||
<string name="location_recording_enabled">Placeringsregistrering aktiveret</string>
|
||||
<string name="timeline_description">Aktiver overvågning for at gemme alle placeringer i historikken.</string>
|
||||
<string name="app_name_short_online">Online sporing</string>
|
||||
<string name="app_name_short">OsmAnd Tracker</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (besked app) bruges til at forbinde og kommunikere med mennesker.</string>
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<string name="last_available_location">Letzter verfügbarer Standort</string>
|
||||
<string name="share_location_as">Standort teilen als</string>
|
||||
<string name="live_now_description">Kontakte und Gruppen, die ihren Standort mit Ihnen teilen.</string>
|
||||
<string name="logout_from_osmand_telegram">Aus OsmAnd Telegram abmelden\?</string>
|
||||
<string name="logout_from_osmand_telegram">Aus OsmAnd Tracker abmelden\?</string>
|
||||
<string name="shared_string_name">"Name "</string>
|
||||
<string name="by_distance">Nach Entfernung</string>
|
||||
<string name="by_name">Nach Namen</string>
|
||||
|
@ -35,7 +35,7 @@
|
|||
<string name="connected_account">Verbundenes Konto</string>
|
||||
<string name="shared_string_account">Konto</string>
|
||||
<string name="in_time">"in %1$s "</string>
|
||||
<string name="osmand_connect_desc">Wählen Sie die OsmAnd-Version, die OsmAnd Telegram verwendet, um Positionen anzuzeigen.</string>
|
||||
<string name="osmand_connect_desc">Wählen Sie die OsmAnd-Version, die OsmAnd Tracker verwendet, um Positionen anzuzeigen.</string>
|
||||
<string name="osmand_connect">OsmAnd verbinden</string>
|
||||
<string name="location_history_desc">Blendet Kontakte aus, die sich eine bestimmte Zeit lang nicht bewegt haben.</string>
|
||||
<string name="location_history">Standortverlauf</string>
|
||||
|
@ -64,7 +64,7 @@
|
|||
<string name="set_time">Zeit einstellen</string>
|
||||
<string name="my_location_search_hint">Suche: Gruppe oder Kontakt</string>
|
||||
<string name="show_on_map">Auf Karte anzeigen</string>
|
||||
<string name="app_name">"OsmAnd Telegram "</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Telefonnummer</string>
|
||||
<string name="phone_number_descr">Telefonnummer in internationalem Format</string>
|
||||
<string name="shared_string_password">Passwort</string>
|
||||
|
@ -81,10 +81,10 @@
|
|||
<string name="no_location_permission">Der App fehlt die Berechtigung, auf Standortdaten zuzugreifen.</string>
|
||||
<string name="gps_not_available">Bitte schalten Sie \"Standort\" in den Systemeinstellungen ein</string>
|
||||
<string name="osmand_service">Hintergrundmodus</string>
|
||||
<string name="osmand_service_descr">OsmAnd Telegram läuft im Hintergrund bei ausgeschaltetem Bildschirm.</string>
|
||||
<string name="osmand_service_descr">OsmAnd Tracker läuft im Hintergrund bei ausgeschaltetem Bildschirm.</string>
|
||||
<string name="shared_string_distance">Distanz</string>
|
||||
<string name="share_location">Standort teilen</string>
|
||||
<string name="process_service">OsmAnd Telegram-Service</string>
|
||||
<string name="process_service">OsmAnd Tracker-Service</string>
|
||||
<string name="osmand_logo">OsmAnd-Logo</string>
|
||||
<string name="install_osmand_dialog_message">Sie müssen zuerst die kostenlose oder kostenpflichtige Version von OsmAnd installieren</string>
|
||||
<string name="install_osmand">OsmAnd installieren</string>
|
||||
|
@ -131,11 +131,11 @@
|
|||
<string name="nm_h">kn/h</string>
|
||||
<string name="last_updated_location">Zuletzt aktualisierter Ort:</string>
|
||||
<string name="not_possible_to_send_to_telegram_chats">Es ist nicht möglich, an Telegram-Chats zu senden:</string>
|
||||
<string name="battery_optimization_description">Schalten Sie die Batterieoptimierung für OsmAnd Telegram aus, damit es nicht plötzlich im Hintergrund ausgeschaltet wird.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Sind Sie sicher, dass Sie sich von OsmAnd Telegram abmelden möchten, so dass Sie den Standort nicht teilen oder den Standort anderer sehen können\?</string>
|
||||
<string name="battery_optimization_description">Schalten Sie die Batterieoptimierung für OsmAnd Tracker aus, damit es nicht plötzlich im Hintergrund ausgeschaltet wird.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Sind Sie sicher, dass Sie sich von OsmAnd Tracker abmelden möchten, so dass Sie den Standort nicht teilen oder den Standort anderer sehen können\?</string>
|
||||
<string name="disable_all_sharing_desc">Schaltet die Standortfreigabe für alle ausgewählten Chats aus (%1$d).</string>
|
||||
<string name="disable_all_sharing">Alle Freigaben deaktivieren</string>
|
||||
<string name="disconnect_from_telegram_desc">Um den Zugriff auf die Standortfreigabe zu widerrufen, öffnen Sie Telegram, gehen zu Einstellungen → Datenschutz und Sicherheit → Sitzungen und beenden die OsmAnd Telegram-Sitzung.</string>
|
||||
<string name="disconnect_from_telegram_desc">Um den Zugriff auf die Standortfreigabe zu widerrufen, öffnen Sie Telegram, gehen zu Einstellungen → Datenschutz und Sicherheit → Sitzungen und beenden die OsmAnd Tracker-Sitzung.</string>
|
||||
<string name="disconnect_from_telegram">So deaktivieren Sie OsmAnd Tracker von Telegram aus</string>
|
||||
<string name="logout_help_desc">So deaktivieren Sie OsmAnd Tracker von Telegram aus</string>
|
||||
<string name="stale_location">Keine Bewegung</string>
|
||||
|
@ -198,7 +198,6 @@
|
|||
<string name="privacy_policy_use_telegram">Telegram (die Messaging-App) wird verwendet, um sich mit Menschen zu verbinden und mit ihnen zu kommunizieren.</string>
|
||||
<string name="shared_string_ok">OK</string>
|
||||
<string name="location_recording_enabled">Standortaufzeichnung aktiviert</string>
|
||||
<string name="app_name_short_online">Online-Tracker</string>
|
||||
<string name="app_name_short">OsmAnd-Tracker</string>
|
||||
<string name="shared_string_accept">Akzeptieren</string>
|
||||
<string name="telegram_privacy_policy">Telegram-Datenschutzerklärung</string>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<string name="shared_string_group">Grupo</string>
|
||||
<string name="logout_no_internet_msg">Conéctese a Internet para cerrar sesión en Telegram correctamente.</string>
|
||||
<string name="shared_string_close">Cerrar</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revocar el acceso a la ubicación compartida. Abra Telegram, vaya a «Ajustes → Privacidad y Seguridad → Sesiones» y cierre sesión de OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revocar el acceso a la ubicación compartida. Abra Telegram, vaya a «Ajustes → Privacidad y Seguridad → Sesiones» y cierre sesión de OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Cómo desactivar el rastreador de OsmAnd desde Telegram</string>
|
||||
<string name="logout_help_desc">Cómo desactivar el rastreador de OsmAnd (en inglés como «OsmAnd Tracker») desde Telegram</string>
|
||||
<string name="connected_account">Cuenta conectada</string>
|
||||
|
@ -210,7 +210,6 @@
|
|||
<string name="disable_monitoring">Desactivar la monitorización</string>
|
||||
<string name="location_recording_enabled">Grabación de ubicación activada</string>
|
||||
<string name="timeline_description">Activa la monitorización para guardar todas las ubicaciones en el historial.</string>
|
||||
<string name="app_name_short_online">Rastreador en línea</string>
|
||||
<string name="app_name_short">Rastreador de OsmAnd</string>
|
||||
<string name="search_contacts">Buscar contactos</string>
|
||||
<string name="search_contacts_descr">Busca en todos tus grupos y contactos.</string>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<string name="shared_string_group">Grupo</string>
|
||||
<string name="logout_no_internet_msg">Conéctese a Internet para cerrar sesión en Telegram correctamente.</string>
|
||||
<string name="shared_string_close">Cerrar</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revocar el acceso a la ubicación compartida. Abra Telegram, vaya a «Ajustes → Privacidad y Seguridad → Sesiones» y cierre sesión de OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revocar el acceso a la ubicación compartida. Abra Telegram, vaya a «Ajustes → Privacidad y Seguridad → Sesiones» y cierre sesión de OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Cómo desactivar el rastreador de OsmAnd desde Telegram</string>
|
||||
<string name="logout_help_desc">Cómo desactivar el rastreador de OsmAnd (en inglés como «OsmAnd Tracker») desde Telegram</string>
|
||||
<string name="connected_account">Cuenta conectada</string>
|
||||
|
@ -198,7 +198,6 @@
|
|||
<string name="disable_monitoring">Desactivar la monitorización</string>
|
||||
<string name="location_recording_enabled">Grabación de ubicación activada</string>
|
||||
<string name="timeline_description">Active la monitorización para guardar todas las ubicaciones en el historial.</string>
|
||||
<string name="app_name_short_online">Rastreador en línea</string>
|
||||
<string name="app_name_short">Rastreador de OsmAnd</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (la aplicación de mensajería) se utiliza para conectar y comunicar a las personas.</string>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<string name="disable_monitoring">Desgaitu kontrola</string>
|
||||
<string name="location_recording_enabled">Kokapen grabaketa gaituta</string>
|
||||
<string name="timeline_description">Gaitu kontrola zure kokapen guztiak historian gordetzeko.</string>
|
||||
<string name="app_name_short_online">Online Aztarnaria</string>
|
||||
<string name="app_name_short">OsmAnd Aztarnaria</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (mezularitza aplikazioa) jendearekin konektatzeko eta komunikatzeko erabiltzen da.</string>
|
||||
|
@ -78,7 +77,7 @@
|
|||
<string name="shared_string_back">Atzera</string>
|
||||
<string name="start_location_sharing">Partekatu kokapena</string>
|
||||
<string name="show_on_map">Erakutsi mapan</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Telefono zenbakia</string>
|
||||
<string name="phone_number_descr">Telefono zenbakia formatu internazionalean</string>
|
||||
<string name="shared_string_password">Pasahitza</string>
|
||||
|
@ -101,7 +100,7 @@
|
|||
<string name="shared_string_distance">Distantzia</string>
|
||||
<string name="share_location">Partekatu kokapena</string>
|
||||
<string name="sharing_location">Partekatzen kokapena</string>
|
||||
<string name="process_service">OsmAnd Telegram zebitzua</string>
|
||||
<string name="process_service">OsmAnd Tracker zebitzua</string>
|
||||
<string name="osmand_logo">OsmAnd logoa</string>
|
||||
<string name="install_osmand_dialog_message">OsmAnd doako edo ordainpeko bertsioa instalatu behar duzu lehenik</string>
|
||||
<string name="install_osmand">Instalatu OsmAnd</string>
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
<string name="add_device">Engadir dispositivo</string>
|
||||
<string name="share_location_as">Compartillar ubicación coma</string>
|
||||
<string name="live_now_description">Contactos e grupos que están a compartilla-la túa ubicación para ti.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Estás na certeza de que desexas desconectarte do OsmAnd Telegram para non poder compartilla-la ubicación ou olla-la ubicación doutros\?</string>
|
||||
<string name="logout_from_osmand_telegram">Pecha-la sesión do OsmAnd Telegram\?</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Estás na certeza de que desexas desconectarte do OsmAnd Tracker para non poder compartilla-la ubicación ou olla-la ubicación doutros\?</string>
|
||||
<string name="logout_from_osmand_telegram">Pecha-la sesión do OsmAnd Tracker\?</string>
|
||||
<string name="shared_string_name">Nome</string>
|
||||
<string name="by_distance">Pola distancia</string>
|
||||
<string name="by_name">Polo nome</string>
|
||||
|
@ -91,7 +91,7 @@
|
|||
<string name="connecting_to_the_internet">Estase a conectar á Internet</string>
|
||||
<string name="battery_optimization_description">Desactiva-la optimización da batería para o OsmAnd Tracker de xeito que non se desconecte de xeito súbito cando esté no segundo plano.</string>
|
||||
<string name="logout_no_internet_msg">Conéctate á Internet para pecha-la sesión no Telegram de xeito correcto.</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revoga-lo acceso á ubicación compartillada. Abre o Telegram, vai cara ós «Axustes → Privacidade e Seguranza → Sesións» e pecha a sesión do OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revoga-lo acceso á ubicación compartillada. Abre o Telegram, vai cara ós «Axustes → Privacidade e Seguranza → Sesións» e pecha a sesión do OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">De que xeito desactivar o rastrexador do OsmAnd (OsmAnd Tracker) dende o Telegram</string>
|
||||
<string name="logout_help_desc">De que xeito desactivar o rastrexador do OsmAnd (OsmAnd Tracker) dende o Telegram</string>
|
||||
<string name="osmand_connect_desc">Escolle a versión do OsmAnd na cal o rastrexador do OsmAnd (OsmAnd Tracker) empregará para amosa-las ubicacións.</string>
|
||||
|
@ -117,7 +117,7 @@
|
|||
<string name="my_location_search_hint">Procurar: Grupo ou contacto</string>
|
||||
<string name="start_location_sharing">Compartillar ubicación</string>
|
||||
<string name="show_on_map">Amosar no mapa</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Número do teléfono móbil</string>
|
||||
<string name="phone_number_descr">Número do teléfono móbil no formato internacional</string>
|
||||
<string name="shared_string_password">Contrasinal</string>
|
||||
|
@ -139,11 +139,11 @@
|
|||
<string name="gps_not_available">Activar «Ubicación» nos axustes do sistema</string>
|
||||
<string name="location_service_no_gps_available">Escolle un dos fornecedores da ubicación para compartilla-la túa ubicación.</string>
|
||||
<string name="osmand_service">Modo no segundo plano</string>
|
||||
<string name="osmand_service_descr">O OsmAnd Telegram execútase no modo en segundo plano ca pantalla apagada.</string>
|
||||
<string name="osmand_service_descr">O OsmAnd Tracker execútase no modo en segundo plano ca pantalla apagada.</string>
|
||||
<string name="shared_string_distance">Distancia</string>
|
||||
<string name="share_location">Compartillar ubicación</string>
|
||||
<string name="sharing_location">Estase a compartilla-la ubicación</string>
|
||||
<string name="process_service">Servizo do OsmAnd Telegram</string>
|
||||
<string name="process_service">Servizo do OsmAnd Tracker</string>
|
||||
<string name="osmand_logo">Logotipo do OsmAnd</string>
|
||||
<string name="install_osmand_dialog_message">Precísase instalar primeiro a versión de balde ou de pagamento do OsmAnd</string>
|
||||
<string name="install_osmand">Instala-lo OsmAnd</string>
|
||||
|
@ -190,7 +190,6 @@
|
|||
<string name="disable_monitoring">Desactivar o monitoramento</string>
|
||||
<string name="location_recording_enabled">Gravación da ubicación activada</string>
|
||||
<string name="timeline_description">Activa o monitoramento para gardar tódalas ubicacións no historial.</string>
|
||||
<string name="app_name_short_online">Rastrexador en liña</string>
|
||||
<string name="app_name_short">Rastrexador do OsmAnd</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">O Telegram (a aplicación de mensaxaría) emprégase para conectar e comunicar ás persoas.</string>
|
||||
|
|
|
@ -210,7 +210,6 @@
|
|||
<string name="timeline_available_for_free_now">ציר הזמן היא תכונה שמעתה זמינה בחינם.</string>
|
||||
<string name="disable_monitoring">השבתת מעקב</string>
|
||||
<string name="location_recording_enabled">הופעלה הקלטת מיקום</string>
|
||||
<string name="app_name_short_online">עוקב בזמן אמת</string>
|
||||
<string name="app_name_short">עוקב OsmAnd</string>
|
||||
<string name="search_contacts">חיפוש באנשי קשר</string>
|
||||
<string name="search_contacts_descr">חיפוש בין כל הקבוצות ואנשי הקשר שלך.</string>
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
<string name="disable_monitoring">Figyelemmel kísérés letiltása</string>
|
||||
<string name="location_recording_enabled">Tartózkodási hely rögzítésének engedélyezve</string>
|
||||
<string name="timeline_description">A figyelemmel kísérés engedélyezése az előzményekben található összes tartózkodási hely mentéséhez.</string>
|
||||
<string name="app_name_short_online">Online Tracker</string>
|
||||
<string name="app_name_short">OsmAnd Tracker</string>
|
||||
<string name="share_location_as_description">Ha egy Telegram-fiókhoz több eszközt szeretne csatlakoztatni, akkor tartózkodási helyének megosztásához egy másik eszközt kell használnia.</string>
|
||||
<string name="last_updated_location">Utoljára frissített tartózkodási hely:</string>
|
||||
|
@ -71,8 +70,8 @@
|
|||
<string name="add_device">Eszköz hozzáadása</string>
|
||||
<string name="share_location_as">Tartózkodási hely megosztása mint</string>
|
||||
<string name="live_now_description">Tartózkodási helyüket Önnel megosztó partnerek és csoportok.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Biztosan kilép az OsmAnd Telegramból\? Így nem tudja megosztani másokkal tartózkodási helyét, és mások sem látják az Önét.</string>
|
||||
<string name="logout_from_osmand_telegram">Kilép az OsmAnd Telegramból\?</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Biztosan kilép az OsmAnd Trackerból\? Így nem tudja megosztani másokkal tartózkodási helyét, és mások sem látják az Önét.</string>
|
||||
<string name="logout_from_osmand_telegram">Kilép az OsmAnd Trackerból\?</string>
|
||||
<string name="shared_string_name">Név</string>
|
||||
<string name="by_distance">Távolság szerint</string>
|
||||
<string name="by_name">Név szerint</string>
|
||||
|
@ -122,7 +121,7 @@
|
|||
<string name="my_location_search_hint">Keresés: csoport vagy partner</string>
|
||||
<string name="start_location_sharing">Tartózkodási hely megosztása</string>
|
||||
<string name="show_on_map">Megjelenítés a térképen</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Telefonszám</string>
|
||||
<string name="phone_number_descr">Telefonszám nemzetközi formában</string>
|
||||
<string name="shared_string_password">Jelszó</string>
|
||||
|
@ -143,7 +142,7 @@
|
|||
<string name="shared_string_distance">Távolság</string>
|
||||
<string name="share_location">Tartózkodási hely megosztása</string>
|
||||
<string name="sharing_location">Tartózkodási hely megosztása folyamatban</string>
|
||||
<string name="process_service">OsmAnd Telegram szolgáltatás</string>
|
||||
<string name="process_service">OsmAnd Tracker szolgáltatás</string>
|
||||
<string name="osmand_logo">OsmAnd logó</string>
|
||||
<string name="shared_string_welcome">Isten hozta</string>
|
||||
<string name="yard">yard</string>
|
||||
|
@ -180,7 +179,7 @@
|
|||
<string name="initializing">Indítás</string>
|
||||
<string name="searching_for_gps">Pozíció meghatározása…</string>
|
||||
<string name="connecting_to_the_internet">Kapcsolódás az internethez</string>
|
||||
<string name="battery_optimization_description">Az OsmAnd Telegram esetében kapcsolja ki az akkumulátor optimalizálását, nehogy hirtelen kikapcsoljon, miközben a háttérben fut.</string>
|
||||
<string name="battery_optimization_description">Az OsmAnd Tracker esetében kapcsolja ki az akkumulátor optimalizálását, nehogy hirtelen kikapcsoljon, miközben a háttérben fut.</string>
|
||||
<string name="sharing_in_background">Megosztás a háttérben</string>
|
||||
<string name="go_to_settings">Beállítások megnyitása</string>
|
||||
<string name="shared_string_later">Később</string>
|
||||
|
@ -196,7 +195,7 @@
|
|||
<string name="search_contacts_descr">Keresés az összes csoportban és kapcsolatban.</string>
|
||||
<string name="type_contact_or_group_name">Gépelje be a kapcsolat vagy a csoport nevét</string>
|
||||
<string name="shared_string_search">Keresés</string>
|
||||
<string name="osmand_connect_desc">Válassza ki, melyik OsmAnd verziót használja a az OsmAnd Telegram a pozíciók megjelenítéséhez.</string>
|
||||
<string name="osmand_connect_desc">Válassza ki, melyik OsmAnd verziót használja a az OsmAnd Tracker a pozíciók megjelenítéséhez.</string>
|
||||
<string name="osmand_connect">Kapcsolódás az OsmAndhoz</string>
|
||||
<string name="already_registered_in_telegram">Regisztrált Telegram fiók és telefonszám szükséges</string>
|
||||
<string name="do_not_have_telegram">Nincs Telegram fiókom</string>
|
||||
|
@ -209,7 +208,7 @@
|
|||
<string name="gps_not_available">A rendszerbeállításoknál kapcsolja be a „Tartózkodási helyet”</string>
|
||||
<string name="location_service_no_gps_available">Tartózkodási helyének megosztásához jelölje ki az egyik tartózkodásihely-szolgáltatót.</string>
|
||||
<string name="osmand_service">Háttérmód</string>
|
||||
<string name="osmand_service_descr">Az OsmAnd Telegram a háttérben fut, kikapcsolt képernyővel.</string>
|
||||
<string name="osmand_service_descr">Az OsmAnd Tracker a háttérben fut, kikapcsolt képernyővel.</string>
|
||||
<string name="install_osmand_dialog_message">Először telepítenie kell az OsmAnd ingyenes vagy fizetős verzióját</string>
|
||||
<string name="install_osmand">OsmAnd telepítése</string>
|
||||
<string name="show_users_on_map">Felhasználók megjelenítése a térképen</string>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<string name="shared_string_group">Gruppo</string>
|
||||
<string name="logout_no_internet_msg">Connettiti a Internet per uscire correttamente dall\'account di Telegram.</string>
|
||||
<string name="shared_string_close">Chiudi</string>
|
||||
<string name="disconnect_from_telegram_desc">Per revocare l\'accesso alla condivisione della posizione, apri Telegram, vai a Impostazioni → Privacy e Sicurezza → Sessioni, e termina la sessione di OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Per revocare l\'accesso alla condivisione della posizione, apri Telegram, vai a Impostazioni → Privacy e Sicurezza → Sessioni, e termina la sessione di OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Come disattivare il OsmAnd Tracker da Telegram</string>
|
||||
<string name="logout_help_desc">Come disattivare OsmAnd Tracker da Telegram</string>
|
||||
<string name="connected_account">Account connesso</string>
|
||||
|
@ -191,7 +191,6 @@
|
|||
<string name="disable_monitoring">Disattivare il monitoraggio</string>
|
||||
<string name="location_recording_enabled">Registrazione della posizione abilitata</string>
|
||||
<string name="timeline_description">Attivare il monitoraggio per salvare lo storico delle locazioni.</string>
|
||||
<string name="app_name_short_online">Tracker online</string>
|
||||
<string name="app_name_short">Tracker OsmAnd</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (l\'applicazione di messaggistica) viene usato per connettersi e comunicare con le persone.</string>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<resources>
|
||||
<string name="background_work_description">Endre batterioptimiseringsinnstillinger for mer stabil posisjonsdeling.</string>
|
||||
<string name="background_work">Bakgrunnsarbeid</string>
|
||||
<string name="battery_optimization_description">Skru av batterioptimisering for OsmAnd Telegram slik at det ikke plutselig skrur seg av når det er i bakgrunnen.</string>
|
||||
<string name="battery_optimization_description">Skru av batterioptimisering for OsmAnd Tracker slik at det ikke plutselig skrur seg av når det er i bakgrunnen.</string>
|
||||
<string name="sharing_in_background">Deling i bakgrunnen</string>
|
||||
<string name="go_to_settings">Gå til innstillinger</string>
|
||||
<string name="shared_string_later">Senere</string>
|
||||
|
@ -19,8 +19,8 @@
|
|||
<string name="add_device">Legg til enhet</string>
|
||||
<string name="share_location_as">Del posisjon som</string>
|
||||
<string name="live_now_description">Kontakter og grupper som deler sin posisjon med deg.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Er du sikker på at du vil logge ut av OsmAnd Telegram slik at du ikke kan sende din posisjon, eller se andres\?</string>
|
||||
<string name="logout_from_osmand_telegram">Logg ut av OsmAnd Telegram\?</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Er du sikker på at du vil logge ut av OsmAnd Tracker slik at du ikke kan sende din posisjon, eller se andres\?</string>
|
||||
<string name="logout_from_osmand_telegram">Logg ut av OsmAnd Tracker\?</string>
|
||||
<string name="shared_string_name">Navn</string>
|
||||
<string name="by_distance">Etter distanse</string>
|
||||
<string name="by_name">Etter navn</string>
|
||||
|
@ -38,13 +38,13 @@
|
|||
<string name="shared_string_group">Gruppe</string>
|
||||
<string name="logout_no_internet_msg">Koble til Internett for å logge ut av Telegram ordentlig.</string>
|
||||
<string name="shared_string_close">Lukk</string>
|
||||
<string name="disconnect_from_telegram_desc">For å tilbakekalle posisjonsdelingstilgang. Åpne Telegram, gå til Innstillinger - Personvern og sikkerhet - Økter, og sluttfør OsmAnd Telegram-økta.</string>
|
||||
<string name="disconnect_from_telegram_desc">For å tilbakekalle posisjonsdelingstilgang. Åpne Telegram, gå til Innstillinger - Personvern og sikkerhet - Økter, og sluttfør OsmAnd Tracker-økta.</string>
|
||||
<string name="disconnect_from_telegram">Hvordan koble fra OsmAnd-sporeren fra Telegram</string>
|
||||
<string name="logout_help_desc">Hvordan koble fra OsmAnd-sporeren fra Telegram</string>
|
||||
<string name="connected_account">Tilkoblet konto</string>
|
||||
<string name="shared_string_account">Konto</string>
|
||||
<string name="in_time">i %1$s</string>
|
||||
<string name="osmand_connect_desc">Velg OsmAnd-versjonen OsmAnd Telegram bruker for å vise posisjoner på kartet.</string>
|
||||
<string name="osmand_connect_desc">Velg OsmAnd-versjonen OsmAnd Tracker bruker for å vise posisjoner på kartet.</string>
|
||||
<string name="osmand_connect">OsmAnd connect</string>
|
||||
<string name="location_history_desc">Skjul kontaktene som ikke har oppdatert sin plassering etter et gitt tidsintervall.</string>
|
||||
<string name="location_history">Posisjonshistorikk</string>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<string name="my_location_search_hint">Søk: Gruppe eller kontakt</string>
|
||||
<string name="start_location_sharing">Del posisjon</string>
|
||||
<string name="show_on_map">Vis på kartet</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Telefonnummer</string>
|
||||
<string name="phone_number_descr">Telefonnummer i internasjonalt format</string>
|
||||
<string name="shared_string_password">Passord</string>
|
||||
|
@ -102,11 +102,11 @@
|
|||
<string name="gps_not_available">Skru på «Posisjon» i systeminnstillingene</string>
|
||||
<string name="location_service_no_gps_available">Velg en av posisjonstilbyderne for å dele din posisjon.</string>
|
||||
<string name="osmand_service">Bakgrunnsmodus</string>
|
||||
<string name="osmand_service_descr">OsmAnd Telegram kjører som nisse med skjermen av.</string>
|
||||
<string name="osmand_service_descr">OsmAnd Tracker kjører som nisse med skjermen av.</string>
|
||||
<string name="shared_string_distance">Distanse</string>
|
||||
<string name="share_location">Del posisjon</string>
|
||||
<string name="sharing_location">Deler posisjon</string>
|
||||
<string name="process_service">OsmAnd Telegram-tjeneste</string>
|
||||
<string name="process_service">OsmAnd Tracker-tjeneste</string>
|
||||
<string name="osmand_logo">OsmAnd-logo</string>
|
||||
<string name="install_osmand_dialog_message">Du må installere gratis- eller betalt versjon av OsmAnd først</string>
|
||||
<string name="install_osmand">Installer OsmAnd</string>
|
||||
|
@ -207,7 +207,6 @@
|
|||
<string name="timeline_available_for_free_now">Tidslinjefunksjonen er nå gratis.</string>
|
||||
<string name="disable_monitoring">Skru av overvåkning</string>
|
||||
<string name="location_recording_enabled">Plasseringsregistrering påskrudd</string>
|
||||
<string name="app_name_short_online">Nettbasert sporer</string>
|
||||
<string name="app_name_short">OsmAnd-sporer</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (meldingsprogrammet) brukes til å komme i kontakt og snakke med folk.</string>
|
||||
<string name="osmand_privacy_policy">OsmAnd-personvernspraksis</string>
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
<string name="disable_monitoring">Schakel monitoring uit</string>
|
||||
<string name="location_recording_enabled">Locatie opname ingeschakeld</string>
|
||||
<string name="timeline_description">Schakel monitoring in om alle locaties in de geschiedenis op te slaan.</string>
|
||||
<string name="app_name_short_online">Online Tracker</string>
|
||||
<string name="app_name_short">OsmAnd Tracker</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (de berichten-app) wordt gebruikt om mensen te verbinden en te communiceren met mensen.</string>
|
||||
|
@ -59,7 +58,7 @@
|
|||
<string name="searching_for_gps">Positie bepalen…</string>
|
||||
<string name="connecting_to_the_internet">Verbinden met Internet</string>
|
||||
<string name="background_work_description">Wijzig batterij optimalisatie om het delen van uw locatie te verbeteren.</string>
|
||||
<string name="battery_optimization_description">Schakel batterij optimalisatie uit voor OsmAnd Telegram zodat het niet uitgeschakeld wordt in de achtergrond.</string>
|
||||
<string name="battery_optimization_description">Schakel batterij optimalisatie uit voor OsmAnd Tracker zodat het niet uitgeschakeld wordt in de achtergrond.</string>
|
||||
<string name="sharing_in_background">Delen in de achtergrond</string>
|
||||
<string name="go_to_settings">Open Instellingen</string>
|
||||
<string name="shared_string_later">Later</string>
|
||||
|
@ -77,8 +76,8 @@
|
|||
<string name="add_device">Voeg apparaat toe</string>
|
||||
<string name="share_location_as">Deel locatie als</string>
|
||||
<string name="live_now_description">Contacten en groepen die hun locatie delen met jou.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Weet u zeker dat u uit wilt loggen uit Osmand Telegram en daarmee uw locatie niet meer deelt en de locatie van anderen niet meer kunt zien\?</string>
|
||||
<string name="logout_from_osmand_telegram">Uitloggen uit OsmAnd Telegram\?</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Weet u zeker dat u uit wilt loggen uit OsmAnd Tracker en daarmee uw locatie niet meer deelt en de locatie van anderen niet meer kunt zien\?</string>
|
||||
<string name="logout_from_osmand_telegram">Uitloggen uit OsmAnd Tracker\?</string>
|
||||
<string name="shared_string_name">Naam</string>
|
||||
<string name="by_distance">Op afstand</string>
|
||||
<string name="by_name">Op naam</string>
|
||||
|
@ -95,13 +94,13 @@
|
|||
<string name="shared_string_group">Groep</string>
|
||||
<string name="logout_no_internet_msg">Verbind met Internet om correct uit te loggen uit Telegram.</string>
|
||||
<string name="shared_string_close">Sluit</string>
|
||||
<string name="disconnect_from_telegram_desc">Om locatie delen toegang uit te schakelen: Open Telegram, gaan naar Instellingen -> Privacy en veiligheid -> Active sessies, en beeindig the OsmAnd Telegram sessie.</string>
|
||||
<string name="disconnect_from_telegram_desc">Om locatie delen toegang uit te schakelen: Open Telegram, gaan naar Instellingen -> Privacy en veiligheid -> Active sessies, en beeindig the OsmAnd Tracker sessie.</string>
|
||||
<string name="disconnect_from_telegram">Hoe zet je de OsmAnd Tracker uit in Telegram</string>
|
||||
<string name="logout_help_desc">Hoe zet je de OsmAnd Tracker uit in Telegram</string>
|
||||
<string name="connected_account">Verbonden account</string>
|
||||
<string name="shared_string_account">Account</string>
|
||||
<string name="in_time">in %1$s</string>
|
||||
<string name="osmand_connect_desc">Kies de OsmAnd versie die door OsmAnd Telegram gebruikt wordt om posities te tonen.</string>
|
||||
<string name="osmand_connect_desc">Kies de OsmAnd versie die door OsmAnd Tracker gebruikt wordt om posities te tonen.</string>
|
||||
<string name="location_history_desc">Verberg contacten die zich een bepaalde tijd niet verplaatsten.</string>
|
||||
<string name="location_history">Locatie geschiedenis</string>
|
||||
<string name="stale_location_desc">De laatste keer dat een contact zich verplaatste.</string>
|
||||
|
@ -132,7 +131,7 @@
|
|||
<string name="my_location_search_hint">Zoek: Groep of contact</string>
|
||||
<string name="start_location_sharing">Deel locatie</string>
|
||||
<string name="show_on_map">Toon op de kaart</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Telefoonnummer</string>
|
||||
<string name="phone_number_descr">Telefoonnummer in internationaal formaat</string>
|
||||
<string name="shared_string_password">Wachtwoord</string>
|
||||
|
@ -173,7 +172,7 @@
|
|||
<string name="shared_string_distance">Afstand</string>
|
||||
<string name="share_location">Deel locatie</string>
|
||||
<string name="sharing_location">Locatie wordt gedeeld</string>
|
||||
<string name="process_service">OsmAnd Telegram service</string>
|
||||
<string name="process_service">OsmAnd Tracker service</string>
|
||||
<string name="osmand_logo">OsmAnd logo</string>
|
||||
<string name="install_osmand_dialog_message">U dient eerst de gratis of betaalde versie van OsmAnd te installeren</string>
|
||||
<string name="install_osmand">Installeer OsmAnd</string>
|
||||
|
|
|
@ -167,7 +167,7 @@
|
|||
<string name="initializing">Wystartuj</string>
|
||||
<string name="searching_for_gps">Pozycjonowanie…</string>
|
||||
<string name="connecting_to_the_internet">Łączenie z internetem</string>
|
||||
<string name="disconnect_from_telegram_desc">Aby anulować dostęp do udostępniania lokalizacji. Otwórz Telegram, przejdź do Ustawienia → Prywatność i bezpieczeństwo → Sesje i zakończ sesję OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Aby anulować dostęp do udostępniania lokalizacji. Otwórz Telegram, przejdź do Ustawienia → Prywatność i bezpieczeństwo → Sesje i zakończ sesję OsmAnd Tracker.</string>
|
||||
<string name="stale_location">Nie porusza się</string>
|
||||
<string name="last_update_from_telegram">Ostatnia aktualizacja z Telegram</string>
|
||||
<string name="stop_sharing_all">Udostępnianie jest włączone (wyłącz)</string>
|
||||
|
@ -200,7 +200,6 @@
|
|||
<string name="disable_monitoring">Wyłącz monitorowanie</string>
|
||||
<string name="location_recording_enabled">Zapis położenia włączony</string>
|
||||
<string name="timeline_description">Włącz monitorowanie, by zapisać wszystkie lokalizacje w historii.</string>
|
||||
<string name="app_name_short_online">Nadajnik online</string>
|
||||
<string name="app_name_short">Nadajnik OsmAnd</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (aplikacji do wysyłania wiadomości) jest używana do łączenia i komunikowania się z ludźmi.</string>
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
<string name="shared_string_group">Grupo</string>
|
||||
<string name="logout_no_internet_msg">Conecte-se à Internet para efetuar a saída do Telegram corretamente.</string>
|
||||
<string name="shared_string_close">Fechar</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revogar o acesso ao compartilhamento de local. Abra o Telegram, vá para Configurações → Privacidade e Segurança → Sessões e termine a sessão do OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Para revogar o acesso ao compartilhamento de local. Abra o Telegram, vá para Configurações → Privacidade e Segurança → Sessões e termine a sessão do OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Como desativar o OsmAnd Tracker para Telegram</string>
|
||||
<string name="logout_help_desc">Como desativar o OsmAnd Tracker para Telegram</string>
|
||||
<string name="connected_account">Conta conectada</string>
|
||||
|
@ -211,7 +211,6 @@
|
|||
<string name="disable_monitoring">Desativar monitoramento</string>
|
||||
<string name="location_recording_enabled">Gravação de localização ativada</string>
|
||||
<string name="timeline_description">Ative o monitoramento para salvar todos os locais no histórico.</string>
|
||||
<string name="app_name_short_online">Rastreador online</string>
|
||||
<string name="app_name_short">Rastreador OsmAnd</string>
|
||||
<string name="search_contacts">Pesquisar contatos</string>
|
||||
<string name="search_contacts_descr">Pesquise em todos os seus grupos e contatos.</string>
|
||||
|
|
|
@ -151,7 +151,6 @@
|
|||
<string name="show_gps_points">Показать точки GPS</string>
|
||||
<string name="shared_string_ok">ОК</string>
|
||||
<string name="disable_monitoring">Отключить мониторинг</string>
|
||||
<string name="app_name_short_online">Online Tracker</string>
|
||||
<string name="app_name_short">OsmAnd Tracker</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="shared_string_accept">Принять</string>
|
||||
|
@ -183,11 +182,11 @@
|
|||
<string name="map_and_text">Карта и текст</string>
|
||||
<string name="stop_sharing_all">Совместное использование включено (выключено)</string>
|
||||
<string name="my_location_search_hint">Поиск: группа или контакт</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="logging_out">Выход</string>
|
||||
<string name="closing">Закрытие</string>
|
||||
<string name="gps_network_not_enabled">Включить \"Местоположение\"\?</string>
|
||||
<string name="process_service">Служба OsmAnd Telegram</string>
|
||||
<string name="process_service">Служба OsmAnd Tracker</string>
|
||||
<string name="osmand_logo">Логотип OsmAnd</string>
|
||||
<string name="yard">ярд</string>
|
||||
<string name="foot">фут</string>
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<string name="last_response">Ùrtima risposta</string>
|
||||
<string name="shared_string_group">Grupu</string>
|
||||
<string name="logout_no_internet_msg">Collega·ti a ìnternet pro essire in manera curreta dae Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Pro bogare s\'atzessu a sa cumpartzidura de sa positzione. Aberi Telegram, bae a Cunfiguratziones → Riservadesa e Seguresa → Sessiones ativas, e acaba sa sessione de OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Pro bogare s\'atzessu a sa cumpartzidura de sa positzione. Aberi Telegram, bae a Cunfiguratziones → Riservadesa e Seguresa → Sessiones ativas, e acaba sa sessione de OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Comente istudare s\'arrastadore de OsmAnd dae Telegram</string>
|
||||
<string name="logout_help_desc">Comente istudare s\'arrastadore de OsmAnd dae Telegram</string>
|
||||
<string name="connected_account">Contu connessu</string>
|
||||
|
@ -210,7 +210,6 @@
|
|||
<string name="disable_monitoring">Disabìlita su monitoràgiu</string>
|
||||
<string name="location_recording_enabled">Registratzione de sa positzione abilitada</string>
|
||||
<string name="timeline_description">Abìlita su monitoràgiu pro sarvare totu sas positziones in sa cronologia.</string>
|
||||
<string name="app_name_short_online">Arrastadore in lìnia</string>
|
||||
<string name="app_name_short">Arrastadore de OsmAnd</string>
|
||||
<string name="search_contacts">Chirca cuntatos</string>
|
||||
<string name="search_contacts_descr">Chirca intre totu sos grupos e sos cuntatos tuos.</string>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<string name="shared_string_group">Група</string>
|
||||
<string name="logout_no_internet_msg">Зʼєднайтеся із інтернетом, аби коректно вийти з Telegram.</string>
|
||||
<string name="shared_string_close">Закрити</string>
|
||||
<string name="disconnect_from_telegram_desc">Скасування дозволу до трансляції позиції. Відкрийте Telegram, перейдіть до пункту Налаштування → Конфіденційність та безпека → Активні сесії, та завершіть сеанс OsmAnd Telegram.</string>
|
||||
<string name="disconnect_from_telegram_desc">Скасування дозволу до трансляції позиції. Відкрийте Telegram, перейдіть до пункту Налаштування → Конфіденційність та безпека → Активні сесії, та завершіть сеанс OsmAnd Tracker.</string>
|
||||
<string name="disconnect_from_telegram">Як вимкнути відслідковування OsmAnd з Telegram</string>
|
||||
<string name="logout_help_desc">Як відключити OsmAnd трекер від Telegram</string>
|
||||
<string name="connected_account">Повʼязаний обліковий запис</string>
|
||||
|
@ -185,7 +185,7 @@
|
|||
<string name="shared_string_map">Карта</string>
|
||||
<string name="shared_string_text">Текст</string>
|
||||
<string name="map_and_text">Карта та текст</string>
|
||||
<string name="process_service">Сервіс OsmAnd Telegram</string>
|
||||
<string name="process_service">Сервіс OsmAnd Tracker</string>
|
||||
<string name="osmand_logo">OsmAnd логотип</string>
|
||||
<string name="live_now">Активно зараз</string>
|
||||
<string name="location_recording_enabled">Запис позиціювання увімкнуто</string>
|
||||
|
|
|
@ -212,7 +212,6 @@
|
|||
<string name="disable_monitoring">停用監視</string>
|
||||
<string name="location_recording_enabled">位置記錄已啟用</string>
|
||||
<string name="timeline_description">啟用監視以儲存所有歷史中的位置。</string>
|
||||
<string name="app_name_short_online">線上追蹤器</string>
|
||||
<string name="app_name_short">OsmAnd 追蹤器</string>
|
||||
<string name="search_contacts">搜尋聯絡人</string>
|
||||
<string name="search_contacts_descr">搜尋您所有的群組與聯絡人。</string>
|
||||
|
|
|
@ -35,7 +35,6 @@
|
|||
<string name="disable_monitoring">Disable monitoring</string>
|
||||
<string name="location_recording_enabled">Location recording enabled</string>
|
||||
<string name="timeline_description">Enable monitoring to save all locations in history.</string>
|
||||
<string name="app_name_short_online">Online Tracker</string>
|
||||
<string name="app_name_short">OsmAnd Tracker</string>
|
||||
<string name="shared_string_telegram">Telegram</string>
|
||||
<string name="privacy_policy_use_telegram">Telegram (the messaging app) is used to connect and communicate with people.</string>
|
||||
|
@ -92,7 +91,7 @@
|
|||
<string name="connecting_to_the_internet">Connecting to the Internet</string>
|
||||
<string name="background_work_description">Change battery optimization settings to stabilize location sharing.</string>
|
||||
<string name="background_work">Background work</string>
|
||||
<string name="battery_optimization_description">Turn off battery optimization for OsmAnd Telegram so that it isn\'t suddenly turned off when in the background.</string>
|
||||
<string name="battery_optimization_description">Turn off battery optimization for OsmAnd Tracker so that it isn\'t suddenly turned off when in the background.</string>
|
||||
<string name="sharing_in_background">Sharing in the background</string>
|
||||
<string name="go_to_settings">Go to settings</string>
|
||||
<string name="shared_string_later">Later</string>
|
||||
|
@ -110,8 +109,8 @@
|
|||
<string name="add_device">Add device</string>
|
||||
<string name="share_location_as">Share location as</string>
|
||||
<string name="live_now_description">Contacts and groups sharing location to you.</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Are you sure you want to log out of OsmAnd Telegram so you can\'t share location or see the location of others?</string>
|
||||
<string name="logout_from_osmand_telegram">Log out of OsmAnd Telegram?</string>
|
||||
<string name="logout_from_osmand_telegram_descr">Are you sure you want to log out of OsmAnd Tracker so you can\'t share location or see the location of others?</string>
|
||||
<string name="logout_from_osmand_telegram">Log out of OsmAnd Tracker?</string>
|
||||
<string name="shared_string_name">Name</string>
|
||||
<string name="by_distance">By distance</string>
|
||||
<string name="by_name">By name</string>
|
||||
|
@ -129,13 +128,13 @@
|
|||
<string name="shared_string_group">Group</string>
|
||||
<string name="logout_no_internet_msg">Connect to the Internet to properly log out of Telegram.</string>
|
||||
<string name="shared_string_close">Close</string>
|
||||
<string name="disconnect_from_telegram_desc">To revoke location sharing access. Open Telegram, go to Settings → Privacy and Security → Sessions, and terminate the OsmAnd Telegram session.</string>
|
||||
<string name="disconnect_from_telegram_desc">To revoke location sharing access. Open Telegram, go to Settings → Privacy and Security → Sessions, and terminate the OsmAnd Tracker session.</string>
|
||||
<string name="disconnect_from_telegram">How to turn off OsmAnd Tracker from Telegram</string>
|
||||
<string name="logout_help_desc">How to turn off OsmAnd Tracker from Telegram</string>
|
||||
<string name="connected_account">Connected account</string>
|
||||
<string name="shared_string_account">Account</string>
|
||||
<string name="in_time">in %1$s</string>
|
||||
<string name="osmand_connect_desc">Choose the OsmAnd version OsmAnd Telegram uses to display positions.</string>
|
||||
<string name="osmand_connect_desc">Choose the OsmAnd version OsmAnd Tracker uses to display positions.</string>
|
||||
<string name="osmand_connect">OsmAnd connect</string>
|
||||
<string name="location_history_desc">Hide contacts that have not moved in a given time.</string>
|
||||
<string name="location_history">Location history</string>
|
||||
|
@ -176,7 +175,7 @@
|
|||
<string name="my_location_search_hint">Search: Group or contact</string>
|
||||
<string name="start_location_sharing">Share location</string>
|
||||
<string name="show_on_map">Show on map</string>
|
||||
<string name="app_name">OsmAnd Telegram</string>
|
||||
<string name="app_name">OsmAnd Online GPS Tracker</string>
|
||||
<string name="phone_number_title">Phone number</string>
|
||||
<string name="phone_number_descr">Phone number in international format</string>
|
||||
<string name="shared_string_password">Password</string>
|
||||
|
@ -199,11 +198,11 @@
|
|||
<string name="gps_not_available">Please turn on \"Location\" in the system settings</string>
|
||||
<string name="location_service_no_gps_available">Select one of the location providers to share your location.</string>
|
||||
<string name="osmand_service">Background mode</string>
|
||||
<string name="osmand_service_descr">OsmAnd Telegram runs in the background with the screen off.</string>
|
||||
<string name="osmand_service_descr">OsmAnd Tracker runs in the background with the screen off.</string>
|
||||
<string name="shared_string_distance">Distance</string>
|
||||
<string name="share_location">Share location</string>
|
||||
<string name="sharing_location">Sharing location</string>
|
||||
<string name="process_service">OsmAnd Telegram service</string>
|
||||
<string name="process_service">OsmAnd Tracker service</string>
|
||||
<string name="osmand_logo">OsmAnd logo</string>
|
||||
<string name="install_osmand_dialog_message">You need to install the free or paid version of OsmAnd first</string>
|
||||
<string name="install_osmand">Install OsmAnd</string>
|
||||
|
|
|
@ -47,7 +47,7 @@ class TelegramApplication : Application(), OsmandHelperListener {
|
|||
if (connected) {
|
||||
osmandAidlHelper.setNavDrawerItems(
|
||||
applicationContext.packageName,
|
||||
listOf(getString(R.string.app_name_short_online)),
|
||||
listOf(getString(R.string.app_name_short)),
|
||||
listOf("osmand_telegram://main_activity"),
|
||||
listOf("ic_action_location_sharing_app"),
|
||||
listOf(-1)
|
||||
|
|
|
@ -230,6 +230,7 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
|||
if (shareInfo.pendingTdLibText >= MAX_MESSAGES_IN_TDLIB_PER_CHAT || shareInfo.pendingTdLibMap >= MAX_MESSAGES_IN_TDLIB_PER_CHAT) {
|
||||
bufferedMessagesFull = true
|
||||
}
|
||||
checkAndSendBufferMessagesToChat(shareInfo.chatId)
|
||||
when (app.settings.shareTypeValue) {
|
||||
SHARE_TYPE_MAP -> {
|
||||
val message = BufferMessage(shareInfo.chatId, latitude, longitude, altitude, speed, accuracy, bearing, time, LocationMessages.TYPE_MAP, deviceName)
|
||||
|
@ -246,7 +247,6 @@ class ShareLocationHelper(private val app: TelegramApplication) {
|
|||
prepareTextMessage(shareInfo, messageText, isBot)
|
||||
}
|
||||
}
|
||||
checkAndSendBufferMessagesToChat(shareInfo.chatId)
|
||||
}
|
||||
if (bufferedMessagesFull) {
|
||||
checkNetworkType()
|
||||
|
|
|
@ -19,6 +19,7 @@ import net.osmand.telegram.utils.OsmandLocationUtils.MessageUserLocation
|
|||
import org.drinkless.td.libcore.telegram.TdApi
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.Executors
|
||||
|
||||
class ShowLocationHelper(private val app: TelegramApplication) {
|
||||
|
@ -37,8 +38,8 @@ class ShowLocationHelper(private val app: TelegramApplication) {
|
|||
private val osmandAidlHelper = app.osmandAidlHelper
|
||||
private val executor = Executors.newSingleThreadExecutor()
|
||||
|
||||
private val points = mutableMapOf<String, TdApi.Message>()
|
||||
private val markers = mutableMapOf<String, AMapMarker>()
|
||||
private val points = ConcurrentHashMap<String, TdApi.Message>()
|
||||
private val markers = ConcurrentHashMap<String, AMapMarker>()
|
||||
|
||||
var showingLocation: Boolean = false
|
||||
private set
|
||||
|
@ -49,7 +50,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
|
|||
app.osmandAidlHelper.setContextMenuButtonsListener(object : ContextMenuButtonsListener {
|
||||
|
||||
override fun onContextMenuButtonClicked(buttonId: Int, pointId: String, layerId: String) {
|
||||
updateDirectionMarker(pointId)
|
||||
updateDirectionMarker(pointId, true)
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -61,7 +62,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
|
|||
}
|
||||
}
|
||||
|
||||
private fun updateDirectionMarker(pointId: String) {
|
||||
private fun updateDirectionMarker(pointId: String, forceAdd: Boolean = false) {
|
||||
val message = points[pointId]
|
||||
if (message != null) {
|
||||
val aLatLon = getALatLonFromMessage(message.content)
|
||||
|
@ -73,8 +74,12 @@ class ShowLocationHelper(private val app: TelegramApplication) {
|
|||
if (markerPrev != null) {
|
||||
markerUpdated = app.osmandAidlHelper.updateMapMarker(markerPrev, marker)
|
||||
if (!markerUpdated) {
|
||||
app.osmandAidlHelper.removeMapMarker(markerPrev.latLon.latitude, markerPrev.latLon.longitude, name)
|
||||
markerUpdated = app.osmandAidlHelper.addMapMarker(marker)
|
||||
if (forceAdd) {
|
||||
app.osmandAidlHelper.removeMapMarker(markerPrev.latLon.latitude, markerPrev.latLon.longitude, name)
|
||||
markerUpdated = app.osmandAidlHelper.addMapMarker(marker)
|
||||
} else {
|
||||
markers.remove(pointId)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
markerUpdated = app.osmandAidlHelper.addMapMarker(marker)
|
||||
|
@ -92,17 +97,14 @@ class ShowLocationHelper(private val app: TelegramApplication) {
|
|||
}
|
||||
setupMapLayer()
|
||||
osmandAidlHelper.execOsmandApi {
|
||||
osmandAidlHelper.showMapPoint(
|
||||
MAP_LAYER_ID,
|
||||
item.getMapPointId(),
|
||||
item.getVisibleName(),
|
||||
item.getVisibleName(),
|
||||
item.chatTitle,
|
||||
Color.WHITE,
|
||||
ALatLon(item.latLon!!.latitude, item.latLon!!.longitude),
|
||||
generatePointDetails(item.bearing?.toFloat(), item.altitude?.toFloat(), item.precision?.toFloat()),
|
||||
generatePointParams(if (stale) item.grayscalePhotoPath else item.photoPath, stale, item.speed?.toFloat(), item.bearing?.toFloat())
|
||||
)
|
||||
val pointId = item.getMapPointId()
|
||||
val name = item.getVisibleName()
|
||||
val aLatLon = ALatLon(item.latLon!!.latitude, item.latLon!!.longitude)
|
||||
val details = generatePointDetails(item.bearing?.toFloat(), item.altitude?.toFloat(), item.precision?.toFloat())
|
||||
val params = generatePointParams(if (stale) item.grayscalePhotoPath else item.photoPath, stale, item.speed?.toFloat(), item.bearing?.toFloat())
|
||||
|
||||
osmandAidlHelper.addMapPoint(MAP_LAYER_ID, pointId, name, name, item.chatTitle, Color.WHITE, aLatLon, details, params)
|
||||
osmandAidlHelper.showMapPoint(MAP_LAYER_ID, pointId, name, name, item.chatTitle, Color.WHITE, aLatLon, details, params)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -413,7 +413,7 @@ class TelegramHelper private constructor() {
|
|||
}
|
||||
TdApi.File.CONSTRUCTOR -> {
|
||||
val file = obj as TdApi.File
|
||||
client!!.send(TdApi.DownloadFile(file.id, 10), defaultHandler)
|
||||
client!!.send(TdApi.DownloadFile(file.id, 10, 0, 0, true), defaultHandler)
|
||||
}
|
||||
else -> listener?.onTelegramError(-1, "Receive wrong response from TDLib: $obj")
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ class TelegramHelper private constructor() {
|
|||
}
|
||||
resultArticles.forEach {
|
||||
client?.send(TdApi.SendInlineQueryResultMessage(shareInfo.chatId, 0, true,
|
||||
true, inlineQueryResults.inlineQueryId, it.id)) { obj ->
|
||||
true, inlineQueryResults.inlineQueryId, it.id, false)) { obj ->
|
||||
handleTextLocationMessageUpdate(obj, shareInfo)
|
||||
}
|
||||
}
|
||||
|
@ -1342,7 +1342,7 @@ class TelegramHelper private constructor() {
|
|||
}
|
||||
TdApi.File.CONSTRUCTOR -> {
|
||||
val file = obj as TdApi.File
|
||||
client!!.send(TdApi.DownloadFile(file.id, 10), defaultHandler)
|
||||
client!!.send(TdApi.DownloadFile(file.id, 10, 0, 0, true), defaultHandler)
|
||||
}
|
||||
else -> listener?.onTelegramError(-1, "Receive wrong response from TDLib: $obj")
|
||||
}
|
||||
|
|
|
@ -94,8 +94,13 @@ object OsmandLocationUtils {
|
|||
|
||||
fun getSenderMessageId(message: TdApi.Message): Int {
|
||||
val forwardInfo = message.forwardInfo
|
||||
return if (forwardInfo != null && forwardInfo is TdApi.MessageForwardedFromUser) {
|
||||
forwardInfo.senderUserId
|
||||
return if (forwardInfo != null) {
|
||||
val origin: TdApi.MessageForwardOrigin? = forwardInfo.origin
|
||||
if (origin != null && origin is TdApi.MessageForwardOriginUser) {
|
||||
origin.senderUserId
|
||||
} else {
|
||||
message.senderUserId
|
||||
}
|
||||
} else {
|
||||
message.senderUserId
|
||||
}
|
||||
|
|
|
@ -901,5 +901,8 @@
|
|||
android:name=".profiles.EditProfileActivity"
|
||||
android:label="Application profiles"/>
|
||||
|
||||
</application>
|
||||
<activity android:name=".activities.PrivacyAndSecurityActivity"
|
||||
android:configChanges="keyboardHidden|orientation" />
|
||||
|
||||
</application>
|
||||
</manifest>
|
||||
|
|
BIN
OsmAnd/res/drawable-hdpi/img_get_feedback.webp
Normal file
BIN
OsmAnd/res/drawable-hdpi/img_get_feedback.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
BIN
OsmAnd/res/drawable-mdpi/img_get_feedback.webp
Normal file
BIN
OsmAnd/res/drawable-mdpi/img_get_feedback.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 4 KiB |
BIN
OsmAnd/res/drawable-xhdpi/img_get_feedback.webp
Normal file
BIN
OsmAnd/res/drawable-xhdpi/img_get_feedback.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.7 KiB |
BIN
OsmAnd/res/drawable-xxhdpi/img_get_feedback.webp
Normal file
BIN
OsmAnd/res/drawable-xxhdpi/img_get_feedback.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
BIN
OsmAnd/res/drawable-xxxhdpi/img_get_feedback.webp
Normal file
BIN
OsmAnd/res/drawable-xxxhdpi/img_get_feedback.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
|
@ -1,5 +1,5 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/solid_ripple_color">
|
||||
android:color="@color/active_buttons_and_links_pressed_dark">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/active_buttons_and_links_dark" />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/solid_ripple_color">
|
||||
android:color="@color/active_buttons_and_links_pressed_light">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/active_buttons_and_links_light" />
|
||||
|
|
|
@ -11,4 +11,5 @@
|
|||
android:paddingRight="@dimen/content_padding"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
android:linksClickable="true"
|
||||
tools:text="Some long description"/>
|
||||
|
|
42
OsmAnd/res/layout/crash_title.xml
Normal file
42
OsmAnd/res/layout/crash_title.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:text="Crash"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Последний запуск OsmAnd завершился с ошибкой. Помогите нам улучшить OsmAnd. Пожалуйста, отправьте нам сообщение об ошибке."
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding_small"
|
||||
android:src="@drawable/img_crash" />
|
||||
|
||||
</LinearLayout>
|
42
OsmAnd/res/layout/dislike_title.xml
Normal file
42
OsmAnd/res/layout/dislike_title.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:text="@string/user_hates_app_get_feedback"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/user_hates_app_get_feedback_long"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding_small"
|
||||
android:src="@drawable/img_get_feedback" />
|
||||
|
||||
</LinearLayout>
|
48
OsmAnd/res/layout/make_better_title.xml
Normal file
48
OsmAnd/res/layout/make_better_title.xml
Normal file
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginBottom="26dp"
|
||||
android:src="@drawable/img_feedback" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:text="@string/help_us_make_osmand_better"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/dialog_header_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:text="@string/make_osmand_better_descr"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dialog_content_margin"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:text="@string/choose_data_to_share"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
</LinearLayout>
|
165
OsmAnd/res/layout/privacy_settings_layout.xml
Normal file
165
OsmAnd/res/layout/privacy_settings_layout.xml
Normal file
|
@ -0,0 +1,165 @@
|
|||
<?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:osmand="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/activity_background_basic"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
app:theme="@style/ThemeOverlay.AppCompat.ActionBar">
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="4dp" />
|
||||
|
||||
<include layout="@layout/card_top_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/card_and_list_background_basic"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/content_padding_small"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/colleted_data"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/collected_data_descr"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="?attr/dashboard_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/downloaded_maps_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/content_padding_small"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/downloaded_maps_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/downloaded_maps"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle" />
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/downloaded_maps_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:background="@null" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:text="@string/downloaded_maps_collect_descr"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="@dimen/content_padding"
|
||||
android:layout_marginLeft="@dimen/content_padding"
|
||||
android:background="?attr/dashboard_divider" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/visited_screens_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/content_padding_small"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/visited_screens_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/content_padding"
|
||||
android:layout_marginRight="@dimen/content_padding"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:text="@string/visited_screens"
|
||||
android:textAppearance="@style/TextAppearance.ListItemTitle" />
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
android:id="@+id/visited_screens_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:background="@null" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingRight="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:text="@string/visited_screens_collect_descr"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/card_bottom_divider" />
|
||||
|
||||
</LinearLayout>
|
42
OsmAnd/res/layout/rate_us_title.xml
Normal file
42
OsmAnd/res/layout/rate_us_title.xml
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:osmand="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="@dimen/content_padding"
|
||||
android:paddingLeft="@dimen/content_padding"
|
||||
android:paddingTop="@dimen/content_padding"
|
||||
android:paddingBottom="@dimen/content_padding">
|
||||
|
||||
<net.osmand.plus.widgets.TextViewEx
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/content_padding_small"
|
||||
android:text="@string/do_you_like_osmand"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_list_text_size"
|
||||
osmand:typeface="@string/font_roboto_medium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/rate_dialog_descr"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
android:textSize="@dimen/default_desc_text_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/content_padding_small"
|
||||
android:src="@drawable/img_rate_us" />
|
||||
|
||||
</LinearLayout>
|
|
@ -491,7 +491,6 @@
|
|||
<color name="settings_divider">#dcdcdc</color>
|
||||
<color name="profile_button_gray">#EFEFEF</color>
|
||||
<color name="profile_button_gray_pressed">#ababab</color>
|
||||
<color name="solid_ripple_color">#505050</color>
|
||||
|
||||
<color name="active_buttons_and_links_text_disabled_light">#727272</color>
|
||||
<color name="active_buttons_and_links_text_disabled_dark">#727272</color>
|
||||
|
|
|
@ -12,6 +12,23 @@
|
|||
|
||||
-->
|
||||
<string name="app_profile_custom_nav_subtitle"></string>
|
||||
<string name="rate_dialog_descr">Please give us 30 seconds, share feedback and rate our work on Google Play.</string>
|
||||
<string name="button_rate">Rate</string>
|
||||
<string name="shared_string_privacy_policy">Privacy Policy</string>
|
||||
<string name="help_us_make_osmand_better">Help us make OsmAnd better!</string>
|
||||
<string name="make_osmand_better_descr">Allow OsmAnd to collect and process anonymous application usage data. We do not collect or store data about your location, or about the locations that you view on the map.\n\nYou can always change your selection in Settings > Privacy and Security.</string>
|
||||
<string name="choose_data_to_share">Choose what type of data you want to share:</string>
|
||||
<string name="downloaded_maps">Downloaded Maps</string>
|
||||
<string name="visited_screens">Visited screens</string>
|
||||
<string name="colleted_data">Colleted Data</string>
|
||||
<string name="collected_data_descr">List of data you want to share with OsmAnd.</string>
|
||||
<string name="downloaded_maps_collect_descr">We collect this data to understand the maps of which regions and countries are the most popular.</string>
|
||||
<string name="visited_screens_collect_descr">We collect this data to understand the most popular features of OsmAnd.</string>
|
||||
<string name="privacy_and_security_change_descr">By clicking \"Allow\" you agree with our %1$s</string>
|
||||
<string name="settings_privacy_and_security">Privacy and Security</string>
|
||||
<string name="settings_privacy_and_security_desc">Choose your data for sharing with us</string>
|
||||
<string name="shared_string_no_thank_you">No, thank you</string>
|
||||
<string name="shared_string_allow">Allow</string>
|
||||
<string name="profile_name_hint">Profile Name</string>
|
||||
<string name="nav_type_hint">Navigation Type</string>
|
||||
<string name="app_mode_taxi">Taxi</string>
|
||||
|
|
|
@ -4,5 +4,6 @@
|
|||
<Preference android:key="application_profiles" android:title="@string/application_profiles" android:summary="@string/application_profiles_descr"/>
|
||||
<Preference android:key="routing_settings" android:title="@string/routing_settings_2" android:summary="@string/routing_settings_descr"/>
|
||||
<Preference android:key="subscription_settings" android:title="@string/osm_live_subscription" android:summary="@string/osm_live_subscription_desc"/>
|
||||
<Preference android:key="privacy_and_security" android:title="@string/settings_privacy_and_security" android:summary="@string/settings_privacy_and_security_desc"/>
|
||||
<PreferenceCategory android:key="plugin_settings" android:title="@string/plugin_settings" />
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -71,6 +71,8 @@ import net.osmand.aidl.navigation.NavigateSearchParams;
|
|||
|
||||
import net.osmand.aidl.customization.SetWidgetsParams;
|
||||
import net.osmand.aidl.customization.OsmandSettingsParams;
|
||||
import net.osmand.aidl.customization.OsmandSettingsInfoParams;
|
||||
import net.osmand.aidl.customization.CustomizationInfoParams;
|
||||
|
||||
import net.osmand.aidl.gpx.AGpxFile;
|
||||
import net.osmand.aidl.gpx.AGpxFileDetails;
|
||||
|
@ -699,4 +701,8 @@ interface IOsmAndAidlInterface {
|
|||
long addContextMenuButtons(in ContextMenuButtonsParams params, IOsmAndAidlCallback callback);
|
||||
boolean removeContextMenuButtons(in RemoveContextMenuButtonsParams params);
|
||||
boolean updateContextMenuButtons(in UpdateContextMenuButtonsParams params);
|
||||
|
||||
boolean areOsmandSettingsCustomized(in OsmandSettingsInfoParams params);
|
||||
|
||||
boolean setCustomization(in CustomizationInfoParams params);
|
||||
}
|
|
@ -23,7 +23,6 @@ import android.support.annotation.Nullable;
|
|||
import android.support.v7.app.AlertDialog;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
import net.osmand.CallbackWithObject;
|
||||
import net.osmand.GPXUtilities;
|
||||
|
@ -33,6 +32,7 @@ import net.osmand.IndexConstants;
|
|||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.aidl.contextmenu.ContextMenuButtonsParams;
|
||||
import net.osmand.aidl.copyfile.CopyFileParams;
|
||||
import net.osmand.aidl.customization.CustomizationInfoParams;
|
||||
import net.osmand.aidl.favorite.AFavorite;
|
||||
import net.osmand.aidl.favorite.group.AFavoriteGroup;
|
||||
import net.osmand.aidl.gpx.AGpxBitmap;
|
||||
|
@ -58,7 +58,6 @@ import net.osmand.plus.AppInitializer.AppInitializeListener;
|
|||
import net.osmand.plus.AppInitializer.InitEvents;
|
||||
import net.osmand.plus.ApplicationMode;
|
||||
import net.osmand.plus.ContextMenuAdapter;
|
||||
import net.osmand.plus.ContextMenuItem;
|
||||
import net.osmand.plus.FavouritesDbHelper;
|
||||
import net.osmand.plus.GPXDatabase.GpxDataItem;
|
||||
import net.osmand.plus.GpxSelectionHelper;
|
||||
|
@ -109,8 +108,6 @@ import java.lang.ref.WeakReference;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
@ -126,7 +123,6 @@ import static net.osmand.aidl.OsmandAidlConstants.COPY_FILE_WRITE_LOCK_ERROR;
|
|||
import static net.osmand.aidl.OsmandAidlConstants.OK_RESPONSE;
|
||||
import static net.osmand.aidl.OsmandAidlService.KEY_ON_CONTEXT_MENU_BUTTONS_CLICK;
|
||||
import static net.osmand.aidl.OsmandAidlService.KEY_ON_NAV_DATA_UPDATE;
|
||||
import static net.osmand.plus.OsmAndCustomizationConstants.DRAWER_ITEM_ID_SCHEME;
|
||||
|
||||
public class OsmandAidlApi {
|
||||
|
||||
|
@ -194,8 +190,6 @@ public class OsmandAidlApi {
|
|||
|
||||
private static final int DEFAULT_ZOOM = 15;
|
||||
|
||||
private static final int MAX_NAV_DRAWER_ITEMS_PER_APP = 3;
|
||||
|
||||
private OsmandApplication app;
|
||||
private Map<String, AMapWidget> widgets = new ConcurrentHashMap<>();
|
||||
private Map<String, TextInfoWidget> widgetControls = new ConcurrentHashMap<>();
|
||||
|
@ -1738,123 +1732,11 @@ public class OsmandAidlApi {
|
|||
}
|
||||
|
||||
boolean setNavDrawerItems(String appPackage, List<net.osmand.aidl.navdrawer.NavDrawerItem> items) {
|
||||
if (!TextUtils.isEmpty(appPackage) && items != null) {
|
||||
clearNavDrawerItems(appPackage);
|
||||
if (items.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
List<NavDrawerItem> newItems = new ArrayList<>(MAX_NAV_DRAWER_ITEMS_PER_APP);
|
||||
boolean success = true;
|
||||
for (int i = 0; i < items.size() && i <= MAX_NAV_DRAWER_ITEMS_PER_APP; i++) {
|
||||
net.osmand.aidl.navdrawer.NavDrawerItem item = items.get(i);
|
||||
String name = item.getName();
|
||||
String uri = item.getUri();
|
||||
if (!TextUtils.isEmpty(name) && !TextUtils.isEmpty(uri)) {
|
||||
newItems.add(new NavDrawerItem(name, uri, item.getIconName(), item.getFlags()));
|
||||
} else {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (success) {
|
||||
saveNavDrawerItems(appPackage, newItems);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
return false;
|
||||
return app.getAppCustomization().setNavDrawerItems(appPackage, items);
|
||||
}
|
||||
|
||||
public void registerNavDrawerItems(final Activity activity, ContextMenuAdapter adapter) {
|
||||
PackageManager pm = activity.getPackageManager();
|
||||
for (Map.Entry<String, List<NavDrawerItem>> entry : getNavDrawerItems().entrySet()) {
|
||||
String appPackage = entry.getKey();
|
||||
for (NavDrawerItem item : entry.getValue()) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(item.uri));
|
||||
if (intent.resolveActivity(pm) == null) {
|
||||
intent = pm.getLaunchIntentForPackage(appPackage);
|
||||
}
|
||||
if (intent != null) {
|
||||
if (item.flags != -1) {
|
||||
intent.addFlags(item.flags);
|
||||
}
|
||||
final Intent finalIntent = intent;
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setId(item.getId())
|
||||
.setTitle(item.name)
|
||||
.setIcon(getIconId(item.iconName))
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||
activity.startActivity(finalIntent);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.createItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int getIconId(@Nullable String iconName) {
|
||||
if (!TextUtils.isEmpty(iconName)) {
|
||||
int id = app.getResources().getIdentifier(iconName, "drawable", app.getPackageName());
|
||||
return id == 0 ? -1 : id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
private void clearNavDrawerItems(String appPackage) {
|
||||
try {
|
||||
JSONObject allItems = new JSONObject(app.getSettings().API_NAV_DRAWER_ITEMS_JSON.get());
|
||||
allItems.put(appPackage, new JSONArray());
|
||||
app.getSettings().API_NAV_DRAWER_ITEMS_JSON.set(allItems.toString());
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void saveNavDrawerItems(String appPackage, List<NavDrawerItem> items) {
|
||||
try {
|
||||
JSONArray jArray = new JSONArray();
|
||||
for (NavDrawerItem item : items) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(NavDrawerItem.NAME_KEY, item.name);
|
||||
obj.put(NavDrawerItem.URI_KEY, item.uri);
|
||||
obj.put(NavDrawerItem.ICON_NAME_KEY, item.iconName);
|
||||
obj.put(NavDrawerItem.FLAGS_KEY, item.flags);
|
||||
jArray.put(obj);
|
||||
}
|
||||
JSONObject allItems = new JSONObject(app.getSettings().API_NAV_DRAWER_ITEMS_JSON.get());
|
||||
allItems.put(appPackage, jArray);
|
||||
app.getSettings().API_NAV_DRAWER_ITEMS_JSON.set(allItems.toString());
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, List<NavDrawerItem>> getNavDrawerItems() {
|
||||
Map<String, List<NavDrawerItem>> res = new LinkedHashMap<>();
|
||||
try {
|
||||
JSONObject allItems = new JSONObject(app.getSettings().API_NAV_DRAWER_ITEMS_JSON.get());
|
||||
for (Iterator<?> it = allItems.keys(); it.hasNext(); ) {
|
||||
String appPackage = (String) it.next();
|
||||
JSONArray jArray = allItems.getJSONArray(appPackage);
|
||||
List<NavDrawerItem> list = new ArrayList<>();
|
||||
for (int i = 0; i < jArray.length(); i++) {
|
||||
JSONObject obj = jArray.getJSONObject(i);
|
||||
list.add(new NavDrawerItem(
|
||||
obj.optString(NavDrawerItem.NAME_KEY),
|
||||
obj.optString(NavDrawerItem.URI_KEY),
|
||||
obj.optString(NavDrawerItem.ICON_NAME_KEY),
|
||||
obj.optInt(NavDrawerItem.FLAGS_KEY, -1)
|
||||
));
|
||||
}
|
||||
res.put(appPackage, list);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
app.getAppCustomization().registerNavDrawerItems(activity, adapter);
|
||||
}
|
||||
|
||||
public List<ConnectedApp> getConnectedApps() {
|
||||
|
@ -2062,6 +1944,15 @@ public class OsmandAidlApi {
|
|||
}
|
||||
}
|
||||
|
||||
boolean areOsmandSettingsCustomized(String sharedPreferencesName) {
|
||||
return app.getAppCustomization().areSettingsCustomizedForPreference(sharedPreferencesName);
|
||||
}
|
||||
|
||||
boolean setCustomization(CustomizationInfoParams params) {
|
||||
app.getAppCustomization().setCustomization(params);
|
||||
return true;
|
||||
}
|
||||
|
||||
private void addContextMenuButtonListener(ContextMenuButtonsParams buttonsParams, long callbackId) {
|
||||
IContextMenuButtonListener listener = new IContextMenuButtonListener() {
|
||||
|
||||
|
@ -2325,30 +2216,6 @@ public class OsmandAidlApi {
|
|||
}
|
||||
}
|
||||
|
||||
private static class NavDrawerItem {
|
||||
|
||||
static final String NAME_KEY = "name";
|
||||
static final String URI_KEY = "uri";
|
||||
static final String ICON_NAME_KEY = "icon_name";
|
||||
static final String FLAGS_KEY = "flags";
|
||||
|
||||
private String name;
|
||||
private String uri;
|
||||
private String iconName;
|
||||
private int flags;
|
||||
|
||||
NavDrawerItem(String name, String uri, String iconName, int flags) {
|
||||
this.name = name;
|
||||
this.uri = uri;
|
||||
this.iconName = iconName;
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return DRAWER_ITEM_ID_SCHEME + name;
|
||||
}
|
||||
}
|
||||
|
||||
public interface SearchCompleteCallback {
|
||||
void onSearchComplete(List<SearchResult> resultSet);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import android.os.IBinder;
|
|||
import android.os.RemoteException;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.aidl.OsmandAidlApi.GpxBitmapCreatedCallback;
|
||||
import net.osmand.aidl.OsmandAidlApi.OsmandAppInitCallback;
|
||||
|
@ -19,6 +18,9 @@ import net.osmand.aidl.calculateroute.CalculateRouteParams;
|
|||
import net.osmand.aidl.contextmenu.ContextMenuButtonsParams;
|
||||
import net.osmand.aidl.contextmenu.RemoveContextMenuButtonsParams;
|
||||
import net.osmand.aidl.contextmenu.UpdateContextMenuButtonsParams;
|
||||
import net.osmand.aidl.copyfile.CopyFileParams;
|
||||
import net.osmand.aidl.customization.CustomizationInfoParams;
|
||||
import net.osmand.aidl.customization.OsmandSettingsInfoParams;
|
||||
import net.osmand.aidl.customization.OsmandSettingsParams;
|
||||
import net.osmand.aidl.customization.SetWidgetsParams;
|
||||
import net.osmand.aidl.favorite.AddFavoriteParams;
|
||||
|
@ -71,7 +73,6 @@ import net.osmand.aidl.plugins.PluginParams;
|
|||
import net.osmand.aidl.search.SearchParams;
|
||||
import net.osmand.aidl.search.SearchResult;
|
||||
import net.osmand.aidl.tiles.ASqliteDbFile;
|
||||
import net.osmand.aidl.copyfile.CopyFileParams;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.util.Algorithms;
|
||||
|
||||
|
@ -80,6 +81,7 @@ import org.apache.commons.logging.Log;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import static net.osmand.aidl.OsmandAidlConstants.CANNOT_ACCESS_API_ERROR;
|
||||
|
@ -131,7 +133,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
|||
public void onCreate() {
|
||||
super.onCreate();
|
||||
OsmandAidlApi api = getApi("setting_listener");
|
||||
if(api != null) {
|
||||
if (api != null) {
|
||||
api.aidlCallbackListener = this;
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +144,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
|||
|
||||
callbacks.clear();
|
||||
OsmandAidlApi api = getApi("clear_listener");
|
||||
if(api != null) {
|
||||
if (api != null) {
|
||||
api.aidlCallbackListener = null;
|
||||
}
|
||||
mHandlerThread.quit();
|
||||
|
@ -1044,7 +1046,7 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
|||
public long registerForNavigationUpdates(ANavigationUpdateParams params, final IOsmAndAidlCallback callback) {
|
||||
try {
|
||||
OsmandAidlApi api = getApi("registerForNavUpdates");
|
||||
if (api != null ) {
|
||||
if (api != null) {
|
||||
if (!params.isSubscribeToUpdates() && params.getCallbackId() != -1) {
|
||||
api.unregisterFromUpdates(params.getCallbackId());
|
||||
removeAidlCallback(params.getCallbackId());
|
||||
|
@ -1113,6 +1115,28 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean areOsmandSettingsCustomized(OsmandSettingsInfoParams params) {
|
||||
try {
|
||||
OsmandAidlApi api = getApi("areOsmandSettingsCustomized");
|
||||
return api != null && api.areOsmandSettingsCustomized(params.getSharedPreferencesName());
|
||||
} catch (Exception e) {
|
||||
handleException(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setCustomization(CustomizationInfoParams params) {
|
||||
try {
|
||||
OsmandAidlApi api = getApi("setCustomization");
|
||||
return api != null && params != null && api.setCustomization(params);
|
||||
} catch (Exception e) {
|
||||
handleException(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static class AidlCallbackParams {
|
||||
|
@ -1141,6 +1165,4 @@ public class OsmandAidlService extends Service implements AidlCallbackListener {
|
|||
this.key = key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.customization;
|
||||
|
||||
parcelable CustomizationInfoParams;
|
|
@ -0,0 +1,172 @@
|
|||
package net.osmand.aidl.customization;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
|
||||
import net.osmand.aidl.navdrawer.NavDrawerFooterParams;
|
||||
import net.osmand.aidl.navdrawer.NavDrawerHeaderParams;
|
||||
import net.osmand.aidl.navdrawer.SetNavDrawerItemsParams;
|
||||
import net.osmand.aidl.plugins.PluginParams;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CustomizationInfoParams implements Parcelable {
|
||||
|
||||
private OsmandSettingsParams settingsParams;
|
||||
|
||||
private NavDrawerHeaderParams navDrawerHeaderParams;
|
||||
private NavDrawerFooterParams navDrawerFooterParams;
|
||||
private SetNavDrawerItemsParams navDrawerItemsParams;
|
||||
|
||||
private ArrayList<SetWidgetsParams> visibilityWidgetsParams = new ArrayList<>();
|
||||
private ArrayList<SetWidgetsParams> availabilityWidgetsParams = new ArrayList<>();
|
||||
|
||||
private ArrayList<PluginParams> pluginsParams = new ArrayList<>();
|
||||
|
||||
private List<String> featuresEnabledIds = new ArrayList<>();
|
||||
private List<String> featuresDisabledIds = new ArrayList<>();
|
||||
private List<String> featuresEnabledPatterns = new ArrayList<>();
|
||||
private List<String> featuresDisabledPatterns = new ArrayList<>();
|
||||
|
||||
public CustomizationInfoParams(OsmandSettingsParams settingsParams,
|
||||
NavDrawerHeaderParams navDrawerHeaderParams,
|
||||
NavDrawerFooterParams navDrawerFooterParams,
|
||||
SetNavDrawerItemsParams navDrawerItemsParams,
|
||||
ArrayList<SetWidgetsParams> visibilityWidgetsParams,
|
||||
ArrayList<SetWidgetsParams> availabilityWidgetsParams,
|
||||
ArrayList<PluginParams> pluginsParams,
|
||||
List<String> featuresEnabledIds,
|
||||
List<String> featuresDisabledIds,
|
||||
List<String> featuresEnabledPatterns,
|
||||
List<String> featuresDisabledPatterns) {
|
||||
this.settingsParams = settingsParams;
|
||||
this.navDrawerHeaderParams = navDrawerHeaderParams;
|
||||
this.navDrawerFooterParams = navDrawerFooterParams;
|
||||
this.navDrawerItemsParams = navDrawerItemsParams;
|
||||
|
||||
if (visibilityWidgetsParams != null) {
|
||||
this.visibilityWidgetsParams.addAll(visibilityWidgetsParams);
|
||||
}
|
||||
if (availabilityWidgetsParams != null) {
|
||||
this.availabilityWidgetsParams.addAll(availabilityWidgetsParams);
|
||||
}
|
||||
if (pluginsParams != null) {
|
||||
this.pluginsParams.addAll(pluginsParams);
|
||||
}
|
||||
if (featuresEnabledIds != null) {
|
||||
this.featuresEnabledIds.addAll(featuresEnabledIds);
|
||||
}
|
||||
if (featuresDisabledIds != null) {
|
||||
this.featuresDisabledIds.addAll(featuresDisabledIds);
|
||||
}
|
||||
if (featuresEnabledPatterns != null) {
|
||||
this.featuresEnabledPatterns.addAll(featuresEnabledPatterns);
|
||||
}
|
||||
if (featuresDisabledPatterns != null) {
|
||||
this.featuresDisabledPatterns.addAll(featuresDisabledPatterns);
|
||||
}
|
||||
}
|
||||
|
||||
public CustomizationInfoParams(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<CustomizationInfoParams> CREATOR = new Creator<CustomizationInfoParams>() {
|
||||
@Override
|
||||
public CustomizationInfoParams createFromParcel(Parcel in) {
|
||||
return new CustomizationInfoParams(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomizationInfoParams[] newArray(int size) {
|
||||
return new CustomizationInfoParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public OsmandSettingsParams getSettingsParams() {
|
||||
return settingsParams;
|
||||
}
|
||||
|
||||
public NavDrawerHeaderParams getNavDrawerHeaderParams() {
|
||||
return navDrawerHeaderParams;
|
||||
}
|
||||
|
||||
public NavDrawerFooterParams getNavDrawerFooterParams() {
|
||||
return navDrawerFooterParams;
|
||||
}
|
||||
|
||||
public SetNavDrawerItemsParams getNavDrawerItemsParams() {
|
||||
return navDrawerItemsParams;
|
||||
}
|
||||
|
||||
public ArrayList<SetWidgetsParams> getVisibilityWidgetsParams() {
|
||||
return visibilityWidgetsParams;
|
||||
}
|
||||
|
||||
public ArrayList<SetWidgetsParams> getAvailabilityWidgetsParams() {
|
||||
return availabilityWidgetsParams;
|
||||
}
|
||||
|
||||
public ArrayList<PluginParams> getPluginsParams() {
|
||||
return pluginsParams;
|
||||
}
|
||||
|
||||
public List<String> getFeaturesEnabledIds() {
|
||||
return featuresEnabledIds;
|
||||
}
|
||||
|
||||
public List<String> getFeaturesDisabledIds() {
|
||||
return featuresDisabledIds;
|
||||
}
|
||||
|
||||
public List<String> getFeaturesEnabledPatterns() {
|
||||
return featuresEnabledPatterns;
|
||||
}
|
||||
|
||||
public List<String> getFeaturesDisabledPatterns() {
|
||||
return featuresDisabledPatterns;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeParcelable(settingsParams, flags);
|
||||
|
||||
out.writeParcelable(navDrawerHeaderParams, flags);
|
||||
out.writeParcelable(navDrawerFooterParams, flags);
|
||||
out.writeParcelable(navDrawerItemsParams, flags);
|
||||
|
||||
out.writeTypedList(visibilityWidgetsParams);
|
||||
out.writeTypedList(availabilityWidgetsParams);
|
||||
out.writeTypedList(pluginsParams);
|
||||
|
||||
out.writeStringList(featuresEnabledIds);
|
||||
out.writeStringList(featuresDisabledIds);
|
||||
out.writeStringList(featuresEnabledPatterns);
|
||||
out.writeStringList(featuresDisabledPatterns);
|
||||
}
|
||||
|
||||
@SuppressLint("ParcelClassLoader")
|
||||
private void readFromParcel(Parcel in) {
|
||||
settingsParams = in.readParcelable(OsmandSettingsParams.class.getClassLoader());
|
||||
|
||||
navDrawerHeaderParams = in.readParcelable(NavDrawerHeaderParams.class.getClassLoader());
|
||||
navDrawerFooterParams = in.readParcelable(NavDrawerFooterParams.class.getClassLoader());
|
||||
navDrawerItemsParams = in.readParcelable(SetNavDrawerItemsParams.class.getClassLoader());
|
||||
|
||||
in.readTypedList(visibilityWidgetsParams, SetWidgetsParams.CREATOR);
|
||||
in.readTypedList(availabilityWidgetsParams, SetWidgetsParams.CREATOR);
|
||||
in.readTypedList(pluginsParams, PluginParams.CREATOR);
|
||||
|
||||
in.readStringList(featuresEnabledIds);
|
||||
in.readStringList(featuresDisabledIds);
|
||||
in.readStringList(featuresEnabledPatterns);
|
||||
in.readStringList(featuresDisabledPatterns);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package net.osmand.aidl.customization;
|
||||
|
||||
parcelable OsmandSettingsInfoParams;
|
|
@ -0,0 +1,50 @@
|
|||
package net.osmand.aidl.customization;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
public class OsmandSettingsInfoParams implements Parcelable {
|
||||
|
||||
private String sharedPreferencesName;
|
||||
|
||||
public OsmandSettingsInfoParams(@NonNull String sharedPreferencesName) {
|
||||
this.sharedPreferencesName = sharedPreferencesName;
|
||||
}
|
||||
|
||||
public OsmandSettingsInfoParams(Parcel in) {
|
||||
readFromParcel(in);
|
||||
}
|
||||
|
||||
public static final Creator<OsmandSettingsInfoParams> CREATOR = new Creator<OsmandSettingsInfoParams>() {
|
||||
@Override
|
||||
public OsmandSettingsInfoParams createFromParcel(Parcel in) {
|
||||
return new OsmandSettingsInfoParams(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OsmandSettingsInfoParams[] newArray(int size) {
|
||||
return new OsmandSettingsInfoParams[size];
|
||||
}
|
||||
};
|
||||
|
||||
public String getSharedPreferencesName() {
|
||||
return sharedPreferencesName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
out.writeString(sharedPreferencesName);
|
||||
}
|
||||
|
||||
@SuppressLint("ParcelClassLoader")
|
||||
private void readFromParcel(Parcel in) {
|
||||
sharedPreferencesName = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -49,10 +49,14 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
private final static String DATABASE_NAME = "analytics";
|
||||
private final static int DATABASE_VERSION = 1;
|
||||
|
||||
private final static String TABLE_NAME = "events";
|
||||
private final static String TABLE_NAME = "app_events";
|
||||
private final static String COL_DATE = "date";
|
||||
private final static String COL_TYPE = "event_type";
|
||||
private final static String COL_EVENT = "event";
|
||||
|
||||
public final static int EVENT_TYPE_APP_USAGE = 1;
|
||||
public final static int EVENT_TYPE_MAP_DOWNLOAD = 2;
|
||||
|
||||
private OsmandApplication ctx;
|
||||
private String insertEventScript;
|
||||
private long lastSubmittedTime;
|
||||
|
@ -62,6 +66,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
|
||||
private static class AnalyticsItem {
|
||||
long date;
|
||||
int type;
|
||||
String event;
|
||||
}
|
||||
|
||||
|
@ -74,7 +79,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
AnalyticsHelper(OsmandApplication ctx) {
|
||||
super(ctx, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
this.ctx = ctx;
|
||||
insertEventScript = "INSERT INTO " + TABLE_NAME + " VALUES (?, ?)";
|
||||
insertEventScript = "INSERT INTO " + TABLE_NAME + " VALUES (?, ?, ?)";
|
||||
submitCollectedDataAsync();
|
||||
}
|
||||
|
||||
|
@ -84,7 +89,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
}
|
||||
|
||||
private void createTable(SQLiteDatabase db) {
|
||||
db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + COL_DATE + " long, " + COL_EVENT + " text )");
|
||||
db.execSQL("CREATE TABLE " + TABLE_NAME + " (" + COL_DATE + " long, " + COL_TYPE + " int, " + COL_EVENT + " text )");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -108,7 +113,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
return res;
|
||||
}
|
||||
|
||||
private void clearDB( long finishDate) {
|
||||
private void clearDB(long finishDate) {
|
||||
SQLiteDatabase db = getWritableDatabase();
|
||||
if (db != null && db.isOpen()) {
|
||||
try {
|
||||
|
@ -123,11 +128,18 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
if (ctx.getSettings().isInternetConnectionAvailable()) {
|
||||
long collectedRowsCount = getCollectedRowsCount();
|
||||
if (collectedRowsCount > DATA_PARCEL_SIZE) {
|
||||
if (submittingTask == null || submittingTask.isDone()) {
|
||||
final List<Integer> allowedTypes = new ArrayList<>();
|
||||
if (ctx.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get()) {
|
||||
allowedTypes.add(EVENT_TYPE_MAP_DOWNLOAD);
|
||||
}
|
||||
if (ctx.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.get()) {
|
||||
allowedTypes.add(EVENT_TYPE_APP_USAGE);
|
||||
}
|
||||
if ((submittingTask == null || submittingTask.isDone()) && allowedTypes.size() > 0) {
|
||||
submittingTask = executor.submit(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
submitCollectedData();
|
||||
submitCollectedData(allowedTypes);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
|
@ -139,17 +151,19 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
|
||||
|
||||
@SuppressLint("HardwareIds")
|
||||
private boolean submitCollectedData() {
|
||||
private void submitCollectedData(List<Integer> allowedTypes) {
|
||||
List<AnalyticsData> data = collectRecordedData();
|
||||
for (AnalyticsData d : data) {
|
||||
if (d.items != null && d.items.size() > 0) {
|
||||
try {
|
||||
JSONArray jsonItemsArray = new JSONArray();
|
||||
for (AnalyticsItem item : d.items) {
|
||||
JSONObject jsonItem = new JSONObject();
|
||||
jsonItem.put(JSON_DATE, item.date);
|
||||
jsonItem.put(JSON_EVENT, item.event);
|
||||
jsonItemsArray.put(jsonItem);
|
||||
if (allowedTypes.contains(item.type)) {
|
||||
JSONObject jsonItem = new JSONObject();
|
||||
jsonItem.put(JSON_DATE, item.date);
|
||||
jsonItem.put(JSON_EVENT, item.event);
|
||||
jsonItemsArray.put(jsonItem);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, String> additionalData = new LinkedHashMap<String, String>();
|
||||
|
@ -172,16 +186,15 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
InputStream inputStream = new ByteArrayInputStream(jsonStr.getBytes());
|
||||
String res = AndroidNetworkUtils.uploadFile(ANALYTICS_UPLOAD_URL, inputStream, ANALYTICS_FILE_NAME, true, additionalData);
|
||||
if (res != null) {
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
clearDB(d.finishDate);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private List<AnalyticsData> collectRecordedData() {
|
||||
|
@ -198,7 +211,7 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
}
|
||||
|
||||
private void collectDBData(SQLiteDatabase db, List<AnalyticsData> data) {
|
||||
Cursor query = db.rawQuery("SELECT " + COL_DATE + "," + COL_EVENT + " FROM " + TABLE_NAME + " ORDER BY " + COL_DATE + " ASC", null);
|
||||
Cursor query = db.rawQuery("SELECT " + COL_DATE + "," + COL_TYPE + "," + COL_EVENT + " FROM " + TABLE_NAME + " ORDER BY " + COL_DATE + " ASC", null);
|
||||
List<AnalyticsItem> items = new ArrayList<>();
|
||||
int itemsCounter = 0;
|
||||
long startDate = Long.MAX_VALUE;
|
||||
|
@ -208,7 +221,8 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
AnalyticsItem item = new AnalyticsItem();
|
||||
long date = query.getLong(0);
|
||||
item.date = date;
|
||||
item.event = query.getString(1);
|
||||
item.type = query.getInt(1);
|
||||
item.event = query.getString(2);
|
||||
items.add(item);
|
||||
itemsCounter++;
|
||||
|
||||
|
@ -244,11 +258,11 @@ public class AnalyticsHelper extends SQLiteOpenHelper {
|
|||
query.close();
|
||||
}
|
||||
|
||||
public void addEvent(String event) {
|
||||
public void addEvent(String event, int type) {
|
||||
SQLiteDatabase db = getWritableDatabase();
|
||||
if (db != null && db.isOpen()) {
|
||||
try {
|
||||
db.execSQL(insertEventScript, new Object[]{System.currentTimeMillis(), event});
|
||||
db.execSQL(insertEventScript, new Object[]{System.currentTimeMillis(), type, event});
|
||||
} finally {
|
||||
db.close();
|
||||
}
|
||||
|
|
|
@ -60,10 +60,12 @@ public class GpxSelectionHelper {
|
|||
savingTrackHelper = trackHelper;
|
||||
}
|
||||
|
||||
public void clearAllGpxFileToShow() {
|
||||
public void clearAllGpxFilesToShow(boolean backupSelection) {
|
||||
selectedGpxFilesBackUp.clear();
|
||||
for(SelectedGpxFile s : selectedGPXFiles) {
|
||||
selectedGpxFilesBackUp.put(s.gpxFile, s.modifiedTime);
|
||||
if (backupSelection) {
|
||||
for(SelectedGpxFile s : selectedGPXFiles) {
|
||||
selectedGpxFilesBackUp.put(s.gpxFile, s.modifiedTime);
|
||||
}
|
||||
}
|
||||
selectedGPXFiles = new ArrayList<>();
|
||||
saveCurrentSelections();
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package net.osmand.plus;
|
||||
|
||||
import static net.osmand.plus.osmedit.OpenstreetmapLocalUtil.LOG;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.net.Uri;
|
||||
|
@ -11,11 +11,16 @@ import android.os.Bundle;
|
|||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.ArrayAdapter;
|
||||
|
||||
import net.osmand.IProgress;
|
||||
import net.osmand.IndexConstants;
|
||||
import net.osmand.aidl.customization.CustomizationInfoParams;
|
||||
import net.osmand.aidl.customization.OsmandSettingsParams;
|
||||
import net.osmand.aidl.customization.SetWidgetsParams;
|
||||
import net.osmand.aidl.navdrawer.NavDrawerFooterParams;
|
||||
import net.osmand.aidl.navdrawer.NavDrawerHeaderParams;
|
||||
import net.osmand.aidl.navdrawer.SetNavDrawerItemsParams;
|
||||
import net.osmand.aidl.plugins.PluginParams;
|
||||
import net.osmand.data.LocationPoint;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
|
@ -28,6 +33,10 @@ import net.osmand.plus.myplaces.FavoritesActivity;
|
|||
import net.osmand.plus.routing.RouteCalculationResult;
|
||||
import net.osmand.plus.views.OsmandMapTileView;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
@ -36,13 +45,18 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import static net.osmand.plus.OsmAndCustomizationConstants.DRAWER_ITEM_ID_SCHEME;
|
||||
|
||||
public class OsmAndAppCustomization {
|
||||
|
||||
private static final int MAX_NAV_DRAWER_ITEMS_PER_APP = 3;
|
||||
|
||||
protected OsmandApplication app;
|
||||
protected OsmandSettings osmandSettings;
|
||||
|
||||
|
@ -209,7 +223,9 @@ public class OsmAndAppCustomization {
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public ArrayList<String> getNavDrawerLogoParams() {return navDrawerParams; }
|
||||
public ArrayList<String> getNavDrawerLogoParams() {
|
||||
return navDrawerParams;
|
||||
}
|
||||
|
||||
public boolean setNavDrawerLogo(String uri, @Nullable String packageName, @Nullable String intent) {
|
||||
if (TextUtils.isEmpty(uri)) {
|
||||
|
@ -283,6 +299,89 @@ public class OsmAndAppCustomization {
|
|||
return set;
|
||||
}
|
||||
|
||||
public void regWidgetsVisibility(@NonNull ArrayList<SetWidgetsParams> visibilityWidgetsParams) {
|
||||
for (SetWidgetsParams setWidgetsParams : visibilityWidgetsParams) {
|
||||
regWidgetVisibility(setWidgetsParams.getWidgetKey(), setWidgetsParams.getAppModesKeys());
|
||||
}
|
||||
}
|
||||
|
||||
public void regWidgetsAvailability(@NonNull ArrayList<SetWidgetsParams> availabilityWidgetsParams) {
|
||||
for (SetWidgetsParams setWidgetsParams : availabilityWidgetsParams) {
|
||||
regWidgetAvailability(setWidgetsParams.getWidgetKey(), setWidgetsParams.getAppModesKeys());
|
||||
}
|
||||
}
|
||||
|
||||
public void setCustomization(CustomizationInfoParams params) {
|
||||
OsmandSettingsParams settingsParams = params.getSettingsParams();
|
||||
if (settingsParams != null) {
|
||||
customizeOsmandSettings(settingsParams.getSharedPreferencesName(), settingsParams.getBundle());
|
||||
}
|
||||
NavDrawerHeaderParams navDrawerHeaderParams = params.getNavDrawerHeaderParams();
|
||||
NavDrawerFooterParams navDrawerFooterParams = params.getNavDrawerFooterParams();
|
||||
SetNavDrawerItemsParams navDrawerItemsParams = params.getNavDrawerItemsParams();
|
||||
|
||||
setNavDrawerParams(navDrawerHeaderParams, navDrawerFooterParams, navDrawerItemsParams);
|
||||
|
||||
ArrayList<SetWidgetsParams> visibilityWidgetsParams = params.getVisibilityWidgetsParams();
|
||||
ArrayList<SetWidgetsParams> availabilityWidgetsParams = params.getAvailabilityWidgetsParams();
|
||||
|
||||
setWidgetsParams(visibilityWidgetsParams, availabilityWidgetsParams);
|
||||
|
||||
ArrayList<PluginParams> pluginsParams = params.getPluginsParams();
|
||||
if (pluginsParams != null) {
|
||||
changePluginsStatus(pluginsParams);
|
||||
}
|
||||
|
||||
List<String> enabledIds = params.getFeaturesEnabledIds();
|
||||
List<String> disabledIds = params.getFeaturesDisabledIds();
|
||||
|
||||
setFeaturesIds(enabledIds, disabledIds);
|
||||
|
||||
List<String> enabledPatterns = params.getFeaturesEnabledPatterns();
|
||||
List<String> disabledPatterns = params.getFeaturesDisabledPatterns();
|
||||
|
||||
setFeaturesPatterns(enabledPatterns, disabledPatterns);
|
||||
}
|
||||
|
||||
public void setNavDrawerParams(NavDrawerHeaderParams navDrawerHeaderParams, NavDrawerFooterParams navDrawerFooterParams, SetNavDrawerItemsParams navDrawerItemsParams) {
|
||||
if (navDrawerHeaderParams != null) {
|
||||
setNavDrawerLogoWithParams(navDrawerHeaderParams.getImageUri(), navDrawerHeaderParams.getPackageName(), navDrawerHeaderParams.getIntent());
|
||||
}
|
||||
if (navDrawerFooterParams != null) {
|
||||
setNavDrawerFooterParams(navDrawerFooterParams);
|
||||
}
|
||||
if (navDrawerItemsParams != null) {
|
||||
setNavDrawerItems(navDrawerItemsParams.getAppPackage(), navDrawerItemsParams.getItems());
|
||||
}
|
||||
}
|
||||
|
||||
public void setWidgetsParams(ArrayList<SetWidgetsParams> visibilityWidgetsParams, ArrayList<SetWidgetsParams> availabilityWidgetsParams) {
|
||||
if (visibilityWidgetsParams != null) {
|
||||
regWidgetsVisibility(visibilityWidgetsParams);
|
||||
}
|
||||
if (availabilityWidgetsParams != null) {
|
||||
regWidgetsAvailability(availabilityWidgetsParams);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFeaturesIds(List<String> enabledIds, List<String> disabledIds) {
|
||||
if (enabledIds != null) {
|
||||
setFeaturesEnabledIds(enabledIds);
|
||||
}
|
||||
if (disabledIds != null) {
|
||||
setFeaturesDisabledIds(disabledIds);
|
||||
}
|
||||
}
|
||||
|
||||
public void setFeaturesPatterns(List<String> enabledPatterns, List<String> disabledPatterns) {
|
||||
if (enabledPatterns != null) {
|
||||
setFeaturesEnabledPatterns(enabledPatterns);
|
||||
}
|
||||
if (disabledPatterns != null) {
|
||||
setFeaturesDisabledPatterns(disabledPatterns);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isWidgetVisible(@NonNull String key, ApplicationMode appMode) {
|
||||
Set<ApplicationMode> set = widgetsVisibilityMap.get(key);
|
||||
if (set == null) {
|
||||
|
@ -300,10 +399,16 @@ public class OsmAndAppCustomization {
|
|||
}
|
||||
|
||||
public boolean setNavDrawerLogoWithParams(String imageUri, @Nullable String packageName,
|
||||
@Nullable String intent) {
|
||||
@Nullable String intent) {
|
||||
return setNavDrawerLogo(imageUri, packageName, intent);
|
||||
}
|
||||
|
||||
public void changePluginsStatus(List<PluginParams> pluginsParams) {
|
||||
for (PluginParams pluginParams : pluginsParams) {
|
||||
changePluginStatus(pluginParams);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean changePluginStatus(PluginParams params) {
|
||||
if (params.getNewState() == 0) {
|
||||
for (OsmandPlugin plugin : OsmandPlugin.getEnabledPlugins()) {
|
||||
|
@ -326,6 +431,126 @@ public class OsmAndAppCustomization {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean setNavDrawerItems(String appPackage, List<net.osmand.aidl.navdrawer.NavDrawerItem> items) {
|
||||
if (!TextUtils.isEmpty(appPackage) && items != null) {
|
||||
clearNavDrawerItems(appPackage);
|
||||
if (items.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
List<NavDrawerItem> newItems = new ArrayList<>(MAX_NAV_DRAWER_ITEMS_PER_APP);
|
||||
boolean success = true;
|
||||
for (int i = 0; i < items.size() && i <= MAX_NAV_DRAWER_ITEMS_PER_APP; i++) {
|
||||
net.osmand.aidl.navdrawer.NavDrawerItem item = items.get(i);
|
||||
String name = item.getName();
|
||||
String uri = item.getUri();
|
||||
if (!TextUtils.isEmpty(name) && !TextUtils.isEmpty(uri)) {
|
||||
newItems.add(new NavDrawerItem(name, uri, item.getIconName(), item.getFlags()));
|
||||
} else {
|
||||
success = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (success) {
|
||||
saveNavDrawerItems(appPackage, newItems);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void clearNavDrawerItems(String appPackage) {
|
||||
try {
|
||||
JSONObject allItems = new JSONObject(app.getSettings().API_NAV_DRAWER_ITEMS_JSON.get());
|
||||
allItems.put(appPackage, new JSONArray());
|
||||
app.getSettings().API_NAV_DRAWER_ITEMS_JSON.set(allItems.toString());
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void saveNavDrawerItems(String appPackage, List<NavDrawerItem> items) {
|
||||
try {
|
||||
JSONArray jArray = new JSONArray();
|
||||
for (NavDrawerItem item : items) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put(NavDrawerItem.NAME_KEY, item.name);
|
||||
obj.put(NavDrawerItem.URI_KEY, item.uri);
|
||||
obj.put(NavDrawerItem.ICON_NAME_KEY, item.iconName);
|
||||
obj.put(NavDrawerItem.FLAGS_KEY, item.flags);
|
||||
jArray.put(obj);
|
||||
}
|
||||
JSONObject allItems = new JSONObject(app.getSettings().API_NAV_DRAWER_ITEMS_JSON.get());
|
||||
allItems.put(appPackage, jArray);
|
||||
app.getSettings().API_NAV_DRAWER_ITEMS_JSON.set(allItems.toString());
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void registerNavDrawerItems(final Activity activity, ContextMenuAdapter adapter) {
|
||||
PackageManager pm = activity.getPackageManager();
|
||||
for (Map.Entry<String, List<NavDrawerItem>> entry : getNavDrawerItems().entrySet()) {
|
||||
String appPackage = entry.getKey();
|
||||
for (NavDrawerItem item : entry.getValue()) {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(item.uri));
|
||||
if (intent.resolveActivity(pm) == null) {
|
||||
intent = pm.getLaunchIntentForPackage(appPackage);
|
||||
}
|
||||
if (intent != null) {
|
||||
if (item.flags != -1) {
|
||||
intent.addFlags(item.flags);
|
||||
}
|
||||
final Intent finalIntent = intent;
|
||||
adapter.addItem(new ContextMenuItem.ItemBuilder()
|
||||
.setId(item.getId())
|
||||
.setTitle(item.name)
|
||||
.setIcon(getIconId(item.iconName))
|
||||
.setListener(new ContextMenuAdapter.ItemClickListener() {
|
||||
@Override
|
||||
public boolean onContextMenuClick(ArrayAdapter<ContextMenuItem> adapter, int itemId, int position, boolean isChecked, int[] viewCoordinates) {
|
||||
activity.startActivity(finalIntent);
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.createItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Map<String, List<NavDrawerItem>> getNavDrawerItems() {
|
||||
Map<String, List<NavDrawerItem>> res = new LinkedHashMap<>();
|
||||
try {
|
||||
JSONObject allItems = new JSONObject(app.getSettings().API_NAV_DRAWER_ITEMS_JSON.get());
|
||||
for (Iterator<?> it = allItems.keys(); it.hasNext(); ) {
|
||||
String appPackage = (String) it.next();
|
||||
JSONArray jArray = allItems.getJSONArray(appPackage);
|
||||
List<NavDrawerItem> list = new ArrayList<>();
|
||||
for (int i = 0; i < jArray.length(); i++) {
|
||||
JSONObject obj = jArray.getJSONObject(i);
|
||||
list.add(new NavDrawerItem(
|
||||
obj.optString(NavDrawerItem.NAME_KEY),
|
||||
obj.optString(NavDrawerItem.URI_KEY),
|
||||
obj.optString(NavDrawerItem.ICON_NAME_KEY),
|
||||
obj.optInt(NavDrawerItem.FLAGS_KEY, -1)
|
||||
));
|
||||
}
|
||||
res.put(appPackage, list);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int getIconId(@Nullable String iconName) {
|
||||
if (!TextUtils.isEmpty(iconName)) {
|
||||
int id = app.getResources().getIdentifier(iconName, "drawable", app.getPackageName());
|
||||
return id == 0 ? -1 : id;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private HashSet<ApplicationMode> getAppModesSet(@Nullable List<String> appModeKeys) {
|
||||
HashSet<ApplicationMode> set = new HashSet<>();
|
||||
|
@ -365,10 +590,29 @@ public class OsmAndAppCustomization {
|
|||
return !isMatchesPattern(id, featuresDisabledPatterns);
|
||||
}
|
||||
|
||||
public boolean isOsmandCustomized() {
|
||||
return areWidgetsCustomized() || areFeaturesCustomized() || areSettingsCustomized();
|
||||
}
|
||||
|
||||
public boolean areWidgetsCustomized() {
|
||||
return widgetsCustomized;
|
||||
}
|
||||
|
||||
public boolean areFeaturesCustomized() {
|
||||
return featuresCustomized;
|
||||
}
|
||||
|
||||
public boolean areSettingsCustomized() {
|
||||
return customOsmandSettings != null;
|
||||
}
|
||||
|
||||
public boolean areSettingsCustomizedForPreference(String sharedPreferencesName) {
|
||||
if (customOsmandSettings != null && customOsmandSettings.sharedPreferencesName.equals(sharedPreferencesName)) {
|
||||
return true;
|
||||
}
|
||||
return OsmandSettings.areSettingsCustomizedForPreference(sharedPreferencesName, app);
|
||||
}
|
||||
|
||||
private void setFeaturesCustomized() {
|
||||
featuresCustomized = true;
|
||||
}
|
||||
|
@ -405,4 +649,28 @@ public class OsmAndAppCustomization {
|
|||
public void removeListener(OsmAndAppCustomizationListener listener) {
|
||||
this.listeners.remove(listener);
|
||||
}
|
||||
|
||||
private static class NavDrawerItem {
|
||||
|
||||
static final String NAME_KEY = "name";
|
||||
static final String URI_KEY = "uri";
|
||||
static final String ICON_NAME_KEY = "icon_name";
|
||||
static final String FLAGS_KEY = "flags";
|
||||
|
||||
private String name;
|
||||
private String uri;
|
||||
private String iconName;
|
||||
private int flags;
|
||||
|
||||
NavDrawerItem(String name, String uri, String iconName, int flags) {
|
||||
this.name = name;
|
||||
this.uri = uri;
|
||||
this.iconName = iconName;
|
||||
this.flags = flags;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return DRAWER_ITEM_ID_SCHEME + name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -47,7 +47,7 @@ import net.osmand.plus.activities.SavingTrackHelper;
|
|||
import net.osmand.plus.api.SQLiteAPI;
|
||||
import net.osmand.plus.api.SQLiteAPIImpl;
|
||||
import net.osmand.plus.base.MapViewTrackingUtilities;
|
||||
import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
|
||||
import net.osmand.plus.dialogs.CrashBottomSheetDialogFragment;
|
||||
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
|
||||
import net.osmand.plus.download.DownloadIndexesThread;
|
||||
import net.osmand.plus.download.IndexItem;
|
||||
|
@ -86,6 +86,7 @@ import btools.routingapp.IBRouterService;
|
|||
|
||||
public class OsmandApplication extends MultiDexApplication {
|
||||
public static final String EXCEPTION_PATH = "exception.log";
|
||||
public static final String OSMAND_PRIVACY_POLICY_URL = "https://osmand.net/help-online/privacy-policy";
|
||||
private static final org.apache.commons.logging.Log LOG = PlatformUtil.getLog(OsmandApplication.class);
|
||||
|
||||
final AppInitializer appInitializer = new AppInitializer(this);
|
||||
|
@ -281,6 +282,7 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
public void setOsmandSettings(OsmandSettings osmandSettings) {
|
||||
//android.os.Process.killProcess(android.os.Process.myPid());
|
||||
this.osmandSettings = osmandSettings;
|
||||
resourceManager.getRenderer().updateSettings();
|
||||
OsmandPlugin.initPlugins(this);
|
||||
}
|
||||
|
||||
|
@ -942,9 +944,7 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
|
||||
public void logEvent(String event) {
|
||||
try {
|
||||
if (osmandSettings.SEND_ANONYMOUS_APP_USAGE_DATA.get()) {
|
||||
analyticsHelper.addEvent(event);
|
||||
}
|
||||
analyticsHelper.addEvent(event, AnalyticsHelper.EVENT_TYPE_APP_USAGE);
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
|
@ -952,9 +952,7 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
|
||||
public void logMapDownloadEvent(String event, IndexItem item) {
|
||||
try {
|
||||
if (osmandSettings.SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get()) {
|
||||
analyticsHelper.addEvent("map_download_" + event + ": " + item.getFileName());
|
||||
}
|
||||
analyticsHelper.addEvent("map_download_" + event + ": " + item.getFileName(), AnalyticsHelper.EVENT_TYPE_MAP_DOWNLOAD);
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
|
@ -962,9 +960,7 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
|
||||
public void logMapDownloadEvent(String event, IndexItem item, long time) {
|
||||
try {
|
||||
if (osmandSettings.SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get()) {
|
||||
analyticsHelper.addEvent("map_download_" + event + ": " + item.getFileName() + " in " + time + " msec");
|
||||
}
|
||||
analyticsHelper.addEvent("map_download_" + event + ": " + item.getFileName() + " in " + time + " msec", AnalyticsHelper.EVENT_TYPE_MAP_DOWNLOAD);
|
||||
} catch (Exception e) {
|
||||
LOG.error(e);
|
||||
}
|
||||
|
@ -1009,7 +1005,7 @@ public class OsmandApplication extends MultiDexApplication {
|
|||
text.append("\nApk Version : ").append(info.versionName).append(" ").append(info.versionCode);
|
||||
}
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
PlatformUtil.getLog(ErrorBottomSheetDialog.class).error("", e);
|
||||
PlatformUtil.getLog(CrashBottomSheetDialogFragment.class).error("", e);
|
||||
}
|
||||
intent.putExtra(Intent.EXTRA_TEXT, text.toString());
|
||||
Intent chooserIntent = Intent.createChooser(intent, getString(R.string.send_report));
|
||||
|
|
|
@ -4,6 +4,7 @@ package net.osmand.plus;
|
|||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.hardware.Sensor;
|
||||
import android.hardware.SensorManager;
|
||||
|
@ -28,6 +29,7 @@ import net.osmand.plus.access.AccessibilityMode;
|
|||
import net.osmand.plus.access.RelativeDirectionStyle;
|
||||
import net.osmand.plus.api.SettingsAPI;
|
||||
import net.osmand.plus.api.SettingsAPI.SettingsEditor;
|
||||
import net.osmand.plus.api.SettingsAPIImpl;
|
||||
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
|
||||
import net.osmand.plus.helpers.SearchHistoryHelper;
|
||||
import net.osmand.plus.mapillary.MapillaryPlugin;
|
||||
|
@ -120,6 +122,7 @@ public class OsmandSettings {
|
|||
}
|
||||
|
||||
// These settings are stored in SharedPreferences
|
||||
private static final String CUSTOM_SHARED_PREFERENCES_PREFIX = "net.osmand.customsettings.";
|
||||
private static final String SHARED_PREFERENCES_NAME = "net.osmand.settings";
|
||||
private static String CUSTOM_SHARED_PREFERENCES_NAME;
|
||||
|
||||
|
@ -148,8 +151,9 @@ public class OsmandSettings {
|
|||
protected OsmandSettings(OsmandApplication clientContext, SettingsAPI settinsAPI, String sharedPreferencesName) {
|
||||
ctx = clientContext;
|
||||
this.settingsAPI = settinsAPI;
|
||||
CUSTOM_SHARED_PREFERENCES_NAME = "net.osmand.customsettings." + sharedPreferencesName;
|
||||
CUSTOM_SHARED_PREFERENCES_NAME = CUSTOM_SHARED_PREFERENCES_PREFIX + sharedPreferencesName;
|
||||
initPrefs();
|
||||
setCustomized();
|
||||
}
|
||||
|
||||
private void initPrefs() {
|
||||
|
@ -160,6 +164,12 @@ public class OsmandSettings {
|
|||
registeredPreferences.put(APPLICATION_MODE.getId(), APPLICATION_MODE);
|
||||
}
|
||||
|
||||
private static final String SETTING_CUSTOMIZED_ID = "settings_customized";
|
||||
|
||||
private void setCustomized() {
|
||||
settingsAPI.edit(globalPreferences).putBoolean(SETTING_CUSTOMIZED_ID, true).commit();
|
||||
}
|
||||
|
||||
public OsmandApplication getContext() {
|
||||
return ctx;
|
||||
}
|
||||
|
@ -182,6 +192,14 @@ public class OsmandSettings {
|
|||
}
|
||||
}
|
||||
|
||||
public static boolean areSettingsCustomizedForPreference(String sharedPreferencesName, OsmandApplication app) {
|
||||
String customPrefName = CUSTOM_SHARED_PREFERENCES_PREFIX + sharedPreferencesName;
|
||||
SettingsAPIImpl settingsAPI = new net.osmand.plus.api.SettingsAPIImpl(app);
|
||||
SharedPreferences globalPreferences = (SharedPreferences) settingsAPI.getPreferenceObject(customPrefName);
|
||||
|
||||
return globalPreferences != null && globalPreferences.getBoolean(SETTING_CUSTOMIZED_ID, false);
|
||||
}
|
||||
|
||||
public Object getProfilePreferences(ApplicationMode mode) {
|
||||
return settingsAPI.getPreferenceObject(getSharedPreferencesName(mode));
|
||||
}
|
||||
|
@ -1042,6 +1060,9 @@ public class OsmandSettings {
|
|||
public final OsmandPreference<Boolean> DO_NOT_USE_ANIMATIONS = new BooleanPreference("do_not_use_animations", false).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> SEND_ANONYMOUS_MAP_DOWNLOADS_DATA = new BooleanPreference("send_anonymous_map_downloads_data", false).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> SEND_ANONYMOUS_APP_USAGE_DATA = new BooleanPreference("send_anonymous_app_usage_data", false).makeGlobal().cache();
|
||||
public final OsmandPreference<Boolean> SEND_ANONYMOUS_DATA_REQUEST_PROCESSED = new BooleanPreference("send_anonymous_data_request_processed", false).makeGlobal().cache();
|
||||
public final OsmandPreference<Integer> SEND_ANONYMOUS_DATA_REQUESTS_COUNT = new IntPreference("send_anonymous_data_requests_count", 0).makeGlobal().cache();
|
||||
public final OsmandPreference<Integer> SEND_ANONYMOUS_DATA_LAST_REQUEST_NS = new IntPreference("send_anonymous_data_last_request_ns", -1).makeGlobal().cache();
|
||||
|
||||
public final OsmandPreference<Boolean> MAP_EMPTY_STATE_ALLOWED = new BooleanPreference("map_empty_state_allowed", true).makeGlobal().cache();
|
||||
|
||||
|
|
|
@ -83,7 +83,9 @@ import net.osmand.plus.base.MapViewTrackingUtilities;
|
|||
import net.osmand.plus.chooseplan.OsmLiveCancelledDialog;
|
||||
import net.osmand.plus.dashboard.DashboardOnMap;
|
||||
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
|
||||
import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
|
||||
import net.osmand.plus.dialogs.CrashBottomSheetDialogFragment;
|
||||
import net.osmand.plus.dialogs.RateUsBottomSheetDialogFragment;
|
||||
import net.osmand.plus.dialogs.SendAnalyticsBottomSheetDialogFragment;
|
||||
import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
|
||||
import net.osmand.plus.dialogs.WhatsNewDialogFragment;
|
||||
import net.osmand.plus.dialogs.XMasDialogFragment;
|
||||
|
@ -680,12 +682,12 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
if (settings.SHOW_DASHBOARD_ON_START.get()) {
|
||||
dashboardOnMap.setDashboardVisibility(true, DashboardOnMap.staticVisibleType);
|
||||
} else {
|
||||
if (ErrorBottomSheetDialog.shouldShow(settings, this)) {
|
||||
if (CrashBottomSheetDialogFragment.shouldShow(settings, this)) {
|
||||
SecondSplashScreenFragment.SHOW = false;
|
||||
new ErrorBottomSheetDialog().show(getSupportFragmentManager(), "dialog");
|
||||
} else if (RateUsBottomSheetDialog.shouldShow(app)) {
|
||||
CrashBottomSheetDialogFragment.showInstance(getSupportFragmentManager());
|
||||
} else if (RateUsBottomSheetDialogFragment.shouldShow(app)) {
|
||||
SecondSplashScreenFragment.SHOW = false;
|
||||
new RateUsBottomSheetDialog().show(getSupportFragmentManager(), "dialog");
|
||||
RateUsBottomSheetDialogFragment.showInstance(getSupportFragmentManager());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -860,6 +862,8 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
FirstUsageWelcomeFragment.TAG).commitAllowingStateLoss();
|
||||
} else if (!isFirstScreenShowing() && OsmLiveCancelledDialog.shouldShowDialog(app)) {
|
||||
OsmLiveCancelledDialog.showInstance(getSupportFragmentManager());
|
||||
} else if (SendAnalyticsBottomSheetDialogFragment.shouldShowDialog(app)) {
|
||||
SendAnalyticsBottomSheetDialogFragment.showInstance(app, getSupportFragmentManager());
|
||||
}
|
||||
FirstUsageWelcomeFragment.SHOW = false;
|
||||
if (isFirstScreenShowing() && (!settings.SHOW_OSMAND_WELCOME_SCREEN.get() || !showOsmAndWelcomeScreen)) {
|
||||
|
@ -1588,6 +1592,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
}
|
||||
((MapActivity) activity).readLocationToShow();
|
||||
} else {
|
||||
int additionalFlags = 0;
|
||||
if (activity instanceof Activity) {
|
||||
Intent intent = ((Activity) activity).getIntent();
|
||||
if (intent != null) {
|
||||
|
@ -1598,11 +1603,12 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
|
|||
}
|
||||
} else {
|
||||
prevActivityIntent = null;
|
||||
additionalFlags = Intent.FLAG_ACTIVITY_NEW_TASK;
|
||||
}
|
||||
|
||||
Intent newIntent = new Intent(activity, ((OsmandApplication) activity.getApplicationContext())
|
||||
.getAppCustomization().getMapActivity());
|
||||
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
newIntent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_CLEAR_TOP | additionalFlags);
|
||||
if (intentExtraActionName != null) {
|
||||
newIntent.putExtra(intentExtraActionName, intentExtraActionValue);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
package net.osmand.plus.activities;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.TypedValue;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.CompoundButton;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
|
||||
public class PrivacyAndSecurityActivity extends OsmandActionBarActivity {
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
int themeId = !app.getSettings().isLightContent() ? R.style.OsmandDarkTheme_NoActionbar : R.style.OsmandLightTheme_NoActionbar;
|
||||
setTheme(themeId);
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.privacy_settings_layout);
|
||||
Toolbar tb = (Toolbar) findViewById(R.id.toolbar);
|
||||
tb.setTitle(R.string.settings_privacy_and_security);
|
||||
|
||||
tb.setClickable(true);
|
||||
tb.setNavigationIcon(((OsmandApplication) getApplication()).getUIUtilities().getIcon(R.drawable.ic_arrow_back));
|
||||
tb.setNavigationContentDescription(R.string.access_shared_string_navigate_up);
|
||||
tb.setBackgroundColor(getResources().getColor(resolveResourceId(this, R.attr.pstsTabBackground)));
|
||||
tb.setTitleTextColor(getResources().getColor(resolveResourceId(this, R.attr.pstsTextColor)));
|
||||
tb.setNavigationOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(final View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
View downloadedMapsContainer = findViewById(R.id.downloaded_maps_container);
|
||||
final SwitchCompat downloadedMapsButton = (SwitchCompat) findViewById(R.id.downloaded_maps_button);
|
||||
downloadedMapsButton.setChecked(app.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get());
|
||||
downloadedMapsButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
app.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.set(isChecked);
|
||||
}
|
||||
});
|
||||
downloadedMapsContainer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
downloadedMapsButton.setChecked(!downloadedMapsButton.isChecked());
|
||||
}
|
||||
});
|
||||
|
||||
View visitedScreensContainer = findViewById(R.id.visited_screens_container);
|
||||
final SwitchCompat visitedScreensButton = (SwitchCompat) findViewById(R.id.visited_screens_button);
|
||||
visitedScreensButton.setChecked(app.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.get());
|
||||
visitedScreensButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
app.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.set(isChecked);
|
||||
}
|
||||
});
|
||||
visitedScreensContainer.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
visitedScreensButton.setChecked(!visitedScreensButton.isChecked());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int itemId = item.getItemId();
|
||||
switch (itemId) {
|
||||
case android.R.id.home:
|
||||
finish();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private int resolveResourceId(final Activity activity, final int attr) {
|
||||
final TypedValue typedvalueattr = new TypedValue();
|
||||
activity.getTheme().resolveAttribute(attr, typedvalueattr, true);
|
||||
return typedvalueattr.resourceId;
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@ public class SettingsActivity extends SettingsBaseActivity {
|
|||
private Preference routing;
|
||||
private Preference subscription;
|
||||
private Preference profiles;
|
||||
private Preference privacy;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -46,6 +47,8 @@ public class SettingsActivity extends SettingsBaseActivity {
|
|||
profiles.setOnPreferenceClickListener(this);
|
||||
subscription = (Preference) screen.findPreference("subscription_settings");
|
||||
subscription.setOnPreferenceClickListener(this);
|
||||
privacy = (Preference) screen.findPreference("privacy_and_security");
|
||||
privacy.setOnPreferenceClickListener(this);
|
||||
|
||||
getToolbar().setTitle(Version.getFullVersion(getMyApplication()));
|
||||
|
||||
|
@ -103,6 +106,10 @@ public class SettingsActivity extends SettingsBaseActivity {
|
|||
intent.putExtra(OsmLiveActivity.SHOW_SETTINGS_ONLY_INTENT_PARAM, true);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else if (preference == privacy) {
|
||||
Intent intent = new Intent(this, PrivacyAndSecurityActivity.class);
|
||||
startActivity(intent);
|
||||
return true;
|
||||
} else {
|
||||
super.onPreferenceClick(preference);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,8 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
protected boolean nightMode;
|
||||
|
||||
protected int themeRes;
|
||||
protected View dismissButton;
|
||||
protected View rightButton;
|
||||
|
||||
private LinearLayout itemsContainer;
|
||||
|
||||
|
@ -85,8 +87,8 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
|
||||
inflateMenuItems();
|
||||
|
||||
View dismissButton = mainView.findViewById(R.id.dismiss_button);
|
||||
setupDialogButton(dismissButton, DialogButtonType.STROKED, getDismissButtonTextId());
|
||||
dismissButton = mainView.findViewById(R.id.dismiss_button);
|
||||
setupDialogButton(dismissButton, getDismissByttonType(), getDismissButtonTextId());
|
||||
dismissButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -100,8 +102,8 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
int rightBottomButtonTextId = getRightBottomButtonTextId();
|
||||
if (rightBottomButtonTextId != DEFAULT_VALUE) {
|
||||
mainView.findViewById(R.id.buttons_divider).setVisibility(View.VISIBLE);
|
||||
View rightButton = mainView.findViewById(R.id.right_bottom_button);
|
||||
setupDialogButton(rightButton, DialogButtonType.PRIMARY, rightBottomButtonTextId);
|
||||
rightButton = mainView.findViewById(R.id.right_bottom_button);
|
||||
setupDialogButton(rightButton, getRightBottomByttonType(), rightBottomButtonTextId);
|
||||
rightButton.setVisibility(View.VISIBLE);
|
||||
rightButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -111,6 +113,7 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
});
|
||||
}
|
||||
}
|
||||
updateBottomButtons();
|
||||
setupHeightAndBackground(mainView);
|
||||
return mainView;
|
||||
}
|
||||
|
@ -283,6 +286,10 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
dismissButtonStringRes = stringRes;
|
||||
}
|
||||
|
||||
protected DialogButtonType getDismissByttonType() {
|
||||
return DialogButtonType.SECONDARY;
|
||||
}
|
||||
|
||||
protected void onDismissButtonClickAction() {
|
||||
|
||||
}
|
||||
|
@ -292,10 +299,35 @@ public abstract class MenuBottomSheetDialogFragment extends BottomSheetDialogFra
|
|||
return DEFAULT_VALUE;
|
||||
}
|
||||
|
||||
protected DialogButtonType getRightBottomByttonType() {
|
||||
return DialogButtonType.PRIMARY;
|
||||
}
|
||||
|
||||
protected void onRightBottomButtonClick() {
|
||||
|
||||
}
|
||||
|
||||
protected boolean isDismissButtonEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected boolean isRightBottomButtonEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void updateBottomButtons() {
|
||||
if (dismissButton != null) {
|
||||
boolean enabled = isDismissButtonEnabled();
|
||||
dismissButton.setEnabled(enabled);
|
||||
dismissButton.findViewById(R.id.button_text).setEnabled(enabled);
|
||||
}
|
||||
if (rightButton != null) {
|
||||
boolean enabled = isRightBottomButtonEnabled();
|
||||
rightButton.setEnabled(enabled);
|
||||
rightButton.findViewById(R.id.button_text).setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
@ColorRes
|
||||
protected int getBgColorId() {
|
||||
return nightMode ? R.color.bg_color_dark : R.color.bg_color_light;
|
||||
|
|
|
@ -35,6 +35,7 @@ public class BottomSheetItemTitleWithDescrAndButton extends BottomSheetItemWithD
|
|||
CharSequence description,
|
||||
@ColorRes int descriptionColorId,
|
||||
int descriptionMaxLines,
|
||||
boolean descriptionLinksClickable,
|
||||
String buttonTitle,
|
||||
View.OnClickListener onButtonClickListener,
|
||||
Drawable leftCompoundDrawable,
|
||||
|
@ -51,7 +52,8 @@ public class BottomSheetItemTitleWithDescrAndButton extends BottomSheetItemWithD
|
|||
titleColorId,
|
||||
description,
|
||||
descriptionColorId,
|
||||
descriptionMaxLines);
|
||||
descriptionMaxLines,
|
||||
descriptionLinksClickable);
|
||||
this.buttonTitle = buttonTitle;
|
||||
this.onButtonClickListener = onButtonClickListener;
|
||||
this.leftCompoundDrawable = leftCompoundDrawable;
|
||||
|
@ -125,6 +127,7 @@ public class BottomSheetItemTitleWithDescrAndButton extends BottomSheetItemWithD
|
|||
description,
|
||||
descriptionColorId,
|
||||
descriptionMaxLines,
|
||||
descriptionLinksClickable,
|
||||
buttonTitle,
|
||||
onButtonClickListener,
|
||||
leftCompoundDrawable,
|
||||
|
|
|
@ -37,6 +37,7 @@ public class BottomSheetItemWithCompoundButton extends BottomSheetItemWithDescri
|
|||
CharSequence description,
|
||||
@ColorRes int descriptionColorId,
|
||||
int descriptionMaxLines,
|
||||
boolean descriptionLinksClickable,
|
||||
boolean checked,
|
||||
ColorStateList buttonTintList,
|
||||
OnCheckedChangeListener onCheckedChangeListener) {
|
||||
|
@ -51,7 +52,8 @@ public class BottomSheetItemWithCompoundButton extends BottomSheetItemWithDescri
|
|||
titleColorId,
|
||||
description,
|
||||
descriptionColorId,
|
||||
descriptionMaxLines);
|
||||
descriptionMaxLines,
|
||||
descriptionLinksClickable);
|
||||
this.checked = checked;
|
||||
this.buttonTintList = buttonTintList;
|
||||
this.onCheckedChangeListener = onCheckedChangeListener;
|
||||
|
@ -109,6 +111,7 @@ public class BottomSheetItemWithCompoundButton extends BottomSheetItemWithDescri
|
|||
description,
|
||||
descriptionColorId,
|
||||
descriptionMaxLines,
|
||||
descriptionLinksClickable,
|
||||
checked,
|
||||
buttonTintList,
|
||||
onCheckedChangeListener);
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.graphics.drawable.Drawable;
|
|||
import android.support.annotation.ColorRes;
|
||||
import android.support.annotation.LayoutRes;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
@ -17,6 +18,7 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
@ColorRes
|
||||
private int descriptionColorId = INVALID_ID;
|
||||
private int descriptionMaxLines = INVALID_VALUE;
|
||||
private boolean descriptionLinksClickable = false;
|
||||
|
||||
private TextView descriptionTv;
|
||||
|
||||
|
@ -31,11 +33,13 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
@ColorRes int titleColorId,
|
||||
CharSequence description,
|
||||
@ColorRes int descriptionColorId,
|
||||
int descriptionMaxLines) {
|
||||
int descriptionMaxLines,
|
||||
boolean descriptionLinksClickable) {
|
||||
super(customView, layoutId, tag, disabled, onClickListener, position, icon, title, titleColorId);
|
||||
this.description = description;
|
||||
this.descriptionColorId = descriptionColorId;
|
||||
this.descriptionMaxLines = descriptionMaxLines;
|
||||
this.descriptionLinksClickable = descriptionLinksClickable;
|
||||
}
|
||||
|
||||
protected BottomSheetItemWithDescription() {
|
||||
|
@ -52,6 +56,17 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
descriptionTv.setMaxLines(maxLines);
|
||||
}
|
||||
|
||||
public void setDescriptionLinksClickable(boolean descriptionLinksClickable) {
|
||||
this.descriptionLinksClickable = descriptionLinksClickable;
|
||||
if (descriptionTv != null) {
|
||||
if (descriptionLinksClickable) {
|
||||
descriptionTv.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
} else {
|
||||
descriptionTv.setMovementMethod(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inflate(OsmandApplication app, ViewGroup container, boolean nightMode) {
|
||||
super.inflate(app, container, nightMode);
|
||||
|
@ -64,6 +79,9 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
if (descriptionMaxLines != INVALID_VALUE) {
|
||||
descriptionTv.setMaxLines(descriptionMaxLines);
|
||||
}
|
||||
if (descriptionLinksClickable) {
|
||||
descriptionTv.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,6 +91,7 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
@ColorRes
|
||||
protected int descriptionColorId = INVALID_ID;
|
||||
protected int descriptionMaxLines = INVALID_POSITION;
|
||||
protected boolean descriptionLinksClickable = false;
|
||||
|
||||
public Builder setDescription(CharSequence description) {
|
||||
this.description = description;
|
||||
|
@ -89,6 +108,10 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
return this;
|
||||
}
|
||||
|
||||
public void setDescriptionLinksClickable(boolean descriptionLinksClickable) {
|
||||
this.descriptionLinksClickable = descriptionLinksClickable;
|
||||
}
|
||||
|
||||
public BottomSheetItemWithDescription create() {
|
||||
return new BottomSheetItemWithDescription(customView,
|
||||
layoutId,
|
||||
|
@ -101,7 +124,8 @@ public class BottomSheetItemWithDescription extends SimpleBottomSheetItem {
|
|||
titleColorId,
|
||||
description,
|
||||
descriptionColorId,
|
||||
descriptionMaxLines);
|
||||
descriptionMaxLines,
|
||||
descriptionLinksClickable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package net.osmand.plus.base.bottomsheetmenu.simpleitems;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.annotation.ColorRes;
|
||||
|
||||
import net.osmand.plus.R;
|
||||
|
||||
public class SubtitmeListDividerItem extends DividerItem {
|
||||
|
||||
public SubtitmeListDividerItem(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public SubtitmeListDividerItem(Context context, @ColorRes int colorId) {
|
||||
super(context, colorId);
|
||||
}
|
||||
|
||||
public SubtitmeListDividerItem(Context context, @ColorRes int colorId, int position) {
|
||||
super(context, colorId, position);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getBottomMargin(Context context) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getLeftMargin(Context context) {
|
||||
return context.getResources().getDimensionPixelSize(R.dimen.list_content_padding);
|
||||
}
|
||||
}
|
|
@ -1,10 +1,6 @@
|
|||
package net.osmand.plus.dashboard;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
|
@ -15,19 +11,15 @@ import android.widget.Button;
|
|||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.AndroidUtils;
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
import net.osmand.plus.dashboard.tools.DashFragmentData;
|
||||
import net.osmand.plus.dialogs.ErrorBottomSheetDialog;
|
||||
import net.osmand.plus.dialogs.CrashBottomSheetDialogFragment;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
public class DashErrorFragment extends DashBaseFragment {
|
||||
|
@ -38,7 +30,7 @@ public class DashErrorFragment extends DashBaseFragment {
|
|||
// If settings null. No changes in setting will be made.
|
||||
@Override
|
||||
public boolean shouldShow(OsmandSettings settings, MapActivity activity, String tag) {
|
||||
return ErrorBottomSheetDialog.shouldShow(settings, activity);
|
||||
return CrashBottomSheetDialogFragment.shouldShow(settings, activity);
|
||||
}
|
||||
};
|
||||
private DismissListener dismissCallback;
|
||||
|
|
|
@ -219,7 +219,7 @@ public class ConfigureMapMenu {
|
|||
} else if (itemId == R.string.layer_gpx_layer) {
|
||||
final GpxSelectionHelper selectedGpxHelper = ma.getMyApplication().getSelectedGpxHelper();
|
||||
if (selectedGpxHelper.isShowingAnyGpxFiles()) {
|
||||
selectedGpxHelper.clearAllGpxFileToShow();
|
||||
selectedGpxHelper.clearAllGpxFilesToShow(true);
|
||||
adapter.getItem(pos).setDescription(selectedGpxHelper.getGpxDescription());
|
||||
} else {
|
||||
showGpxSelectionDialog(adapter, adapter.getItem(pos));
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
package net.osmand.plus.dialogs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.SubtitleDividerItem;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
public class CrashBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
|
||||
public static final String TAG = "CrashBottomSheetDialogFragment";
|
||||
private static final Log LOG = PlatformUtil.getLog(CrashBottomSheetDialogFragment.class);
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
Context context = getContext();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final View titleView = View.inflate(new ContextThemeWrapper(context, themeRes), R.layout.crash_title, null);
|
||||
final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder()
|
||||
.setCustomView(titleView)
|
||||
.create();
|
||||
items.add(titleItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRightBottomButtonTextId() {
|
||||
return R.string.shared_string_send;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRightBottomButtonClick() {
|
||||
OsmandApplication app = getMyApplication();
|
||||
if (app != null) {
|
||||
app.sendCrashLog();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public static boolean shouldShow(OsmandSettings settings, MapActivity activity) {
|
||||
return activity.getMyApplication().getAppInitializer()
|
||||
.checkPreviousRunsForExceptions(activity, settings != null);
|
||||
}
|
||||
|
||||
public static void showInstance(@NonNull FragmentManager fm) {
|
||||
try {
|
||||
if (fm.findFragmentByTag(CrashBottomSheetDialogFragment.TAG) == null) {
|
||||
CrashBottomSheetDialogFragment fragment = new CrashBottomSheetDialogFragment();
|
||||
fragment.show(fm, CrashBottomSheetDialogFragment.TAG);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error("showInstance", e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
package net.osmand.plus.dialogs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v7.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
public class DislikeOsmAndBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
|
||||
public static final String TAG = "DislikeOsmAndBottomSheetDialogFragment";
|
||||
private static final Log LOG = PlatformUtil.getLog(DislikeOsmAndBottomSheetDialogFragment.class);
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
Context context = getContext();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final View titleView = View.inflate(new ContextThemeWrapper(context, themeRes), R.layout.dislike_title, null);
|
||||
final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder()
|
||||
.setCustomView(titleView)
|
||||
.create();
|
||||
items.add(titleItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDismissButtonTextId() {
|
||||
return R.string.shared_string_cancel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismissButtonClickAction() {
|
||||
OsmandApplication app = getMyApplication();
|
||||
if (app != null) {
|
||||
app.getSettings().RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITHOUT_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRightBottomButtonTextId() {
|
||||
return R.string.shared_string_send;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRightBottomButtonClick() {
|
||||
OsmandApplication app = getMyApplication();
|
||||
if (app != null) {
|
||||
OsmandSettings settings = app.getSettings();
|
||||
String email = getString(R.string.support_email);
|
||||
settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITH_MESSAGE);
|
||||
settings.NUMBER_OF_APPLICATION_STARTS.set(0);
|
||||
settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
|
||||
Intent sendEmail = new Intent(Intent.ACTION_SENDTO);
|
||||
sendEmail.setType("text/plain");
|
||||
sendEmail.setData(Uri.parse("mailto:" + email));
|
||||
sendEmail.putExtra(Intent.EXTRA_EMAIL, email);
|
||||
startActivity(sendEmail);
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public static void showInstance(@NonNull FragmentManager fm) {
|
||||
try {
|
||||
if (fm.findFragmentByTag(DislikeOsmAndBottomSheetDialogFragment.TAG) == null) {
|
||||
DislikeOsmAndBottomSheetDialogFragment fragment = new DislikeOsmAndBottomSheetDialogFragment();
|
||||
fragment.show(fm, DislikeOsmAndBottomSheetDialogFragment.TAG);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error("showInstance", e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
package net.osmand.plus.dialogs;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.activities.MapActivity;
|
||||
import net.osmand.plus.activities.OsmandActionBarActivity;
|
||||
import net.osmand.plus.base.BottomSheetDialogFragment;
|
||||
import net.osmand.plus.helpers.FontCache;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
public class ErrorBottomSheetDialog extends BottomSheetDialogFragment {
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
FragmentActivity activity = requireActivity();
|
||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
||||
View view = activity.getLayoutInflater().inflate(R.layout.dash_error_fragment, container, false);
|
||||
String msg = MessageFormat.format(getString(R.string.previous_run_crashed), OsmandApplication.EXCEPTION_PATH);
|
||||
Typeface typeface = FontCache.getRobotoMedium(activity);
|
||||
ImageView iv = ((ImageView) view.findViewById(R.id.error_icon));
|
||||
iv.setImageDrawable(app.getUIUtilities().getThemedIcon(R.drawable.ic_crashlog));
|
||||
TextView message = ((TextView) view.findViewById(R.id.error_header));
|
||||
message.setTypeface(typeface);
|
||||
message.setText(msg);
|
||||
Button errorBtn = ((Button) view.findViewById(R.id.error_btn));
|
||||
errorBtn.setTypeface(typeface);
|
||||
errorBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
if (app != null) {
|
||||
app.sendCrashLog();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
Button cancelBtn = ((Button) view.findViewById(R.id.error_cancel));
|
||||
cancelBtn.setTypeface(typeface);
|
||||
cancelBtn.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
OsmandActionBarActivity dashboardActivity = ((OsmandActionBarActivity) getActivity());
|
||||
if (dashboardActivity != null) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
return view;
|
||||
}
|
||||
|
||||
public static boolean shouldShow(OsmandSettings settings, MapActivity activity) {
|
||||
return activity.getMyApplication().getAppInitializer()
|
||||
.checkPreviousRunsForExceptions(activity, settings != null);
|
||||
}
|
||||
}
|
|
@ -83,7 +83,7 @@ public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
|
|||
}
|
||||
}
|
||||
// Initial state now
|
||||
modifiedTime.add(Calendar.HOUR, -72);
|
||||
modifiedTime.add(Calendar.MONTH, -1);
|
||||
bannerFreeRuns = 3;
|
||||
return modifiedTime.after(lastDisplayTime) && numberOfApplicationRuns >= bannerFreeRuns;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
package net.osmand.plus.dialogs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.Version;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.SubtitleDividerItem;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class RateUsBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
|
||||
public static final String TAG = "RateUsBottomSheetDialogFragment";
|
||||
private static final Log LOG = PlatformUtil.getLog(SendAnalyticsBottomSheetDialogFragment.class);
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
Context context = getContext();
|
||||
if (context == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final View titleView = View.inflate(new ContextThemeWrapper(context, themeRes), R.layout.rate_us_title, null);
|
||||
final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder()
|
||||
.setCustomView(titleView)
|
||||
.create();
|
||||
items.add(titleItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDismissButtonTextId() {
|
||||
return R.string.shared_string_no;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismissButtonClickAction() {
|
||||
FragmentManager fm = getFragmentManager();
|
||||
if (fm != null) {
|
||||
DislikeOsmAndBottomSheetDialogFragment.showInstance(fm);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRightBottomButtonTextId() {
|
||||
return R.string.button_rate;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRightBottomButtonClick() {
|
||||
OsmandApplication app = getMyApplication();
|
||||
if (app != null) {
|
||||
app.getSettings().RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
|
||||
Uri uri = Uri.parse(Version.getUrlWithUtmRef(app, app.getPackageName()));
|
||||
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
|
||||
startActivity(goToMarket);
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean shouldShow(OsmandApplication app) {
|
||||
return RateUsBottomSheetDialog.shouldShow(app);
|
||||
}
|
||||
|
||||
public static void showInstance(@NonNull FragmentManager fm) {
|
||||
try {
|
||||
if (fm.findFragmentByTag(RateUsBottomSheetDialogFragment.TAG) == null) {
|
||||
RateUsBottomSheetDialogFragment fragment = new RateUsBottomSheetDialogFragment();
|
||||
fragment.show(fm, RateUsBottomSheetDialogFragment.TAG);
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error("showInstance", e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,193 @@
|
|||
package net.osmand.plus.dialogs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextPaint;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.URLSpan;
|
||||
import android.view.ContextThemeWrapper;
|
||||
import android.view.View;
|
||||
|
||||
import net.osmand.PlatformUtil;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.OsmandSettings;
|
||||
import net.osmand.plus.OsmandSettings.OsmandPreference;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
|
||||
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton;
|
||||
import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.LongDescriptionItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.SubtitleDividerItem;
|
||||
import net.osmand.plus.base.bottomsheetmenu.simpleitems.SubtitmeListDividerItem;
|
||||
import net.osmand.plus.chooseplan.OsmLiveCancelledDialog;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
public class SendAnalyticsBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
|
||||
|
||||
public static final String TAG = "SendAnalyticsBottomSheetDialogFragment";
|
||||
private static final Log LOG = PlatformUtil.getLog(SendAnalyticsBottomSheetDialogFragment.class);
|
||||
|
||||
private boolean sendAnonymousMapDownloadsData;
|
||||
private boolean sendAnonymousAppUsageData;
|
||||
|
||||
@Override
|
||||
public void createMenuItems(Bundle savedInstanceState) {
|
||||
OsmandApplication app = getMyApplication();
|
||||
Context context = getContext();
|
||||
if (context == null || app == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
final View titleView = View.inflate(new ContextThemeWrapper(context, themeRes), R.layout.make_better_title, null);
|
||||
final SimpleBottomSheetItem titleItem = (SimpleBottomSheetItem) new SimpleBottomSheetItem.Builder()
|
||||
.setCustomView(titleView)
|
||||
.create();
|
||||
items.add(titleItem);
|
||||
|
||||
items.add(new SubtitleDividerItem(context));
|
||||
|
||||
sendAnonymousMapDownloadsData = app.getSettings().SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.get();
|
||||
sendAnonymousAppUsageData = app.getSettings().SEND_ANONYMOUS_APP_USAGE_DATA.get();
|
||||
final BottomSheetItemWithCompoundButton[] downloadedMapsItem = new BottomSheetItemWithCompoundButton[1];
|
||||
downloadedMapsItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()
|
||||
.setChecked(sendAnonymousMapDownloadsData)
|
||||
.setTitle(getString(R.string.downloaded_maps))
|
||||
.setLayoutId(R.layout.bottom_sheet_item_with_switch_no_icon)
|
||||
.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean checked = !downloadedMapsItem[0].isChecked();
|
||||
downloadedMapsItem[0].setChecked(checked);
|
||||
sendAnonymousMapDownloadsData = checked;
|
||||
updateBottomButtons();
|
||||
}
|
||||
})
|
||||
.setTag("downloaded_maps")
|
||||
.create();
|
||||
items.add(downloadedMapsItem[0]);
|
||||
|
||||
items.add(new LongDescriptionItem(getString(R.string.downloaded_maps_collect_descr)));
|
||||
|
||||
items.add(new SubtitmeListDividerItem(context));
|
||||
|
||||
final BottomSheetItemWithCompoundButton[] visitedScreensItem = new BottomSheetItemWithCompoundButton[1];
|
||||
visitedScreensItem[0] = (BottomSheetItemWithCompoundButton) new BottomSheetItemWithCompoundButton.Builder()
|
||||
.setChecked(sendAnonymousAppUsageData)
|
||||
.setTitle(getString(R.string.visited_screens))
|
||||
.setLayoutId(R.layout.bottom_sheet_item_with_switch_no_icon)
|
||||
.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
boolean checked = !visitedScreensItem[0].isChecked();
|
||||
visitedScreensItem[0].setChecked(checked);
|
||||
sendAnonymousAppUsageData = checked;
|
||||
updateBottomButtons();
|
||||
}
|
||||
})
|
||||
.setTag("visited_screens")
|
||||
.create();
|
||||
items.add(visitedScreensItem[0]);
|
||||
|
||||
items.add(new LongDescriptionItem(getString(R.string.visited_screens_collect_descr)));
|
||||
|
||||
items.add(new DividerItem(context));
|
||||
|
||||
String privacyPolicyText = getString(R.string.shared_string_privacy_policy);
|
||||
String text = getString(R.string.privacy_and_security_change_descr, privacyPolicyText);
|
||||
|
||||
SpannableString spannable = new SpannableString(text);
|
||||
int start = text.indexOf(privacyPolicyText);
|
||||
int end = start + privacyPolicyText.length();
|
||||
spannable.setSpan(new URLSpan(OsmandApplication.OSMAND_PRIVACY_POLICY_URL) {
|
||||
@Override
|
||||
public void updateDrawState(@NonNull TextPaint ds) {
|
||||
super.updateDrawState(ds);
|
||||
ds.setUnderlineText(false);
|
||||
}
|
||||
}, start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
int linkTextColor = ContextCompat.getColor(context, !nightMode ? R.color.ctx_menu_bottom_view_url_color_light : R.color.ctx_menu_bottom_view_url_color_dark);
|
||||
spannable.setSpan(new ForegroundColorSpan(linkTextColor), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
|
||||
LongDescriptionItem descriptionItem = new LongDescriptionItem(spannable);
|
||||
descriptionItem.setDescriptionLinksClickable(true);
|
||||
items.add(descriptionItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isRightBottomButtonEnabled() {
|
||||
return sendAnonymousMapDownloadsData || sendAnonymousAppUsageData;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDismissButtonTextId() {
|
||||
return R.string.shared_string_no_thank_you;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getRightBottomButtonTextId() {
|
||||
return R.string.shared_string_allow;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismissButtonClickAction() {
|
||||
OsmandApplication app = requiredMyApplication();
|
||||
OsmandSettings settings = app.getSettings();
|
||||
settings.SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.set(false);
|
||||
settings.SEND_ANONYMOUS_APP_USAGE_DATA.set(false);
|
||||
settings.SEND_ANONYMOUS_DATA_REQUEST_PROCESSED.set(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRightBottomButtonClick() {
|
||||
OsmandApplication app = requiredMyApplication();
|
||||
OsmandSettings settings = app.getSettings();
|
||||
settings.SEND_ANONYMOUS_MAP_DOWNLOADS_DATA.set(sendAnonymousMapDownloadsData);
|
||||
settings.SEND_ANONYMOUS_APP_USAGE_DATA.set(sendAnonymousAppUsageData);
|
||||
settings.SEND_ANONYMOUS_DATA_REQUEST_PROCESSED.set(true);
|
||||
dismiss();
|
||||
}
|
||||
|
||||
public static boolean shouldShowDialog(@NonNull OsmandApplication app) {
|
||||
OsmandSettings settings = app.getSettings();
|
||||
int requestsCount = settings.SEND_ANONYMOUS_DATA_REQUESTS_COUNT.get();
|
||||
long firstInstalledDays = app.getAppInitializer().getFirstInstalledDays();
|
||||
boolean requestProcessed = settings.SEND_ANONYMOUS_DATA_REQUEST_PROCESSED.get();
|
||||
if (!requestProcessed && firstInstalledDays >= 5 && firstInstalledDays <= 30 && requestsCount < 3) {
|
||||
if (requestsCount == 0) {
|
||||
return true;
|
||||
} else {
|
||||
int numberOfStarts = app.getAppInitializer().getNumberOfStarts();
|
||||
int lastRequestNS = settings.SEND_ANONYMOUS_DATA_LAST_REQUEST_NS.get();
|
||||
return numberOfStarts - lastRequestNS > 2;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void showInstance(@NonNull OsmandApplication app, @NonNull FragmentManager fm) {
|
||||
try {
|
||||
if (fm.findFragmentByTag(SendAnalyticsBottomSheetDialogFragment.TAG) == null) {
|
||||
SendAnalyticsBottomSheetDialogFragment fragment = new SendAnalyticsBottomSheetDialogFragment();
|
||||
fragment.show(fm, SendAnalyticsBottomSheetDialogFragment.TAG);
|
||||
|
||||
OsmandSettings settings = app.getSettings();
|
||||
int numberOfStarts = app.getAppInitializer().getNumberOfStarts();
|
||||
OsmandPreference<Integer> lastRequestNS = settings.SEND_ANONYMOUS_DATA_LAST_REQUEST_NS;
|
||||
if (numberOfStarts != lastRequestNS.get()) {
|
||||
OsmandPreference<Integer> counter = settings.SEND_ANONYMOUS_DATA_REQUESTS_COUNT;
|
||||
counter.set(counter.get() + 1);
|
||||
lastRequestNS.set(numberOfStarts);
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
LOG.error("showInstance", e);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -613,7 +613,7 @@ public class GpxUiHelper {
|
|||
//clear all previously selected files before adding new one
|
||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
||||
if (app != null && app.getSelectedGpxHelper() != null) {
|
||||
app.getSelectedGpxHelper().clearAllGpxFileToShow();
|
||||
app.getSelectedGpxHelper().clearAllGpxFilesToShow(false);
|
||||
}
|
||||
if (app != null && showCurrentGpx && adapter.getItem(0).getSelected()) {
|
||||
currentGPX = app.getSavingTrackHelper().getCurrentGpx();
|
||||
|
|
|
@ -36,7 +36,7 @@ public class ShowHideGpxTracksAction extends QuickAction {
|
|||
final GpxSelectionHelper selectedGpxHelper = activity.getMyApplication()
|
||||
.getSelectedGpxHelper();
|
||||
if (selectedGpxHelper.isShowingAnyGpxFiles()) {
|
||||
selectedGpxHelper.clearAllGpxFileToShow();
|
||||
selectedGpxHelper.clearAllGpxFilesToShow(true);
|
||||
} else {
|
||||
selectedGpxHelper.restoreSelectedGpxFiles();
|
||||
}
|
||||
|
|
|
@ -154,6 +154,11 @@ public class MapRenderRepositories {
|
|||
return prevBmpLocation;
|
||||
}
|
||||
|
||||
public void updateSettings() {
|
||||
prefs = context.getSettings();
|
||||
clearCache();
|
||||
}
|
||||
|
||||
public synchronized void closeConnection(String file) {
|
||||
LinkedHashMap<String, BinaryMapIndexReader> cpfiles = new LinkedHashMap<String, BinaryMapIndexReader>(files);
|
||||
BinaryMapIndexReader bmir = cpfiles.remove(file);
|
||||
|
|
Loading…
Reference in a new issue