diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java index 74dceb13a1..4fb6c9a193 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutePlannerFrontEnd.java @@ -6,7 +6,6 @@ import net.osmand.NativeLibrary; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapIndexReader; -import net.osmand.binary.BinaryMapRouteReaderAdapter; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; @@ -689,15 +688,15 @@ public class RoutePlannerFrontEnd { } } if (ctx.calculationMode == RouteCalculationMode.COMPLEX && routeDirection == null - && maxDistance > ctx.config.DEVIATION_RADIUS * 6) { + && maxDistance > RoutingConfiguration.DEVIATION_RADIUS * 6) { ctx.calculationProgress.totalIterations++; RoutingContext nctx = buildRoutingContext(ctx.config, ctx.nativeLib, ctx.getMaps(), RouteCalculationMode.BASE); nctx.calculationProgress = ctx.calculationProgress; List ls = searchRoute(nctx, start, end, intermediates); - if(ls == null) { + if (ls == null) { return null; } - routeDirection = PrecalculatedRouteDirection.build(ls, ctx.config.DEVIATION_RADIUS, ctx.getRouter().getMaxSpeed()); + routeDirection = PrecalculatedRouteDirection.build(ls, RoutingConfiguration.DEVIATION_RADIUS, ctx.getRouter().getMaxSpeed()); } List res ; if (intermediatesEmpty && ctx.nativeLib != null) { diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java index 232b971f9f..829e061494 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java @@ -20,7 +20,7 @@ import java.util.Stack; public class RoutingConfiguration { public static final int DEFAULT_MEMORY_LIMIT = 30; - public final float DEVIATION_RADIUS = 3000; + public static final float DEVIATION_RADIUS = 3000; public Map attributes = new LinkedHashMap(); // 1. parameters of routing and different tweaks diff --git a/OsmAnd-telegram/res/values-sv/strings.xml b/OsmAnd-telegram/res/values-sv/strings.xml index 7dac55e059..da00c6b618 100644 --- a/OsmAnd-telegram/res/values-sv/strings.xml +++ b/OsmAnd-telegram/res/values-sv/strings.xml @@ -22,7 +22,7 @@ mph km/h m/s - di/h + M/h min/km min/mi di @@ -43,7 +43,7 @@ Delar plats Dela plats Avstånd - OsmAnd Tracker körs i bakgrunden med skärmen av. + OsmAnd Tracker körs i bakgrunden medan skärmen är avstängd. Bakgrundsläge Välj en av platsleverantörerna för att dela din plats. Aktivera \"Plats\" i systeminställningarna diff --git a/OsmAnd/res/layout/abc_list_menu_item_icon.xml b/OsmAnd/res/layout/abc_list_menu_item_icon.xml new file mode 100644 index 0000000000..9706565f6f --- /dev/null +++ b/OsmAnd/res/layout/abc_list_menu_item_icon.xml @@ -0,0 +1,15 @@ + + + diff --git a/OsmAnd/res/layout/fragment_data_storage_place_dialog.xml b/OsmAnd/res/layout/fragment_data_storage_place_dialog.xml index 76ed491f6c..fd88a16090 100644 --- a/OsmAnd/res/layout/fragment_data_storage_place_dialog.xml +++ b/OsmAnd/res/layout/fragment_data_storage_place_dialog.xml @@ -1,232 +1,230 @@ + xmlns:osmand="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:background="?attr/bottom_menu_view_bg" + android:orientation="horizontal" + tools:context="net.osmand.plus.download.ui.DataStoragePlaceDialogFragment"> - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/OsmAnd/res/layout/trip_recording_fragment.xml b/OsmAnd/res/layout/trip_recording_fragment.xml index 449ae3dd5d..d3f1cd81ca 100644 --- a/OsmAnd/res/layout/trip_recording_fragment.xml +++ b/OsmAnd/res/layout/trip_recording_fragment.xml @@ -18,6 +18,7 @@ android:paddingEnd="@dimen/content_padding" android:paddingRight="@dimen/content_padding" android:paddingBottom="@dimen/content_padding" + android:minHeight="@dimen/bottom_sheet_selected_item_title_height" android:weightSum="2"> دراجة نارية سيارة نسخ اسم POI - الرجاء اختيار أنواع أخرى من التلوين + الرجاء اختيار أنواع أخرى من التلوين. سيتم التقاط الرمز إلى مسار التنقل الحالي حدد الجزء %1$s يحتوي على أكثر من مقطع ، تحتاج إلى تحديد الجزء المطلوب للتنقل. @@ -4114,4 +4114,9 @@ لا يحتوي المسار على بيانات السرعة. إخفاء المحميات الطبيعية والمناطق المحمية وحدود المتنزهات الوطنية حدود الطبيعة + إذا تم تعطيله، فسيبدأ التسجيل مباشرة بعد النقر على الويدجيت أو عنصر القائمة ، متخطيا لمربع حوار التأكيد. + الفاصل الزمني للتسجيل يحدد الفترة الزمنية التي سيسأل فيها OsmAnd عن بيانات الموقع الحالي. + سيتم فقدان كافة البيانات غير المحفوظة. + إظهار مربع حوار البدء + حفظ ومتابعة \ No newline at end of file diff --git a/OsmAnd/res/values-bg/strings.xml b/OsmAnd/res/values-bg/strings.xml index 215fbfee06..76af9d718e 100644 --- a/OsmAnd/res/values-bg/strings.xml +++ b/OsmAnd/res/values-bg/strings.xml @@ -2258,4 +2258,20 @@ Абонаментът позволява почасови, ежедневни, седмични актуализации и неограничено изтегляне за всички карти в световен мащаб. Изберете езиците на които Уикипедия публикациите ще се появяват на картата. Можете да превключвате между наличните езици докато четете публикацията. Допълнителни карти + Използване на test.openplacereviews.org + Вход в OpenPlaceПрегледи + OpenPlaceReviews + Вода + Зима + Моторни шейни + Езда + Състезание + Планинско колоездене + Колоездене + Туризъм + Бягане + Ходене + Офроуд + Мотор + Автомобил \ No newline at end of file diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index be9db73a65..7bfe9595bf 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1195,7 +1195,7 @@ Oblíbené body sdílené přes OsmAnd Neplatný formát: %s Prázdný soubor GPX - Všechny trasy + Stopy Oblíbené Moje místa Načítání %1$s… @@ -2174,7 +2174,7 @@ Vyberte složku pro soubor GPX Soubor se nepodařilo přesunout. Přesunout - Trasy + Stopy Doba pohybu Časový rozsah Maximum @@ -2267,7 +2267,7 @@ Váš cíl se nachází v oblasti se soukromým přístupem. Povolit vstup na soukromé pozemky pro tuto cestu? Spustit hledání znovu Zvětšit okruh hledání - Nic nalezeno + Nic nebylo nalezeno Změňte vyhledávací dotaz nebo zvětšete okruh hledání. Oprávnění Nepodařilo se naimportovat soubor. Prosím zkontrolujte, zda má OsmAnd oprávnění ke čtení souboru. @@ -2496,8 +2496,8 @@ Chyba při importu mapy Mapa byla importována Aktuální - Přidá poslední mezizastávku - Přidá první mezizastávku + Přidá poslední mezicíl + Přidá první mezicíl Přesune cíl nahoru a vytvoří ho OsmAnd (OSM Automated Navigation Directions) je mapová a navigační aplikace s přístupem k volným a kvalitním celosvětovým údajům z OpenStreetMap (OSM). \n @@ -2829,7 +2829,7 @@ Hladkost povrchu Strmost Ukázat více - Zobrazené trasy + Zobrazené stopy Denní doba Krok za krokem Typy silnic @@ -3853,7 +3853,7 @@ Východ slunce v %1$s Západ slunce v %1$s %1$s/%2$s - Všechna nastavení profilu obnovena do základního nastavení. + Všechna nastavení profilu obnovena do výchozího stavu. Všechna nastavení modulů obnovena do výchozího stavu. Zobrazit pouze v noci Přidat vlastní kategorii @@ -4045,4 +4045,9 @@ Vyberte prosím jiný typ obarvení. Skrýt hranice přírodních rezervací, chráněných území a národních parků Hranice přírody + Interval záznamu nastaví, jak často bude OsmAnd zjišťovat aktuální polohu. + Uložit a pokračovat + Všechna neuložená data budou ztracena. + Zobrazit úvodní okno + Pokud je vypnuto, záznam začne hned po klepnutí na nástroj nebo položku v menu, přeskočí tedy potvrzovací okno. \ No newline at end of file diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 0f36ffa3b1..4be82a75ce 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -4050,4 +4050,8 @@ Kategorie auswählen oder neue hinzufügen Grenzen von Naturschutzgebieten, Schutzgebieten und Nationalparks ausblenden Grenzen von Schutzgebieten + Speichern und fortfahren + Alle nicht gespeicherten Daten gehen verloren. + Startdialog anzeigen + Wenn deaktiviert, beginnt die Aufnahme direkt nach dem Tippen auf das Widget oder den Menüpunkt und überspringt den Bestätigungsdialog. \ No newline at end of file diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index 178af35973..0eb1180e72 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -4048,4 +4048,6 @@ Agordita periodo de intertempo de registrado, dum kiu OsmAnd petos la nunajn poziciajn datumojn. Ĉiuj nekonservitaj datumoj perdiĝos. Konservi kaj daŭrigi + Se malŝaltita, registrado komenciĝos tuj post frapeto sur la fenestraĵo aŭ menuero, preterlasante la konfirman dialogon. + Montri komencan dialogon \ No newline at end of file diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index 08ecee8769..720dccf045 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -4047,4 +4047,9 @@ Elige otro tipo de color. Fronteras naturales Oculta fronteras de reservas naturales, áreas protegidas y parques nacionales + El intervalo de registro define el período de tiempo en el que OsmAnd pedirá los datos de la ubicación actual. + Guardar y continuar + Se perderán todos los datos no guardados. + Mostrar el diálogo inicial + Si se desactiva, la grabación será iniciada al pulsar el widget o el elemento del menú, saltándose el diálogo de confirmación. \ No newline at end of file diff --git a/OsmAnd/res/values-es-rUS/phrases.xml b/OsmAnd/res/values-es-rUS/phrases.xml index 1eb2e19c0f..db9d0cc849 100644 --- a/OsmAnd/res/values-es-rUS/phrases.xml +++ b/OsmAnd/res/values-es-rUS/phrases.xml @@ -3145,7 +3145,7 @@ Reservación: no Reservación: sólo miembros Camas - Barcos de alquiler + Barcos alquilados Alquiler de barcos Lanchas de motor: sí Lanchas de motor: no diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml index 1669ea5037..fad07e4c5d 100644 --- a/OsmAnd/res/values-es-rUS/strings.xml +++ b/OsmAnd/res/values-es-rUS/strings.xml @@ -4047,4 +4047,9 @@ La traza no contiene datos de altitud. La traza no contiene datos de velocidad. Elige otro tipo de color. + El intervalo de registro define el período de tiempo en el que OsmAnd pedirá los datos de la ubicación actual. + Guardar y continuar + Se perderán todos los datos no guardados. + Mostrar el diálogo inicial + Si se desactiva, la grabación será iniciada al pulsar el widget o el elemento del menú, saltándose el diálogo de confirmación. \ No newline at end of file diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml index 2d0bce8623..5196513604 100644 --- a/OsmAnd/res/values-fa/strings.xml +++ b/OsmAnd/res/values-fa/strings.xml @@ -4069,4 +4069,8 @@ دکمه‌ای برای آشکار یا پنهان کردن ابزارک مختصات روی نقشه. بازه مسافت با لمس + ذخیره و ادامه + نمایش کادر آغاز + اگر غیرفعال باشد، بلافاصله پس از لمس ابزارک یا آیتم منو، ضبط آغاز می‌شود و کادر تأیید ظاهر نمی‌شود. + تمام دادهٔ ذخیره‌نشده از دست خواهد رفت. \ No newline at end of file diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml index 702b8f37e1..5dc5f5fc88 100644 --- a/OsmAnd/res/values-fr/strings.xml +++ b/OsmAnd/res/values-fr/strings.xml @@ -4030,12 +4030,14 @@ Itinéraire court optimisé (plus économe en énergie) Masquer les limites des réserves naturelles, des zones protégées et des parcs nationaux Limites naturelles - %1$s contient plus d\'un segment, vous devez sélectionner le tronçon nécessaire à la navigation. - Sélectionnez le mode de conduite pour avoir l\'itinéraire le plus court, le plus rapide, ou le plus sûr - Appuyer pour afficher ou cacher le widget Coordonnées sur la carte. - L’icône de localisation va se déplacer sur le trajet en cours. - Veuillez sélectionner un autre type de colorisation. + %1$s contient plusieurs segments, vous devez sélectionner un tronçon pour la navigation. + Sélectionnez un mode de conduite pour calculer l\'itinéraire le plus court, le plus rapide ou le plus sûr. + Appuyez pour afficher ou masquer le gadget Coordonnées sur la carte. + L’icône de positionnement se déplacera sur le trajet en cours. + Veuillez sélectionner une autre coloration. L\'intervalle d’enregistrement définit la fréquence à laquelle OsmAnd récupérera les données de localisation. Enregistrer et continuer Toutes les données non enregistrées seront perdues. + Afficher la boîte de dialogue de démarrage + Si désactivé, l\'enregistrement débutera dès appui sur le gadget ou dans le menu (sans demande de confirmation). \ No newline at end of file diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index f42791d9aa..e95128dd82 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -4042,4 +4042,6 @@ A naplózási intervallum az az időköz, amelyben az OsmAnd lekéri az aktuális helyadatokat. Mentés és folytatás Minden nem mentett adat törlődni fog. + Kezdő párbeszéd megjelenítése + Ha le van tiltva, akkor a felvétel közvetlenül a widget vagy a menüelem megérintése után elindul, kihagyva a megerősítő párbeszédpanelt. \ No newline at end of file diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 0b578f99f3..240b7e3156 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -2163,7 +2163,6 @@ Tempo Distanza totale Utilizza dati altitudine - Intervallo di tempo Massimo Ora d\'inizio @@ -3930,4 +3929,112 @@ OpenPlaceReviews Usa test.openplacereviews.org Accedi a OpenPlaceReviews + Inverti tutti i punti + Tempo degli avvisi vocali + Profilo OsmAnd + Profilo utente + Seleziona il profilo, sarà utilizzato all\'avvio dell\'app. + Ultimo utilizzato + Preferisci i percorsi escursionistici + Preferisci i percorsi escursionistici + Aggiungi un motore di navigazione online + Modifica il motore di navigazione online + Sottocategoria + Veicolo + Chiave API + URL del server + Immetti un parametro + "Mantienilo vuoto se non lo fosse" + URL con tutti i parametri saranno come questo: + Prova il calcolo del percorso + Driving + A piedi + Bici + Auto + Copia l\'indirizzo + Motori di navigazione online + Motori di navigazione online + Cartelle + Seleziona una cartella + Seleziona una cartella o aggiungine una nuova + Vuoto + Analizza per intervalli + Carica in OpenStreetMap + Modifica la traccia + Rinomina la traccia + Cambia cartella + sec + Passing + Approach + Long prepare + Preparazione + Fuoristrada + Intervalli di tempo e distanza + Il tempo dell\'annuncio per i diversi avvisi dipende dal tipo di avviso, la velocità attuale e la velocità preimpostata. + Tempo dell\'annuncio + Bici elettrica + Mountain cycling + Bici da corsa + Regular cycling + Piccolo furgone + Leggi tutto + Seleziona segmenti + %1$s contiene più di un segmento, devi selezionare la parte necessaria per la navigazione. + Segmento %1$d + Water + Winter + Gatto delle nevi + Riding + Racing + Mountainbike + Bici + Escursione + Corsa + A piedi + Fuoristrada + Moto + Auto + Utilizza le restrizioni stradali che sono attive attualmente sulla mappa + Percorso più breve ottimizzato (risparmio energia) + Scegli il tipo di guida per ottenere percorsi più brevi, veloci e sicuri + L\'icona della localizzazione attuale sarà incollata al percorso corrente + Non ruotare la visualizzazione della mappa se la velocità è inferiore a un valore + Riavvia + Tutte le regioni + Cancellare %1$d file\? + Ferma senza salvare + Salva e ferma la registrazione + Registrazione della traccia fermata + Confermi di volere fermare la registrazione\? +\nTutti i dati non salvati saranno persi. + In pausa + Il riavvio dell\'app è richiesto per applicare alcune impostazioni. + Il calcolo del percorso può evitare le salite ripide. + Un interruttore per mostrare o nascondere il widget delle coordinate sulla mappa. + Distanza dal tocco + Ultimo aggiornamento OpenStreetMap disponibile: + Aggiornamento: %s + Ultimo controllo: %s + Frequenza di aggiornamento + Gli aggiornamenti della mappa saranno controllati ogni settimana. Il prossimo %1$s in %2$s. + Gli aggiornamenti della mappa saranno controllati ogni giorno. La prossima volta %1$s in %2$s. + Gli aggiornamenti alla mappa saranno controllati ogni ora. Il prossimo alle %1$s in %2$s. + Elimina aggiornamenti + Confermi di voler eliminare tutti %s gli aggiornamenti live\? + Acquisti + Seleziona la categoria o aggiungine una nuova + La registrazione sarà continuata. + Copia il nome del PDI + Mostra/nascondi + Intervallo + Nascondi i confini delle riserve naturali, delle aree protette e dei parchi naturali. + Confini naturali + La traccia non contiene i dati di altitudine. + La traccia non contiene i dati di velocità. + Prego selezionare un altro tipo di colorazione. + "L\'intervallo di registrazione imposta la frequenza con cui OsmAnd chiederà i dati della posizione attuale." + Salva e continua + Tutti i dati non salvati andranno persi. + Mostra la finestra di avvio + Se disabilitato, la registrazione inizierà appena tappato sul widget o sul menu, saltando la finestra di configurazione. \ No newline at end of file diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml index 76006696f9..c320b44aa6 100644 --- a/OsmAnd/res/values-iw/strings.xml +++ b/OsmAnd/res/values-iw/strings.xml @@ -4051,4 +4051,6 @@ הגדרת הפרש קבוע בין הבקשות של OsmAnd לקבלת נתוני המיקום הנוכחיים. לשמור ולהמשיך כל הנתונים שלא נשמרו יאבדו. + להציג חלונית פתיחה + אם האפשרות מושבתת, ההקלטה תתחיל מיד לאחר הנגיעה בווידג׳ט או בפריט שבתפריט תוך דילוג על חלונית האישור. \ No newline at end of file diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index cc3465ea61..9820354ce7 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -3953,4 +3953,85 @@ POIの更新は利用できません ログ記録間隔は、OsmAndが現在の位置データを要求する期間を設定します。 保存して続行 保存されていないデータはすべて失われます。 + OSMメモを閉じる + OSMメモへのコメント + 安全なOAuth方式を使用してログインするか、アプリから直接ログインする方法を選べます。 + 写真の追加 + OpenPlaceReviews.orgに登録 + 写真はOpenPlaceReviews.orgオープンデータプロジェクトを介して提供されています。そのため写真をアップロードするためには前述のウェブサイトにログインする必要があります。 + 新しいアカウントを作成 + 私はすでにアカウントを持っています + 検索履歴 + カヤック + モーターボート + 画像をアップロードできません。しばらくしてからもう一度お試しください + 写真を選択 + リソース + おおよそのファイルサイズ + ファイルとしてエクスポートしたいデータを選択します。 + インポートに必要 + お使いの端末には%1$sしか容量がありません。空き容量を確保するか、エクスポートするアイテムの選択を減らしてください。 + 十分な空き容量がありません + インポートするグループを選択します。 + インポートするアイテムを選択します。 + Mapillaryに追加 + OpenPlaceReviewsに追加 + OsmAndは、いくつかのソースからの写真を表示します: +\nOpenPlaceReviewsはPOIの写真; +\nMapillaryは投稿されたストリート画像; +\nWeb / WikimediaはOpenStreetMapデータのPOIの写真を利用しています。 + この前で分割 + この後で分割 + %1$s * %2$s + 軽飛行機 + セグメントの結合 + 新規セグメントの追加 + OsmAndプロファイル + ユーザープロファイル + • 設定、リソース、お気に入りを含むすべてのデータをエクスポートおよびインポートするオプションを追加 +\n +\n• ルートの計画:ルートを含むトラックセグメントのグラフ、および複数のトラックセグメントを作成および編集する機能を追加 +\n +\n• OpenStreetMapのOAuth認証方法を追加し、OSMダイアログのUIを改善 +\n +\n• お気に入りのカスタムカラーのサポート、経由地点の追跡など +\n +\n + すべての地点を逆転 + アプリ起動時に適用されるプロファイルを選択します。 + 最後に利用 + ハイキング向けのルートを選択します + ハイキングコースを優先 + 小川と排水溝も水路とみなします + 小川と排水溝も許可 + 常に水が流れているわけではない水路も許可 + 常に水の流れがあるわけではない場所も水路として見なします + オンラインルーティングエンジンの追加 + オンラインルーティングエンジンの編集 + サブタイプ + 車両 + APIキー + サーバーURL + パラメーターの入力 + APIキーがない場合は空白のままにします + パラメータを含むURLは次のようになります: + ルート計算のテスト + ドライブ + 徒歩 + 自転車 + + 住所をコピー + オンラインルーティングエンジン + オンラインルーティングエンジン + フォルダー + フォルダーを選択、または新しいフォルダを追加します + フォルダーの選択 + + 分割間隔を分析評価する + OpenStreetMapにアップロード + 経路の編集 + 経路名の変更 + フォルダーの変更 + 開始ダイアログを表示 + 無効にした場合、ウィジェットまたはメニュー項目をタップするとすぐに記録が始まり、確認のダイアログは表示されません。 \ No newline at end of file diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index e8767cf4cf..07c4aef6f7 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -4032,4 +4032,7 @@ De track bevat geen hoogtegegevens. De track bevat geen snelheidsgegevens. Selecteer een ander inkleuring. + Indien uitgeschakeld zal de opname starten na een tik op de widget of het menu-item, waarbij er geen bevestiging zal worden gevraagd. + Opslaan en doorgaan + Niet-opgeslagen gegevens zullen verloren gaan. \ No newline at end of file diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index 1914ba1d48..0c4060b65a 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -4042,4 +4042,7 @@ Segmento %1$d Salvar e continuar Todos os dados não salvos serão perdidos. + O intervalo de registro define o período de tempo no qual OsmAnd solicitará os dados de posição de localização atual. + Mostrar caixa de diálogo inicial + Se desativado, a gravação começará logo após tocar no widget ou item de menu, pulando a caixa de diálogo de confirmação. \ No newline at end of file diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index 1b8e013301..8ed1ef86a1 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -3893,7 +3893,7 @@ Профиль пользователя Профиль OsmAnd Выберите профиль, который будет использоваться при запуске приложения. - Последний раз использовалось + Последний используемый Разрешить прерывистые водные пути Разрешить прерывистые водные пути • Добавлена возможность экспорта и импорта всех данных, включая настройки, ресурсы, мои места. @@ -4043,4 +4043,9 @@ «Частный» означает, что трек не будет виден в любых общедоступных списках, но точки из него будут доступны через public GPS API без отметок времени. Выберите цель, чтобы проложить к ней короткий, быстрый или безопасный маршрут Удалить %1$d файлов\? + Сохранить и продолжить + Все несохраненные данные будут потеряны. + Показывать начальный диалог + Если выключено, запись начнется сразу после нажатия на виджет или пункт меню, пропуская диалоговое окно подтверждения. + Интервал записи трека указывает период времени, через который OsmAnd будет запрашивать данные о текущем местоположении. \ No newline at end of file diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index eacbe24df2..6c12a3f3b0 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -4040,4 +4040,9 @@ Optimalizovaná kratšia trasa (úspora energie) Ikona aktuálnej polohy bude prichytená k navigačnej trase Výpočet trasy sa môže vyhnúť strmým stúpaniam. + Interval zaznamenávania nastaví ako často bude OsmAnd zisťovať aktuálnu polohu. + Uložiť a pokračovať + Všetky neuložené údaje budú stratené. + Zobraziť úvodné okno + Ak je vypnuté, záznam začne hneď po stlačení nástroja alebo položky v menu a preskočí okno nastavenia. \ No newline at end of file diff --git a/OsmAnd/res/values-sv/phrases.xml b/OsmAnd/res/values-sv/phrases.xml index 8546a555f5..e209110762 100644 --- a/OsmAnd/res/values-sv/phrases.xml +++ b/OsmAnd/res/values-sv/phrases.xml @@ -2518,7 +2518,7 @@ Skyddsobjekt: vatten Explosion: land Kärnvapenexplosionplats - "Explosionstyp: underjord, schakcft " + Explosionstyp: underjord, schakt Explosionstyp: underjord, tunnel Explosionstyp: atmosfärisk Explosionstyp: atmosfärisk, airdrop @@ -2550,8 +2550,8 @@ Explosionshöjd Nollnivå-punkt Kroppsvågsmagnitud - "Explosionssalva: första detonationen av ett salvtest" - "Explosionssalva: andra eller senare detonation av ett salvtest" + Explosionssalva: första detonationen av ett salvtest + Explosionssalva: andra eller senare detonation av ett salvtest Explosionssalva: kraterdiameter Explosion: stridsspets Explosion: enhet @@ -2938,7 +2938,7 @@ Koreanskt Medelhavs Bayerskt - "Libanesiskt " + Libanesiskt Ryskt Filippinskt Portugisiskt @@ -2977,12 +2977,12 @@ Afghanskt Belgiskt Baskiskt - "Schweiziskt " + Schweiziskt Kantonesiskt Svenskt Jamaicanskt Armeniskt - "Hawaiianskt " + Hawaiianskt Engelskt Pakistanskt Taiwanesiskt @@ -3329,4 +3329,68 @@ Plats: ute Plats: tak Plats: tak + Uttag: NEMA 5-15R + Blandad: nej + Blandad: ja + Is: nej + Is: ja + \"Multi-pitch\"-väg: nej + \"Multi-pitch\"-väg: ja + Traditionell: nej + Traditionell: ja + Topprep: nej + Topprep: ja + Boldering: nej + Bouldering: ja + Sport: nej + Sport: ja + Postnummer + Pengaöverföring + BEtalningscentral + PLatt + Husnummer + Gata + Brevlåda + Depå + Laddningsstation + Kartstorlek: region + Kartstorlek: stad + Kartstorlek: plats + Karttyp: toposkop + Karttyp: schema + Karttyp: gata + Karttyp: topo + Laddningsstations utgång + Strömstyrka + Parkeringsavgift + Parkeringsavgift: nej + Parkeringsavgift: ja + Lastbil: nej + Lastbil: ja + Scooter: nej + Scooter: ja + Cykel: nej + Cykel: ja + Bil: nej + Bil: ja + Uttag: AS/NZS 3112: utgång + Uttag: AS/NZS 3112: ström + Uttag: AS/NZS 3112 + Uttag: BS 1363: utgång + Uttag: BS 1363: ström + Uttag: BS 1363 + Uttag: Schuko: utgång + Uttag: Schuko: ström + Uttag: Schuko + Uttag: NEMA 14-50: utgång + Uttag: NEMA 14-50: ström + Uttag: NEMA 14-50 + Uttag: NEMA 14-30: ugång + Uttag: NEMA 14-30: ström + Uttag: NEMA 14-30 + Uttag: NEMA 5-20: utgående + Uttag: NEMA 5-20: ström + Uttag: NEMA 5-20 + Uttag: NEMA 5-15R: utgång + Uttag: NEMA 5-15R: ström \ No newline at end of file diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index 262ec98674..6e7fab1d5f 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -4047,4 +4047,6 @@ Інтервал журналювання встановлює проміжок часу, впродовж якого OsmAnd запитуватиме дані про поточне розташування. Зберегти й продовжити Усі незбережені дані буде втрачено. + Показати діалогове вікно запуску + Якщо вимкнено, запис почнеться відразу після торкання до віджета або пункту меню, пропускаючи діалогове вікно підтвердження. \ No newline at end of file diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 4bef29c778..a40440e789 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -4041,4 +4041,6 @@ 紀錄間隔設定的時段,OsmAnd 將會要求目前位置的位置資料。 儲存並繼續 所有未儲存的資料都將會遺失。 + 顯示開始對話框 + 若停用,則在點擊小工具或選單項目後將跳過確認對話框,立刻開始。 \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java index 8db1508454..480e5affa8 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingBottomSheet.java @@ -5,11 +5,13 @@ import android.app.Dialog; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.drawable.Drawable; +import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.view.ViewTreeObserver; import android.widget.CompoundButton; import android.widget.FrameLayout; import android.widget.LinearLayout; @@ -163,7 +165,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl ContextCompat.getColor(app, getActiveTextColorId(nightMode))); CardView cardLeft = itemView.findViewById(R.id.button_left); - createItem(cardLeft, ItemType.CANCEL); + createItem(cardLeft, ItemType.CLOSE); cardLeft.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { @@ -237,15 +239,11 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl } } - public void show() { + public void show(String... keys) { Dialog dialog = getDialog(); if (dialog != null) { dialog.show(); } - } - - public void show(String... keys) { - show(); for (String key : keys) { if (key.equals(UPDATE_TRACK_ICON)) { updateTrackIcon(app, trackAppearanceIcon); @@ -300,6 +298,9 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl AndroidUiHelper.setVisibility(View.GONE, segmentView.findViewById(R.id.list_item_divider)); WrapContentHeightViewPager pager = segmentView.findViewById(R.id.pager); PagerSlidingTabStrip tabLayout = segmentView.findViewById(R.id.sliding_tabs); + tabLayout.setDividerWidth(AndroidUtils.dpToPx(app, 1)); + tabLayout.setDividerColor(ContextCompat.getColor(app, nightMode ? + R.color.stroked_buttons_and_links_outline_dark : R.color.stroked_buttons_and_links_outline_light)); tabLayout.setOnTabReselectedListener(new PagerSlidingTabStrip.OnTabReselectedListener() { @Override public void onTabSelected(int position) { @@ -314,6 +315,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl graphsAdapter = new GPXItemPagerAdapter(app, GpxUiHelper.makeGpxDisplayItem(app, displayHelper.getGpx()), displayHelper, nightMode, this, true); + graphsAdapter.setChartHMargin(getResources().getDimensionPixelSize(R.dimen.content_padding)); pager.setAdapter(graphsAdapter); tabLayout.setViewPager(pager); @@ -453,6 +455,21 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl setItemBackground(context, nightMode, view, enabled); } + public static void createItemActive(Context context, boolean nightMode, View view, ItemType type) { + view.setTag(type); + AppCompatImageView icon = view.findViewById(R.id.icon); + if (icon != null) { + setTintedIconActive(context, icon, nightMode, type); + } + TextView title = view.findViewById(R.id.button_text); + Integer titleId = type.getTitleId(); + if (title != null && titleId != null) { + title.setText(titleId); + setTextColorActive(context, title, nightMode, type); + } + setItemBackgroundActive(context, nightMode, view); + } + public static void setItemBackground(Context context, boolean nightMode, View view, boolean enabled) { if (view instanceof CardView) { int colorId = enabled ? getActiveTransparentColorId(nightMode) : getInactiveButtonColorId(nightMode); @@ -472,6 +489,12 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl view.setBackgroundDrawable(background); } + public static void setItemBackgroundActive(Context context, boolean nightMode, View view) { + if (view instanceof CardView) { + ((CardView) view).setCardBackgroundColor(ContextCompat.getColor(context, getActiveTextColorId(nightMode))); + } + } + public enum ItemType { SHOW_TRACK(R.string.shared_string_show_on_map, null), APPEARANCE(null, null), @@ -486,8 +509,10 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl STOP(R.string.shared_string_control_stop, R.drawable.ic_action_rec_stop), STOP_AND_DISCARD(R.string.track_recording_stop_without_saving, R.drawable.ic_action_rec_stop), STOP_AND_SAVE(R.string.track_recording_save_and_stop, R.drawable.ic_action_save_to_file), - STOP_ONLINE(R.string.live_monitoring_stop, R.drawable.ic_world_globe_dark), + START_ONLINE(R.string.live_monitoring_start, R.drawable.ic_world_globe_dark), + STOP_ONLINE(R.string.live_monitoring_stop, R.drawable.ic_action_offline), CANCEL(R.string.shared_string_cancel, R.drawable.ic_action_close), + CLOSE(R.string.shared_string_close, R.drawable.ic_action_close), START_RECORDING(R.string.shared_string_control_start, R.drawable.ic_action_direction_movement), SETTINGS(R.string.shared_string_settings, R.drawable.ic_action_settings), FINISH(R.string.shared_string_finish, R.drawable.ic_action_point_destination), @@ -497,7 +522,7 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl private final Integer titleId; @DrawableRes private final Integer iconId; - private static final List negative = Arrays.asList(CLEAR_DATA, STOP_AND_DISCARD); + private static final List negative = Arrays.asList(CLEAR_DATA, STOP, STOP_AND_DISCARD); ItemType(@Nullable @StringRes Integer titleId, @Nullable @DrawableRes Integer iconId) { this.titleId = titleId; @@ -528,6 +553,12 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl } } + protected static void setTextColorActive(Context context, TextView tv, boolean nightMode, ItemType type) { + if (tv != null) { + tv.setTextColor(ContextCompat.getColor(context, getPressedColorId(nightMode))); + } + } + protected static void setTintedIcon(Context context, AppCompatImageView iv, boolean enabled, boolean nightMode, ItemType type) { Integer iconId = type.getIconId(); if (iv != null && iconId != null) { @@ -550,6 +581,17 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl } } + protected static void setTintedIconActive(Context context, AppCompatImageView iv, boolean nightMode, ItemType type) { + Integer iconId = type.getIconId(); + if (iv != null && iconId != null) { + Drawable icon = AppCompatResources.getDrawable(context, iconId); + if (icon != null) { + DrawableCompat.setTint(icon, ContextCompat.getColor(context, getPressedColorId(nightMode))); + } + iv.setImageDrawable(icon); + } + } + @Override public void onPointSelected(TrkSegment segment, double lat, double lon) { if (trackChartPoints == null) { @@ -649,6 +691,36 @@ public class TripRecordingBottomSheet extends MenuBottomSheetDialogFragment impl return nightMode ? R.drawable.btn_background_inactive_dark : R.drawable.btn_background_inactive_light; } + @Override + protected void setupHeightAndBackground(final View mainView) { + final Activity activity = getActivity(); + if (activity == null) { + return; + } + if (AndroidUiHelper.isOrientationPortrait(activity)) { + super.setupHeightAndBackground(mainView); + return; + } + + mainView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { + @Override + public void onGlobalLayout() { + ViewTreeObserver obs = mainView.getViewTreeObserver(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + obs.removeOnGlobalLayoutListener(this); + } else { + obs.removeGlobalOnLayoutListener(this); + } + final View contentView = mainView.findViewById(R.id.scroll_view); + contentView.getLayoutParams().height = ViewGroup.LayoutParams.MATCH_PARENT; + contentView.requestLayout(); + boolean showTopShadow = AndroidUtils.getScreenHeight(activity) - AndroidUtils.getStatusBarHeight(activity) + - mainView.getHeight() >= AndroidUtils.dpToPx(activity, 8); + drawTopShadow(showTopShadow); + } + }); + } + @Override protected boolean hideButtonsContainer() { return true; diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingDiscardBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingDiscardBottomSheet.java index 70414eab5e..cff99d9daa 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingDiscardBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingDiscardBottomSheet.java @@ -42,13 +42,13 @@ public class TripRecordingDiscardBottomSheet extends MenuBottomSheetDialogFragme LayoutInflater inflater = UiUtilities.getInflater(app, nightMode); int verticalBig = getResources().getDimensionPixelSize(R.dimen.dialog_content_margin); int verticalNormal = getResources().getDimensionPixelSize(R.dimen.content_padding); - final View buttonDiscard = createItem(inflater, ItemType.STOP_AND_DISCARD); + final View buttonDiscard = createItem(inflater, ItemType.STOP); final View buttonCancel = createItem(inflater, ItemType.CANCEL); items.add(new BottomSheetItemWithDescription.Builder() .setDescription(getString(R.string.track_recording_description)) .setDescriptionColorId(getPrimaryTextColorId(nightMode)) - .setTitle(app.getString(R.string.track_recording_title)) + .setTitle(app.getString(R.string.track_recording_stop_without_saving)) .setLayoutId(R.layout.bottom_sheet_item_title_with_description) .create()); diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingOptionsBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingOptionsBottomSheet.java index ac42775bd2..994b3034d9 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingOptionsBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingOptionsBottomSheet.java @@ -51,8 +51,6 @@ public class TripRecordingOptionsBottomSheet extends MenuBottomSheetDialogFragme private SelectedGpxFile selectedGpxFile; private final Handler handler = new Handler(); private Runnable updatingTimeTrackSaved; - private int indexButtonOnline = -1; - private int indexButtonOnlineDivider = -1; private GPXFile getGPXFile() { return selectedGpxFile.getGpxFile(); @@ -91,7 +89,8 @@ public class TripRecordingOptionsBottomSheet extends MenuBottomSheetDialogFragme buttonClear = createItem(inflater, ItemType.CLEAR_DATA, hasDataToSave()); final View buttonDiscard = createItem(inflater, ItemType.STOP_AND_DISCARD); - final View buttonOnline = createItem(inflater, ItemType.STOP_ONLINE, hasDataToSave()); + final View buttonOnline = createItem(inflater, settings.LIVE_MONITORING.get() + ? ItemType.STOP_ONLINE : ItemType.START_ONLINE); buttonSave = createItem(inflater, ItemType.SAVE, hasDataToSave()); final View buttonSegment = createItem(inflater, ItemType.START_NEW_SEGMENT, wasTrackMonitored()); @@ -131,27 +130,19 @@ public class TripRecordingOptionsBottomSheet extends MenuBottomSheetDialogFragme items.add(new DividerSpaceItem(app, dp36)); - if (app.getLiveMonitoringHelper().isLiveMonitoringEnabled()) { - items.add(new BaseBottomSheetItem.Builder() - .setCustomView(buttonOnline) - .setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - settings.LIVE_MONITORING.set(false); - if (indexButtonOnline != -1) { - AndroidUiHelper.updateVisibility(items.get(indexButtonOnline).getView(), false); - } - if (indexButtonOnlineDivider != -1) { - AndroidUiHelper.updateVisibility(items.get(indexButtonOnlineDivider).getView(), false); - } - } - }) - .create()); - indexButtonOnline = items.size() - 1; + items.add(new BaseBottomSheetItem.Builder() + .setCustomView(buttonOnline) + .setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + boolean wasOnlineMonitored = !settings.LIVE_MONITORING.get(); + settings.LIVE_MONITORING.set(wasOnlineMonitored); + createItem(buttonOnline, wasOnlineMonitored ? ItemType.STOP_ONLINE : ItemType.START_ONLINE); + } + }) + .create()); - items.add(new DividerSpaceItem(app, dp36)); - indexButtonOnlineDivider = items.size() - 1; - } + items.add(new DividerSpaceItem(app, dp36)); items.add(new BaseBottomSheetItem.Builder() .setCustomView(buttonSave) @@ -181,17 +172,12 @@ public class TripRecordingOptionsBottomSheet extends MenuBottomSheetDialogFragme .create()); items.add(new DividerSpaceItem(app, getResources().getDimensionPixelSize(R.dimen.content_padding_small))); - } @Override public void onResume() { super.onResume(); runUpdatingTimeTrackSaved(); - Fragment target = getTargetFragment(); - if (target instanceof TripRecordingBottomSheet) { - ((TripRecordingBottomSheet) target).hide(); - } } @Override @@ -243,6 +229,10 @@ public class TripRecordingOptionsBottomSheet extends MenuBottomSheetDialogFragme } } + private void createItem(View view, ItemType type) { + TripRecordingBottomSheet.createItem(app, nightMode, view, type, true, null); + } + private View createItem(LayoutInflater inflater, ItemType type, boolean enabled) { return TripRecordingBottomSheet.createItem(app, nightMode, inflater, type, enabled, null); } diff --git a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingStartingBottomSheet.java b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingStartingBottomSheet.java index e45f792514..17d472a489 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingStartingBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/TripRecordingStartingBottomSheet.java @@ -35,6 +35,7 @@ import net.osmand.plus.settings.fragments.BaseSettingsFragment.SettingsScreenTyp import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS; +import static net.osmand.plus.monitoring.TripRecordingBottomSheet.createItemActive; import static net.osmand.plus.monitoring.TripRecordingBottomSheet.createItem; import static net.osmand.plus.monitoring.TripRecordingBottomSheet.createShowTrackItem; import static net.osmand.plus.monitoring.TripRecordingBottomSheet.updateTrackIcon; @@ -123,7 +124,7 @@ public class TripRecordingStartingBottomSheet extends MenuBottomSheetDialogFragm }); CardView cardCenter = itemView.findViewById(R.id.button_center); - createItem(app, nightMode, cardCenter, ItemType.START_RECORDING, true, null); + createItemActive(app, nightMode, cardCenter, ItemType.START_RECORDING); cardCenter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/myplaces/GPXItemPagerAdapter.java b/OsmAnd/src/net/osmand/plus/myplaces/GPXItemPagerAdapter.java index b8899dd9c7..34232a8c6d 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/GPXItemPagerAdapter.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/GPXItemPagerAdapter.java @@ -24,6 +24,7 @@ import com.github.mikephil.charting.listener.ChartTouchListener.ChartGesture; import com.github.mikephil.charting.listener.OnChartGestureListener; import com.github.mikephil.charting.listener.OnChartValueSelectedListener; +import net.osmand.AndroidUtils; import net.osmand.GPXUtilities; import net.osmand.GPXUtilities.GPXFile; import net.osmand.GPXUtilities.GPXTrackAnalysis; @@ -82,6 +83,11 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid private boolean chartClicked; private boolean nightMode; private boolean onlyGraphs; + private int chartHMargin = 0; + + public void setChartHMargin(int chartHMargin) { + this.chartHMargin = chartHMargin; + } public GPXItemPagerAdapter(@NonNull OsmandApplication app, @NonNull GpxDisplayItem gpxItem, @@ -201,6 +207,8 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid if (gpxFile != null && gpxItem != null) { GPXTrackAnalysis analysis = gpxItem.analysis; LineChart chart = view.findViewById(R.id.chart); + ViewGroup.MarginLayoutParams lp = (ViewGroup.MarginLayoutParams) chart.getLayoutParams(); + AndroidUtils.setMargins(lp, chartHMargin, lp.topMargin, chartHMargin, lp.bottomMargin); setupChart(view, chart); switch (tabType) { @@ -436,8 +444,8 @@ public class GPXItemPagerAdapter extends PagerAdapter implements CustomTabProvid view.findViewById(R.id.list_divider).setVisibility(View.GONE); view.findViewById(R.id.bottom_line_blocks).setVisibility(View.GONE); } - updateJoinGapsInfo(view, position); if (!onlyGraphs) { + updateJoinGapsInfo(view, position); view.findViewById(R.id.analyze_on_map).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { diff --git a/OsmAnd/src/net/osmand/plus/myplaces/SegmentGPXAdapter.java b/OsmAnd/src/net/osmand/plus/myplaces/SegmentGPXAdapter.java index ac45fc1294..91f67afd22 100644 --- a/OsmAnd/src/net/osmand/plus/myplaces/SegmentGPXAdapter.java +++ b/OsmAnd/src/net/osmand/plus/myplaces/SegmentGPXAdapter.java @@ -6,6 +6,7 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import androidx.annotation.NonNull; +import androidx.core.content.ContextCompat; import net.osmand.AndroidUtils; import net.osmand.plus.GpxSelectionHelper.GpxDisplayItem; diff --git a/OsmAnd/src/net/osmand/plus/quickaction/CreateEditActionDialog.java b/OsmAnd/src/net/osmand/plus/quickaction/CreateEditActionDialog.java index 819c0b9b77..84a3f7edbe 100644 --- a/OsmAnd/src/net/osmand/plus/quickaction/CreateEditActionDialog.java +++ b/OsmAnd/src/net/osmand/plus/quickaction/CreateEditActionDialog.java @@ -222,15 +222,16 @@ public class CreateEditActionDialog extends DialogFragment if (savedInstanceState == null) { String name = action.getName(getContext()); - if (action.getActionNameRes() != 0) { + if (!action.isActionEditable() && action.getActionNameRes() != 0 + && !name.contains(getString(action.getActionNameRes()))) { String actionName = getString(action.getActionNameRes()); nameEditText.setText(getString(R.string.ltr_or_rtl_combine_via_dash, actionName, name)); } else { nameEditText.setText(name); } } else { - action.setName(nameEditText.getText().toString()); - } + action.setName(nameEditText.getText().toString()); + } image.setImageResource(action.getIconRes(getApplication())); } diff --git a/OsmAnd/src/net/osmand/plus/routing/RouteLineDrawInfo.java b/OsmAnd/src/net/osmand/plus/routing/RouteLineDrawInfo.java index 92cb926fa1..838e553b5b 100644 --- a/OsmAnd/src/net/osmand/plus/routing/RouteLineDrawInfo.java +++ b/OsmAnd/src/net/osmand/plus/routing/RouteLineDrawInfo.java @@ -10,17 +10,20 @@ import net.osmand.util.Algorithms; public class RouteLineDrawInfo { - private static final String LINE_COLOR = "line_color"; + private static final String LINE_COLOR_DAY = "line_color_day"; + private static final String LINE_COLOR_NIGHT = "line_color_night"; private static final String LINE_WIDTH = "line_width"; private static final String NAVIGATION_ICON_ID = "navigation_icon_id"; private static final String NAVIGATION_ICON_COLOR = "navigation_icon_color"; private static final String CENTER_X = "center_x"; private static final String CENTER_Y = "center_y"; private static final String SCREEN_HEIGHT = "screen_height"; + private static final String USE_DEFAULT_COLOR = "use_default_color"; // parameters to save @ColorInt - private Integer color; + private Integer colorDay; + private Integer colorNight; private String width; // temporally parameters to show in preview @@ -30,10 +33,13 @@ public class RouteLineDrawInfo { private int centerX; private int centerY; private int screenHeight; + private boolean useDefaultColor; - public RouteLineDrawInfo(@Nullable @ColorInt Integer color, + public RouteLineDrawInfo(@Nullable @ColorInt Integer colorDay, + @Nullable @ColorInt Integer colorNight, @Nullable String width) { - this.color = color; + this.colorDay = colorDay; + this.colorNight = colorNight; this.width = width; } @@ -42,17 +48,27 @@ public class RouteLineDrawInfo { } public RouteLineDrawInfo(@NonNull RouteLineDrawInfo existed) { - this.color = existed.color; + this.colorDay = existed.colorDay; + this.colorNight = existed.colorNight; this.width = existed.width; this.iconId = existed.iconId; this.iconColor = existed.iconColor; this.centerX = existed.centerX; this.centerY = existed.centerY; this.screenHeight = existed.screenHeight; + this.useDefaultColor = existed.useDefaultColor; } - public void setColor(@Nullable Integer color) { - this.color = color; + public void setColor(@ColorInt int color, boolean nightMode) { + if (nightMode) { + colorNight = color; + } else { + colorDay = color; + } + } + + public void setUseDefaultColor(boolean useDefaultColor) { + this.useDefaultColor = useDefaultColor; } public void setWidth(@Nullable String width) { @@ -80,8 +96,16 @@ public class RouteLineDrawInfo { } @Nullable - public Integer getColor() { - return color; + public Integer getColor(boolean nightMode) { + if (!useDefaultColor) { + return getColorIgnoreDefault(nightMode); + } + return null; + } + + @Nullable + public Integer getColorIgnoreDefault(boolean nightMode) { + return nightMode ? colorNight : colorDay; } @Nullable @@ -111,8 +135,11 @@ public class RouteLineDrawInfo { } private void readBundle(@NonNull Bundle bundle) { - if (bundle.containsKey(LINE_COLOR)) { - color = bundle.getInt(LINE_COLOR); + if (bundle.containsKey(LINE_COLOR_DAY)) { + colorDay = bundle.getInt(LINE_COLOR_DAY); + } + if (bundle.containsKey(LINE_COLOR_NIGHT)) { + colorNight = bundle.getInt(LINE_COLOR_NIGHT); } width = bundle.getString(LINE_WIDTH); iconId = bundle.getInt(NAVIGATION_ICON_ID); @@ -120,11 +147,15 @@ public class RouteLineDrawInfo { centerX = bundle.getInt(CENTER_X); centerY = bundle.getInt(CENTER_Y); screenHeight = bundle.getInt(SCREEN_HEIGHT); + useDefaultColor = bundle.getBoolean(USE_DEFAULT_COLOR); } public void saveToBundle(@NonNull Bundle bundle) { - if (color != null) { - bundle.putInt(LINE_COLOR, color); + if (colorDay != null) { + bundle.putInt(LINE_COLOR_DAY, colorDay); + } + if (colorNight != null) { + bundle.putInt(LINE_COLOR_NIGHT, colorNight); } if (width != null) { bundle.putString(LINE_WIDTH, width); @@ -134,6 +165,7 @@ public class RouteLineDrawInfo { bundle.putInt(CENTER_X, centerX); bundle.putInt(CENTER_Y, centerY); bundle.putInt(SCREEN_HEIGHT, screenHeight); + bundle.putBoolean(USE_DEFAULT_COLOR, useDefaultColor); } @Override @@ -143,13 +175,15 @@ public class RouteLineDrawInfo { RouteLineDrawInfo that = (RouteLineDrawInfo) o; - if (!Algorithms.objectEquals(getColor(), that.getColor())) return false; - return Algorithms.objectEquals(getWidth(), that.getWidth()); + if (!Algorithms.objectEquals(colorDay, that.colorDay)) return false; + if (!Algorithms.objectEquals(colorNight, that.colorNight)) return false; + return Algorithms.objectEquals(width, that.width); } @Override public int hashCode() { - int result = color != null ? color.hashCode() : 0; + int result = colorDay != null ? colorDay.hashCode() : 0; + result = 31 * result + (colorNight != null ? colorNight.hashCode() : 0); result = 31 * result + (width != null ? width.hashCode() : 0); return result; } diff --git a/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineColorCard.java b/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineColorCard.java index 3eabe283e3..d8abad16e4 100644 --- a/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineColorCard.java +++ b/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineColorCard.java @@ -10,6 +10,7 @@ import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import androidx.appcompat.content.res.AppCompatResources; import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; @@ -22,7 +23,6 @@ import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.ColorDialogs; import net.osmand.plus.helpers.enums.DayNightMode; -import net.osmand.plus.render.RendererRegistry; import net.osmand.plus.routepreparationmenu.cards.BaseCard; import net.osmand.plus.routepreparationmenu.cards.BaseCard.CardListener; import net.osmand.plus.routing.RouteLineDrawInfo; @@ -110,7 +110,7 @@ public class RouteLineColorCard extends BaseCard implements CardListener, ColorP } private void initSelectedMode() { - selectedMode = routeLineDrawInfo.getColor() == null ? ColorMode.DEFAULT : ColorMode.CUSTOM; + selectedMode = getRouteLineColor() == null ? ColorMode.DEFAULT : ColorMode.CUSTOM; modeChanged(); } @@ -118,13 +118,15 @@ public class RouteLineColorCard extends BaseCard implements CardListener, ColorP if (selectedMode == ColorMode.DEFAULT) { themeToggleContainer.setVisibility(View.GONE); cardsContainer.setVisibility(View.GONE); + routeLineDrawInfo.setUseDefaultColor(true); changeMapTheme(initMapTheme); } else { themeToggleContainer.setVisibility(View.VISIBLE); cardsContainer.setVisibility(View.VISIBLE); + routeLineDrawInfo.setUseDefaultColor(false); changeMapTheme(isNightMap() ? DayNightMode.NIGHT : DayNightMode.DAY); } - updateSelectedColor(); + updateColorItems(); updateDescription(); } @@ -156,6 +158,12 @@ public class RouteLineColorCard extends BaseCard implements CardListener, ColorP if (targetFragment instanceof OnMapThemeUpdateListener) { ((OnMapThemeUpdateListener) targetFragment).onMapThemeUpdated(mapTheme); } + if (selectedMode == ColorMode.CUSTOM) { + Integer color = getRouteLineColor(); + if (color != null) { + colorsCard.setSelectedColor(color); + } + } } private void createColorSelector(ViewGroup container) { @@ -165,14 +173,9 @@ public class RouteLineColorCard extends BaseCard implements CardListener, ColorP for (int color : ColorDialogs.pallette) { colors.add(color); } - Integer selectedColor = routeLineDrawInfo.getColor(); - if (selectedColor != null) { - if (!ColorDialogs.isPaletteColor(selectedColor)) { - colors.add(selectedColor); - } - } else { - selectedColor = colors.get(0); - } + int selectedColorDay = getSelectedColorForTheme(colors, false); + int selectedColorNight = getSelectedColorForTheme(colors, true); + int selectedColor = isNightMap() ? selectedColorNight : selectedColorDay; ListStringPreference preference = app.getSettings().CUSTOM_ROUTE_LINE_COLORS; colorsCard = new ColorsCard(mapActivity, selectedColor, targetFragment, colors, preference, null); colorsCard.setListener(this); @@ -180,26 +183,49 @@ public class RouteLineColorCard extends BaseCard implements CardListener, ColorP } } + private int getSelectedColorForTheme(List colors, boolean nightMode) { + Integer color = routeLineDrawInfo.getColorIgnoreDefault(nightMode); + if (color != null) { + if (!ColorDialogs.isPaletteColor(color)) { + colors.add(color); + } + } else { + color = colors.get(0); + routeLineDrawInfo.setUseDefaultColor(true); + routeLineDrawInfo.setColor(color, nightMode); + } + return color; + } + @Override public void onColorSelected(Integer prevColor, int newColor) { colorsCard.onColorSelected(prevColor, newColor); updateSelectedColor(); } + @Nullable + private Integer getRouteLineColor() { + return routeLineDrawInfo.getColor(isNightMap()); + } + private void updateSelectedColor() { - Integer color = selectedMode == ColorMode.CUSTOM ? colorsCard.getSelectedColor() : null; - routeLineDrawInfo.setColor(color); - updateColorName(); + int selectedColor = colorsCard.getSelectedColor(); + routeLineDrawInfo.setColor(selectedColor, isNightMap()); + updateColorItems(); + } + + private void updateColorItems() { if (targetFragment instanceof OnSelectedColorChangeListener) { ((OnSelectedColorChangeListener) targetFragment).onSelectedColorChanged(); } + updateColorName(); } private void updateColorName() { if (selectedMode == ColorMode.DEFAULT) { tvColorName.setText(app.getString(R.string.map_widget_renderer)); - } else if (routeLineDrawInfo.getColor() != null) { - int colorNameId = ColorDialogs.getColorName(routeLineDrawInfo.getColor()); + } else if (getRouteLineColor() != null) { + int colorNameId = ColorDialogs.getColorName(getRouteLineColor()); tvColorName.setText(app.getString(colorNameId)); } } diff --git a/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineWidthCard.java b/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineWidthCard.java index 95c20783a4..72055da936 100644 --- a/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineWidthCard.java +++ b/OsmAnd/src/net/osmand/plus/routing/cards/RouteLineWidthCard.java @@ -24,7 +24,6 @@ import net.osmand.plus.R; import net.osmand.plus.UiUtilities; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.helpers.AndroidUiHelper; -import net.osmand.plus.render.RendererRegistry; import net.osmand.plus.routepreparationmenu.cards.BaseCard; import net.osmand.plus.routing.RouteLineDrawInfo; import net.osmand.plus.track.AppearanceViewHolder; @@ -201,6 +200,10 @@ public class RouteLineWidthCard extends BaseCard { return WidthMode.DEFAULT; } + private boolean isNightMode() { + return app.getDaynightHelper().isNightModeForMapControls(); + } + private class WidthAdapter extends RecyclerView.Adapter { private final List items = Arrays.asList(WidthMode.values()); @@ -268,13 +271,9 @@ public class RouteLineWidthCard extends BaseCard { } private int getIconColor(@NonNull WidthMode mode, @ColorInt int defaultColor) { - return mode.widthKey != null ? getRouteLineColor() : defaultColor; - } - - private int getRouteLineColor() { - Integer color = routeLineDrawInfo.getColor(); - return color != null ? color : - mapActivity.getMapLayers().getRouteLayer().getRouteLineColor(nightMode); + return mode.widthKey != null ? + mapActivity.getMapLayers().getRouteLayer().getRouteLineColor(isNightMode()) : + defaultColor; } private void updateButtonBg(AppearanceViewHolder holder, WidthMode item) { diff --git a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java index 5fbc34e674..d1cd8fd622 100644 --- a/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/settings/backend/OsmandSettings.java @@ -2691,8 +2691,10 @@ public class OsmandSettings { public final CommonPreference ROUTE_RECALCULATION_DISTANCE = new FloatPreference(this, "routing_recalc_distance", 0.f).makeProfile(); public final CommonPreference ROUTE_STRAIGHT_ANGLE = new FloatPreference(this, "routing_straight_angle", 30.f).makeProfile(); + public final ListStringPreference CUSTOM_ROUTE_LINE_COLORS = (ListStringPreference) new ListStringPreference(this, "custom_route_line_colors", null, ",").makeShared().makeGlobal(); - public final CommonPreference ROUTE_LINE_COLOR = new IntPreference(this, "route_line_color", 0).makeProfile(); + public final CommonPreference ROUTE_LINE_COLOR_DAY = new IntPreference(this, "route_line_color", 0).cache().makeProfile(); + public final CommonPreference ROUTE_LINE_COLOR_NIGHT = new IntPreference(this, "route_line_color_night", 0).cache().makeProfile(); public final CommonPreference ROUTE_LINE_WIDTH = new StringPreference(this, "route_line_width", null).makeProfile(); public final OsmandPreference USE_OSM_LIVE_FOR_ROUTING = new BooleanPreference(this, "enable_osmc_routing", true).makeProfile(); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java index f4b38a32b8..c8d600315c 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/ProfileAppearanceFragment.java @@ -1019,23 +1019,35 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment implements O } private RouteLineDrawInfo createRouteLineDrawInfo(@NonNull ApplicationMode appMode) { - int storedValue = settings.ROUTE_LINE_COLOR.getModeValue(appMode); - Integer color = storedValue != 0 ? storedValue : null; + Integer colorDay = getRouteLineColor(appMode, settings.ROUTE_LINE_COLOR_DAY); + Integer colorNight = getRouteLineColor(appMode, settings.ROUTE_LINE_COLOR_NIGHT); String widthKey = settings.ROUTE_LINE_WIDTH.getModeValue(appMode); - return new RouteLineDrawInfo(color, widthKey); + return new RouteLineDrawInfo(colorDay, colorNight, widthKey); + } + + private Integer getRouteLineColor(@NonNull ApplicationMode appMode, + @NonNull CommonPreference preference) { + int storedValue = preference.getModeValue(appMode); + return storedValue != 0 ? storedValue : null; } private void saveRouteLineAppearance(@NonNull ApplicationMode appMode, @NonNull RouteLineDrawInfo drawInfo) { - Integer color = drawInfo.getColor(); - if (color != null) { - settings.ROUTE_LINE_COLOR.setModeValue(appMode, color); - } else { - settings.ROUTE_LINE_COLOR.resetModeToDefault(appMode); - } + saveRouteLineColor(appMode, settings.ROUTE_LINE_COLOR_DAY, drawInfo.getColor(false)); + saveRouteLineColor(appMode, settings.ROUTE_LINE_COLOR_NIGHT, drawInfo.getColor(true)); settings.ROUTE_LINE_WIDTH.setModeValue(appMode, drawInfo.getWidth()); } + private void saveRouteLineColor(@NonNull ApplicationMode appMode, + @NonNull CommonPreference preference, + @Nullable @ColorInt Integer color) { + if (color != null) { + preference.setModeValue(appMode, color); + } else { + preference.resetModeToDefault(appMode); + } + } + public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType, @Nullable String appMode, boolean imported) { try { Fragment fragment = Fragment.instantiate(activity, screenType.fragmentName); diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java index b0587eacde..2975815bb4 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/RouteLineAppearanceFragment.java @@ -385,6 +385,10 @@ public class RouteLineAppearanceFragment extends ContextMenuScrollFragment imple @Override public void onSelectedColorChanged() { + updateColorItems(); + } + + private void updateColorItems() { if (widthCard != null) { widthCard.updateItems(); } @@ -415,6 +419,7 @@ public class RouteLineAppearanceFragment extends ContextMenuScrollFragment imple @Override public void onMapThemeUpdated(@NonNull DayNightMode mapTheme) { changeMapTheme(mapTheme); + updateColorItems(); } private void changeMapTheme(@NonNull DayNightMode mapTheme) { diff --git a/OsmAnd/src/net/osmand/plus/track/ColorsCard.java b/OsmAnd/src/net/osmand/plus/track/ColorsCard.java index 7651775f6c..dd832da27f 100644 --- a/OsmAnd/src/net/osmand/plus/track/ColorsCard.java +++ b/OsmAnd/src/net/osmand/plus/track/ColorsCard.java @@ -72,6 +72,7 @@ public class ColorsCard extends BaseCard implements ColorPickerListener { public void setSelectedColor(int selectedColor) { this.selectedColor = selectedColor; + updateContent(); } @Override diff --git a/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java b/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java index f79ac0c6b5..bdb936f8ba 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/PagerSlidingTabStrip.java @@ -129,7 +129,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { private int dividerWidth = 0; - private int dividerPadding = 0; @ColorInt private int dividerColor; @@ -183,7 +182,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { scrollOffset = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, scrollOffset, dm); indicatorHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, indicatorHeight, dm); underlineHeight = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, underlineHeight, dm); - dividerPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerPadding, dm); tabPadding = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, tabPadding, dm); dividerWidth = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dividerWidth, dm); tabTextSize = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, tabTextSize, dm); @@ -214,7 +212,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { dividerWidth = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsDividerWidth, dividerWidth); indicatorHeight = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsIndicatorHeight, indicatorHeight); underlineHeight = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsUnderlineHeight, underlineHeight); - dividerPadding = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsDividerPadding, dividerPadding); tabPadding = a.getDimensionPixelSize(R.styleable.PagerSlidingTabStrip_pstsTabPaddingLeftRight, tabPadding); tabBackgroundResId = a.getResourceId(R.styleable.PagerSlidingTabStrip_pstsTabBackground, tabBackgroundResId); indicatorBgColor = a.getColor(R.styleable.PagerSlidingTabStrip_pstsTabBackground, Color.TRANSPARENT); @@ -485,7 +482,7 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { dividerPaint.setColor(dividerColor); for (int i = 0; i < tabCount - 1; i++) { View tab = tabsContainer.getChildAt(i); - canvas.drawLine(tab.getRight(), dividerPadding, tab.getRight(), height - dividerPadding, dividerPaint); + canvas.drawLine(tab.getRight(), tabsContainer.getTop(), tab.getRight(), tabsContainer.getBottom(), dividerPaint); } } } @@ -720,10 +717,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { return underlineHeight; } - public int getDividerPadding() { - return dividerPadding; - } - public int getScrollOffset() { return scrollOffset; } @@ -826,11 +819,6 @@ public class PagerSlidingTabStrip extends HorizontalScrollView { invalidate(); } - public void setDividerPadding(int dividerPaddingPx) { - this.dividerPadding = dividerPaddingPx; - invalidate(); - } - public void setScrollOffset(int scrollOffsetPx) { this.scrollOffset = scrollOffsetPx; invalidate(); diff --git a/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java b/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java index 2a432c8041..d7393b2cc9 100644 --- a/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/layers/RouteLayer.java @@ -42,6 +42,7 @@ import net.osmand.plus.routing.RouteLineDrawInfo; import net.osmand.plus.routing.RouteService; import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.TransportRoutingHelper; +import net.osmand.plus.settings.backend.CommonPreference; import net.osmand.plus.views.OsmandMapLayer; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.layers.geometry.PublicTransportGeometryWay; @@ -315,14 +316,16 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont QuadPoint c = tileBox.getCenterPixelPoint(); canvas.rotate(-angle, c.x, c.y); - drawRouteLinePreview(canvas, tileBox, routeLineDrawInfo); + drawRouteLinePreview(canvas, tileBox, settings, routeLineDrawInfo); canvas.rotate(angle, c.x, c.y); } } private void drawRouteLinePreview(Canvas canvas, RotatedTileBox tileBox, + DrawSettings settings, RouteLineDrawInfo drawInfo) { + updateAttrs(settings, tileBox); paintRouteLinePreview.setColor(getRouteLineColor(nightMode)); paintRouteLinePreview.setStrokeWidth(getRouteLineWidth(tileBox)); @@ -417,12 +420,14 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont public int getRouteLineColor(boolean night) { Integer color; if (routeLineDrawInfo != null) { - color = routeLineDrawInfo.getColor(); + color = routeLineDrawInfo.getColor(night); } else { - int storedValue = view.getSettings().ROUTE_LINE_COLOR.getModeValue(helper.getAppMode()); + CommonPreference colorPreference = night ? + view.getSettings().ROUTE_LINE_COLOR_NIGHT : + view.getSettings().ROUTE_LINE_COLOR_DAY; + int storedValue = colorPreference.getModeValue(helper.getAppMode()); color = storedValue != 0 ? storedValue : null; } - if (color == null) { updateAttrs(new DrawSettings(night), view.getCurrentRotatedTileBox()); color = attrs.paint.getColor();