diff --git a/OsmAnd-telegram/res/values-it/strings.xml b/OsmAnd-telegram/res/values-it/strings.xml
index 6d1e62edc7..44afa34bce 100644
--- a/OsmAnd-telegram/res/values-it/strings.xml
+++ b/OsmAnd-telegram/res/values-it/strings.xml
@@ -269,4 +269,8 @@
Logcat buffer
Invia rapporto
Esporta
+ Specifica l\'unità di misura della velocità.
+ Seleziona il fuso orario da mostrare nei messaggi sulla posizione.
+ Tempo di scadenza del buffer
+ Tempo massimo per memorizzare i punti nel buffer
\ No newline at end of file
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt
index a6a2377118..efdb35edf1 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt
@@ -699,18 +699,20 @@ class TelegramSettings(private val app: TelegramApplication) {
val hiddenChats = mutableSetOf()
val hiddenChatsSet = prefs.getStringSet(HIDDEN_ON_MAP_CHATS_KEY, mutableSetOf())
- for (chatId in hiddenChatsSet) {
- hiddenChats.add(chatId.toLong())
+ hiddenChatsSet?.let {
+ for (chatId in it) {
+ hiddenChats.add(chatId.toLong())
+ }
}
hiddenOnMapChats = hiddenChats
metricsConstants = MetricsConstants.valueOf(
- prefs.getString(METRICS_CONSTANTS_KEY, MetricsConstants.KILOMETERS_AND_METERS.name)
+ prefs.getString(METRICS_CONSTANTS_KEY, MetricsConstants.KILOMETERS_AND_METERS.name)!!
)
speedConstants = SpeedConstants.valueOf(
- prefs.getString(SPEED_CONSTANTS_KEY, SpeedConstants.KILOMETERS_PER_HOUR.name)
+ prefs.getString(SPEED_CONSTANTS_KEY, SpeedConstants.KILOMETERS_PER_HOUR.name)!!
)
- utcOffset = prefs.getString(UTC_OFFSET_CONSTANTS_KEY, DataConstants.UTC_FORMAT)
+ utcOffset = prefs.getString(UTC_OFFSET_CONSTANTS_KEY, DataConstants.UTC_FORMAT)!!
try {
parseShareChatsInfo(JSONArray(prefs.getString(SHARE_CHATS_INFO_KEY, "")))
@@ -724,7 +726,7 @@ class TelegramSettings(private val app: TelegramApplication) {
log.error(e)
}
- parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, ""))
+ parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, "")!!)
val sendMyLocDef = SEND_MY_LOC_VALUES_SEC[SEND_MY_LOC_DEFAULT_INDEX]
sendMyLocInterval = prefs.getLong(SEND_MY_LOC_INTERVAL_KEY, sendMyLocDef)
@@ -733,7 +735,7 @@ class TelegramSettings(private val app: TelegramApplication) {
val locHistoryDef = LOC_HISTORY_VALUES_SEC[LOC_HISTORY_DEFAULT_INDEX]
locHistoryTime = prefs.getLong(LOC_HISTORY_TIME_KEY, locHistoryDef)
val shareTypeDef = SHARE_TYPE_VALUES[SHARE_TYPE_DEFAULT_INDEX]
- shareTypeValue = prefs.getString(SHARE_TYPE_KEY, shareTypeDef)
+ shareTypeValue = prefs.getString(SHARE_TYPE_KEY, shareTypeDef)!!
val minLocationDistanceDef = MIN_LOCATION_DISTANCE[MIN_LOCATION_DISTANCE_INDEX]
minLocationDistance = prefs.getFloat(MIN_LOCATION_DISTANCE_KEY, minLocationDistanceDef)
@@ -743,13 +745,13 @@ class TelegramSettings(private val app: TelegramApplication) {
minLocationSpeed = prefs.getFloat(MIN_LOCATION_SPEED_KEY, minLocationSpeedDef)
val currentUserId = app.telegramHelper.getCurrentUserId()
- currentSharingMode = prefs.getString(SHARING_MODE_KEY, if (currentUserId != -1) currentUserId.toString() else "")
+ currentSharingMode = prefs.getString(SHARING_MODE_KEY, if (currentUserId != -1) currentUserId.toString() else "")!!
val defPackage = if (AppConnect.getInstalledApps(app).size == 1) AppConnect.getInstalledApps(app).first().appPackage else ""
- appToConnectPackage = prefs.getString(APP_TO_CONNECT_PACKAGE_KEY, defPackage)
+ appToConnectPackage = prefs.getString(APP_TO_CONNECT_PACKAGE_KEY, defPackage)!!
liveNowSortType = LiveNowSortType.valueOf(
- prefs.getString(LIVE_NOW_SORT_TYPE_KEY, LiveNowSortType.SORT_BY_DISTANCE.name)
+ prefs.getString(LIVE_NOW_SORT_TYPE_KEY, LiveNowSortType.SORT_BY_DISTANCE.name)!!
)
batteryOptimisationAsked = prefs.getBoolean(BATTERY_OPTIMISATION_ASKED,false)
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt
index 16469f069c..4c04bb82c1 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt
@@ -295,7 +295,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
private fun getStatusWidgetIntent(): Intent {
val startIntent = app.packageManager.getLaunchIntentForPackage(app.packageName)
- startIntent.addCategory(Intent.CATEGORY_LAUNCHER)
+ startIntent!!.addCategory(Intent.CATEGORY_LAUNCHER)
startIntent.putExtra(OPEN_MY_LOCATION_TAB_KEY,true)
return startIntent
}
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt
index 48a5608bb2..08cb4808c7 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/SetTimeBottomSheet.kt
@@ -106,18 +106,20 @@ class SetTimeBottomSheet : DialogFragment() {
}
private fun selectStartDate() {
- val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
- startCalendar.set(Calendar.YEAR, year)
- startCalendar.set(Calendar.MONTH, monthOfYear)
- startCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
- updateDateAndTimeButtons()
- }
- DatePickerDialog(
- context, dateFromDialog,
- startCalendar.get(Calendar.YEAR),
- startCalendar.get(Calendar.MONTH),
- startCalendar.get(Calendar.DAY_OF_MONTH)
- ).show()
+ context?.let {
+ val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
+ startCalendar.set(Calendar.YEAR, year)
+ startCalendar.set(Calendar.MONTH, monthOfYear)
+ startCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
+ updateDateAndTimeButtons()
+ }
+ DatePickerDialog(
+ it, dateFromDialog,
+ startCalendar.get(Calendar.YEAR),
+ startCalendar.get(Calendar.MONTH),
+ startCalendar.get(Calendar.DAY_OF_MONTH)
+ ).show()
+ }
}
private fun selectStartTime() {
@@ -132,18 +134,20 @@ class SetTimeBottomSheet : DialogFragment() {
}
private fun selectEndDate() {
- val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
- endCalendar.set(Calendar.YEAR, year)
- endCalendar.set(Calendar.MONTH, monthOfYear)
- endCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
- updateDateAndTimeButtons()
- }
- DatePickerDialog(
- context, dateFromDialog,
- endCalendar.get(Calendar.YEAR),
- endCalendar.get(Calendar.MONTH),
- endCalendar.get(Calendar.DAY_OF_MONTH)
- ).show()
+ context?.let {
+ val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
+ endCalendar.set(Calendar.YEAR, year)
+ endCalendar.set(Calendar.MONTH, monthOfYear)
+ endCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
+ updateDateAndTimeButtons()
+ }
+ DatePickerDialog(
+ it, dateFromDialog,
+ endCalendar.get(Calendar.YEAR),
+ endCalendar.get(Calendar.MONTH),
+ endCalendar.get(Calendar.DAY_OF_MONTH)
+ ).show()
+ }
}
private fun selectEndTime() {
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt
index 71fb5ba47b..25e9ffbf96 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/TimelineTabFragment.kt
@@ -53,7 +53,7 @@ class TimelineTabFragment : Fragment() {
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
- ): View? {
+ ): View {
mainView = inflater.inflate(R.layout.fragment_timeline_tab, container, false)
val appBarLayout = mainView.findViewById(R.id.app_bar_layout)
@@ -139,22 +139,24 @@ class TimelineTabFragment : Fragment() {
fun tabClosed() {}
private fun selectDate() {
- val dateSetListener =
- DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
- calendar = Calendar.getInstance()
- calendar.set(Calendar.YEAR, year)
- calendar.set(Calendar.MONTH, monthOfYear)
- calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
+ context?.let {
+ val dateSetListener =
+ DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
+ calendar = Calendar.getInstance()
+ calendar.set(Calendar.YEAR, year)
+ calendar.set(Calendar.MONTH, monthOfYear)
+ calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
- updateList()
- updateDateButton()
- }
- DatePickerDialog(
- context, dateSetListener,
- calendar.get(Calendar.YEAR),
- calendar.get(Calendar.MONTH),
- calendar.get(Calendar.DAY_OF_MONTH)
- ).show()
+ updateList()
+ updateDateButton()
+ }
+ DatePickerDialog(
+ it, dateSetListener,
+ calendar.get(Calendar.YEAR),
+ calendar.get(Calendar.MONTH),
+ calendar.get(Calendar.DAY_OF_MONTH)
+ ).show()
+ }
}
private fun getStartOfDay(calendar: Calendar): Long {
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt
index 80669017f5..f339478bc3 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/BottomSheetDialog.kt
@@ -32,11 +32,11 @@ class BottomSheetDialog(ctx: Context) : Dialog(ctx, R.style.AppTheme_BottomSheet
super.setContentView(wrapInContainer(layoutResID, null, null))
}
- override fun setContentView(view: View?) {
+ override fun setContentView(view: View) {
super.setContentView(wrapInContainer(0, view, null))
}
- override fun setContentView(view: View?, params: ViewGroup.LayoutParams?) {
+ override fun setContentView(view: View, params: ViewGroup.LayoutParams?) {
super.setContentView(wrapInContainer(0, view, params))
}
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt
index 52a87e81ee..9fd25a507c 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/views/TextViewEx.kt
@@ -40,7 +40,7 @@ class TextViewEx : AppCompatTextView {
}
val typefaceName = resolvedAttrs.getString(R.styleable.TextViewEx_typeface)
- val typeface = FontCache.getFont(context, typefaceName)
+ val typeface = FontCache.getFont(context, typefaceName!!)
if (typeface != null) {
val style = getTypeface()?.style ?: 0
setTypeface(typeface, style)
diff --git a/OsmAnd/res/layout/point_editor_fragment_new.xml b/OsmAnd/res/layout/point_editor_fragment_new.xml
index 9be9841750..679ca022fe 100644
--- a/OsmAnd/res/layout/point_editor_fragment_new.xml
+++ b/OsmAnd/res/layout/point_editor_fragment_new.xml
@@ -93,6 +93,7 @@
android:paddingRight="@dimen/content_padding_small"
android:scrollHorizontally="false"
android:textSize="@dimen/default_list_text_size"
+ android:imeOptions="actionDone"
tools:text="@string/lorem_ipsum" />
@@ -143,6 +144,7 @@
android:paddingEnd="@dimen/content_padding_small"
android:paddingRight="@dimen/content_padding_small"
android:textSize="@dimen/default_list_text_size"
+ android:imeOptions="actionDone"
tools:text="@string/lorem_ipsum" />
@@ -253,6 +255,7 @@
android:text="@string/add_description"
android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium"
+ android:imeOptions="actionDone"
tools:text="@string/add_description" />
Elegir imagen
Alemán (casual)
%1$s * %2$s
+ Puedes usar los datos de elevación para considerar el ascenso o descenso de su viaje
+ Avión ligero
\ No newline at end of file
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index 7973ff27cd..771d0674f6 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -3977,4 +3977,5 @@
Sélectionnez une image
%1$s * %2$s
Allemand (courant)
+ Aviation légère
\ No newline at end of file
diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml
index 148c7fe98c..42fb8639e7 100644
--- a/OsmAnd/res/values-gl/strings.xml
+++ b/OsmAnd/res/values-gl/strings.xml
@@ -187,7 +187,7 @@
Chinés sinxelo
Eslovaco
Esloveno
- Español ou castelán
+ Español
Sueco
Chinés tradicional
Turco
@@ -1420,7 +1420,7 @@
Bengalí
Tagalo
Serbo-croata
- Azarí ou acerbaixano
+ Azarí
Bretón
Albanés
Islandés
@@ -4024,4 +4024,7 @@ Lon %2$s
\nMapillary - maxes a nivel de rúa;
\nWeb / Wikimedia - imaxes POI especificadas nos datos do OpenStreetMap.
%1$s * %2$s
+ Alemán casual
+ Podes empregar os datos de elevación para considerar o ascenso ou descenso da túa viaxe
+ Avión lixeiro
\ No newline at end of file
diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml
index 0a6aae70fe..d5785755cd 100644
--- a/OsmAnd/res/values-it/strings.xml
+++ b/OsmAnd/res/values-it/strings.xml
@@ -3981,10 +3981,10 @@
\"Tracciabile\" significa che la traccia non è visualizzabile in alcuna lista pubblica, ma solo i suoi punti, processati, con le informazioni temporali (che non possono essere direttamente associati a te) attraverso le API GPS pubbliche.
Aggiungi a Mapillary
Aggiungi a OpenPlaceReviews
- OsmAnd mostra foto da più sorgenti:
-\nOpenPlaceReviews - foto PDI;
+ OsmAnd mostra foto da diverse fonti:
+\nOpenPlaceReviews - foto POI;
\nMapillary - immagini stradali;
-\nWeb / Wikimedia - foto PDI OpenStreetMap.
+\nWeb / Wikimedia - foto POI specificate nei dati di OpenStreetMap.
Risorse
Dimesione approssimativa del file
Seleziona i dati da esportare nel file.
@@ -3998,5 +3998,7 @@
Impossibile caricare l\'immagine, riprovare in seguito
Scegli la foto
%1$s * %2$s
- German (casual)
+ Tedesco (informale)
+ Puoi utililizzare i dati dell\'altitudine per valutare la Salita/Discesa del tuo percorso
+ Ultraleggeri
\ No newline at end of file
diff --git a/OsmAnd/res/values-iw/strings.xml b/OsmAnd/res/values-iw/strings.xml
index f8d10bfa90..ef3ad7571e 100644
--- a/OsmAnd/res/values-iw/strings.xml
+++ b/OsmAnd/res/values-iw/strings.xml
@@ -4003,4 +4003,6 @@
בחירת תמונה
גרמנית (עממית)
%1$s * %2$s
+ אפשר להשתמש בנתוני רום לצורך התחשבות בעליה / ירידה במהלך הטיול
+ כלי טיס קל
\ No newline at end of file
diff --git a/OsmAnd/res/values-pl/phrases.xml b/OsmAnd/res/values-pl/phrases.xml
index c3a1752338..8774ca645c 100644
--- a/OsmAnd/res/values-pl/phrases.xml
+++ b/OsmAnd/res/values-pl/phrases.xml
@@ -2705,8 +2705,8 @@
Konsulat generalny
Konsul honorowy
Misja dyplomatyczna
- Ambasada
- Delegacja UE
+ Rezydencja ambasadora
+ Delegacja
Wysoka komisja
Inskrypcja: N (północ)
Inskrypcja: NW (północny-zachód)
@@ -3849,4 +3849,27 @@
Wiaty parkingowe
Punkt GPX
Ul
+ Nie
+ Tak
+ Nie
+ Tak
+ Nie
+ Tak
+ Biuro
+ Konsulat generalny
+ Agencja konsularna
+ Kierowany przez konsula
+ Rezydencja
+ Nuncjatura
+ Misja
+ Wysoka komisja
+ Delegacja
+ Dział
+ Na czele z ambasadorem
+ Ambasada
+ Usługi dla obywateli
+ Wizy imigracyjne
+ Wizy nieimigracyjne
+ Konsulat
+ Ambasada
\ No newline at end of file
diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml
index e0572077bc..dc8809751f 100644
--- a/OsmAnd/res/values-pl/strings.xml
+++ b/OsmAnd/res/values-pl/strings.xml
@@ -3028,7 +3028,7 @@
Pobrane mapy
Odwiedzane ekrany
Zebrane Informacje
- Narciarstwo alpejskie/zjazdowe
+ Narciarstwo alpejskie i zjazdowe
Określ, które dane pozwalasz OsmAnd udostępniać.
Pomóż nam poznać popularność map krajów i regionów.
Pomóż nam poznać popularność funkcji OsmAnd.
@@ -3962,9 +3962,9 @@
Zaloguj się do OpenStreetMap
Zaloguj się do OpenStreetMap.org
Zaloguj się za pomocą OpenStreetMap
- Zaloguj się, aby przesłać nowe lub zmodyfikowane zmiany,
+ Musisz zalogować się, aby przesłać nowe lub zmodyfikowane zmiany,
\n
-\nza pomocą protokołu OAuth lub nazwy użytkownika i hasła.
+\nMożesz zalogować się za pomocą protokołu OAuth lub loginu i hasła.
Użyj loginu i hasła
Konto
Zamknij uwagę OSM
@@ -4004,4 +4004,5 @@
Wybierz zdjęcie
Nie można przesłać obrazu, spróbuj ponownie później
%1$s * %2$s
+ Niemiecki (styl potoczny)
\ No newline at end of file
diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml
index 8f3eba7cf1..c3980aa38b 100644
--- a/OsmAnd/res/values-ru/phrases.xml
+++ b/OsmAnd/res/values-ru/phrases.xml
@@ -3868,4 +3868,6 @@
Консульское агентство
Раздел интересов
Консульство
+ Сирена
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml
index 9ea89f1e1d..82d6e3dbdd 100644
--- a/OsmAnd/res/values-sc/strings.xml
+++ b/OsmAnd/res/values-sc/strings.xml
@@ -3998,4 +3998,6 @@
Ischerta un\'immàgine
%1$s * %2$s
Tedescu (informale)
+ Podes impreare sos datos de s\'artària pro pigare in cunsideru s\'Artziada / Achirrada pro su biàgiu tuo
+ Aèreu lèbiu
\ No newline at end of file
diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml
index 2a9bae4b58..40c02a5830 100644
--- a/OsmAnd/res/values-uk/strings.xml
+++ b/OsmAnd/res/values-uk/strings.xml
@@ -3997,4 +3997,6 @@
Вибрати зображення
%1$s * %2$s
Німецька (неформальна)
+ Ви можете використовувати дані про висоту для розгляду сходження / спуску для вашої подорожі
+ Легкий літак
\ 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 a5994b6225..bd6e77050f 100644
--- a/OsmAnd/res/values-zh-rTW/strings.xml
+++ b/OsmAnd/res/values-zh-rTW/strings.xml
@@ -3996,4 +3996,6 @@
選取圖片
德語(非正式)
%1$s * %2$s
+ 您可以將海拔資料用於您旅程的上升與下降
+ 輕型飛機
\ No newline at end of file
diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml
index 360f1d8718..c38d838285 100644
--- a/OsmAnd/res/values/phrases.xml
+++ b/OsmAnd/res/values/phrases.xml
@@ -4300,4 +4300,10 @@
Yes
No
+ Mobile money agent
+
+ Nurse
+
+ Siren
+
diff --git a/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java b/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java
index 6749b1e118..677a094f62 100644
--- a/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java
+++ b/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java
@@ -36,19 +36,17 @@ import java.util.List;
public class DownloadTilesDialog {
-
- private final static Log log = PlatformUtil.getLog(DownloadTilesDialog.class);
+ private final static Log log = PlatformUtil.getLog(DownloadTilesDialog.class);
private final Context ctx;
private final OsmandApplication app;
private final OsmandMapTileView mapView;
- public DownloadTilesDialog(Context ctx, OsmandApplication app, OsmandMapTileView mapView){
+ public DownloadTilesDialog(Context ctx, OsmandApplication app, OsmandMapTileView mapView) {
this.ctx = ctx;
this.app = app;
this.mapView = mapView;
}
-
public void openDialog(){
BaseMapLayer mainLayer = mapView.getMainLayer();
if (!(mainLayer instanceof MapTileLayer) || !((MapTileLayer) mainLayer).isVisible()) {
@@ -77,7 +75,8 @@ public class DownloadTilesDialog {
final TextView downloadText = ((TextView) view.findViewById(R.id.DownloadDescription));
final String template = ctx.getString(R.string.tiles_to_download_estimated_size);
- updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) slider.getValue());
+ final boolean ellipticYTile = mapSource.isEllipticYTile();
+ updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) slider.getValue(), ellipticYTile);
if (max > zoom) {
slider.setValueTo(max - zoom);
int progress = (max - zoom) / 2;
@@ -85,7 +84,7 @@ public class DownloadTilesDialog {
slider.addOnChangeListener(new Slider.OnChangeListener() {
@Override
public void onValueChange(@NonNull Slider slider, float value, boolean fromUser) {
- updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) value);
+ updateLabel(zoom, rb.getLatLonBounds(), downloadText, template, (int) value, ellipticYTile);
}
});
}
@@ -105,22 +104,16 @@ public class DownloadTilesDialog {
private volatile boolean cancel = false;
private IMapDownloaderCallback callback;
- public void run(final int zoom, final int progress, final QuadRect latlonRect, final ITileSource map){
+ public void run(final int zoom, final int progress, final QuadRect latlonRect, final ITileSource map) {
cancel = false;
- int numberTiles = 0;
- for (int z = zoom; z <= progress + zoom; z++) {
- int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left);
- int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right);
- int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top);
- int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom);
- numberTiles += (x2 - x1 + 1) * (y2 - y1 + 1);
- }
+ final boolean ellipticYTile = map.isEllipticYTile();
+ int numberTiles = getNumberTiles(zoom, progress, latlonRect, ellipticYTile);
final ProgressDialog progressDlg = new ProgressDialog(ctx);
progressDlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDlg.setMessage(ctx.getString(R.string.shared_string_downloading));
progressDlg.setCancelable(true);
progressDlg.setMax(numberTiles);
- progressDlg.setOnCancelListener(new DialogInterface.OnCancelListener(){
+ progressDlg.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
@@ -152,8 +145,15 @@ public class DownloadTilesDialog {
for (int z = zoom; z <= zoom + progress && !cancel; z++) {
int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left);
int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right);
- int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top);
- int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom);
+ int y1;
+ int y2;
+ if (ellipticYTile) {
+ y1 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.top);
+ y2 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.bottom);
+ } else {
+ y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top);
+ y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom);
+ }
for (int x = x1; x <= x2 && !cancel; x++) {
for (int y = y1; y <= y2 && !cancel; y++) {
String tileId = rm.calculateTileId(map, x, y, z);
@@ -178,7 +178,6 @@ public class DownloadTilesDialog {
}
}
}
-
}
if(cancel){
instance.refuseAllPreviousRequests();
@@ -205,26 +204,34 @@ public class DownloadTilesDialog {
}
progressDlg.dismiss();
}
-
};
-
-
-
new Thread(r, "Downloading tiles").start(); //$NON-NLS-1$
progressDlg.show();
}
+ private void updateLabel(final int zoom, final QuadRect latlonRect, final TextView downloadText,
+ final String template, int progress, boolean ellipticYTile) {
+ int numberTiles = getNumberTiles(zoom, progress, latlonRect, ellipticYTile);
+ downloadText.setText(MessageFormat.format(template, (progress + zoom) + "",
+ numberTiles, (double) numberTiles * 12 / 1000));
+ }
- private void updateLabel(final int zoom, final QuadRect latlonRect, final TextView downloadText, final String template, int progress) {
+ private int getNumberTiles(int zoom, int progress, QuadRect latlonRect, boolean ellipticYTile) {
int numberTiles = 0;
for (int z = zoom; z <= progress + zoom; z++) {
int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left);
int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right);
- int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top);
- int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom);
+ int y1;
+ int y2;
+ if (ellipticYTile) {
+ y1 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.top);
+ y2 = (int) MapUtils.getTileEllipsoidNumberY(z, latlonRect.bottom);
+ } else {
+ y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top);
+ y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom);
+ }
numberTiles += (x2 - x1 + 1) * (y2 - y1 + 1);
}
- downloadText.setText(MessageFormat.format(template, (progress + zoom)+"", //$NON-NLS-1$
- numberTiles, (double)numberTiles*12/1000));
+ return numberTiles;
}
-}
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java
index 3312371a56..5becff9bad 100644
--- a/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java
+++ b/OsmAnd/src/net/osmand/plus/routepreparationmenu/cards/TracksCard.java
@@ -62,10 +62,12 @@ public class TracksCard extends BaseCard {
@SuppressLint("DefaultLocale")
@Override
protected void updateContent() {
+ String gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath();
final List list = new ArrayList<>();
for (GPXFile gpx : gpxFiles) {
File f = new File(gpx.path);
- list.add(new GpxItem(GpxUiHelper.getGpxTitle(f.getName()), gpx, new GPXInfo(f.getName(), f.lastModified(), f.length())));
+ String fileName = gpx.path.startsWith(gpxDir) ? gpx.path.substring(gpxDir.length() + 1) : f.getName();
+ list.add(new GpxItem(GpxUiHelper.getGpxTitle(f.getName()), gpx, new GPXInfo(fileName, f.lastModified(), f.length())));
}
Collections.sort(list, new Comparator() {
@Override