Merge pull request #10321 from osmandapp/master

update test branch
This commit is contained in:
Hardy 2020-12-02 20:38:21 +01:00 committed by GitHub
commit 881bdf314f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 167 additions and 95 deletions

View file

@ -269,4 +269,8 @@
<string name="logcat_buffer">Logcat buffer</string> <string name="logcat_buffer">Logcat buffer</string>
<string name="send_report">Invia rapporto</string> <string name="send_report">Invia rapporto</string>
<string name="shared_string_export">Esporta</string> <string name="shared_string_export">Esporta</string>
<string name="unit_of_speed_system_descr">Specifica l\'unità di misura della velocità.</string>
<string name="time_zone_descr">Seleziona il fuso orario da mostrare nei messaggi sulla posizione.</string>
<string name="buffer_time">Tempo di scadenza del buffer</string>
<string name="buffer_time_descr">Tempo massimo per memorizzare i punti nel buffer</string>
</resources> </resources>

View file

@ -699,18 +699,20 @@ class TelegramSettings(private val app: TelegramApplication) {
val hiddenChats = mutableSetOf<Long>() val hiddenChats = mutableSetOf<Long>()
val hiddenChatsSet = prefs.getStringSet(HIDDEN_ON_MAP_CHATS_KEY, mutableSetOf()) val hiddenChatsSet = prefs.getStringSet(HIDDEN_ON_MAP_CHATS_KEY, mutableSetOf())
for (chatId in hiddenChatsSet) { hiddenChatsSet?.let {
for (chatId in it) {
hiddenChats.add(chatId.toLong()) hiddenChats.add(chatId.toLong())
} }
}
hiddenOnMapChats = hiddenChats hiddenOnMapChats = hiddenChats
metricsConstants = MetricsConstants.valueOf( 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( 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 { try {
parseShareChatsInfo(JSONArray(prefs.getString(SHARE_CHATS_INFO_KEY, ""))) parseShareChatsInfo(JSONArray(prefs.getString(SHARE_CHATS_INFO_KEY, "")))
@ -724,7 +726,7 @@ class TelegramSettings(private val app: TelegramApplication) {
log.error(e) 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] val sendMyLocDef = SEND_MY_LOC_VALUES_SEC[SEND_MY_LOC_DEFAULT_INDEX]
sendMyLocInterval = prefs.getLong(SEND_MY_LOC_INTERVAL_KEY, sendMyLocDef) 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] val locHistoryDef = LOC_HISTORY_VALUES_SEC[LOC_HISTORY_DEFAULT_INDEX]
locHistoryTime = prefs.getLong(LOC_HISTORY_TIME_KEY, locHistoryDef) locHistoryTime = prefs.getLong(LOC_HISTORY_TIME_KEY, locHistoryDef)
val shareTypeDef = SHARE_TYPE_VALUES[SHARE_TYPE_DEFAULT_INDEX] 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] val minLocationDistanceDef = MIN_LOCATION_DISTANCE[MIN_LOCATION_DISTANCE_INDEX]
minLocationDistance = prefs.getFloat(MIN_LOCATION_DISTANCE_KEY, minLocationDistanceDef) 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) minLocationSpeed = prefs.getFloat(MIN_LOCATION_SPEED_KEY, minLocationSpeedDef)
val currentUserId = app.telegramHelper.getCurrentUserId() 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 "" 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( 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) batteryOptimisationAsked = prefs.getBoolean(BATTERY_OPTIMISATION_ASKED,false)

View file

@ -295,7 +295,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
private fun getStatusWidgetIntent(): Intent { private fun getStatusWidgetIntent(): Intent {
val startIntent = app.packageManager.getLaunchIntentForPackage(app.packageName) 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) startIntent.putExtra(OPEN_MY_LOCATION_TAB_KEY,true)
return startIntent return startIntent
} }

View file

@ -106,6 +106,7 @@ class SetTimeBottomSheet : DialogFragment() {
} }
private fun selectStartDate() { private fun selectStartDate() {
context?.let {
val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
startCalendar.set(Calendar.YEAR, year) startCalendar.set(Calendar.YEAR, year)
startCalendar.set(Calendar.MONTH, monthOfYear) startCalendar.set(Calendar.MONTH, monthOfYear)
@ -113,12 +114,13 @@ class SetTimeBottomSheet : DialogFragment() {
updateDateAndTimeButtons() updateDateAndTimeButtons()
} }
DatePickerDialog( DatePickerDialog(
context, dateFromDialog, it, dateFromDialog,
startCalendar.get(Calendar.YEAR), startCalendar.get(Calendar.YEAR),
startCalendar.get(Calendar.MONTH), startCalendar.get(Calendar.MONTH),
startCalendar.get(Calendar.DAY_OF_MONTH) startCalendar.get(Calendar.DAY_OF_MONTH)
).show() ).show()
} }
}
private fun selectStartTime() { private fun selectStartTime() {
TimePickerDialog( TimePickerDialog(
@ -132,6 +134,7 @@ class SetTimeBottomSheet : DialogFragment() {
} }
private fun selectEndDate() { private fun selectEndDate() {
context?.let {
val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
endCalendar.set(Calendar.YEAR, year) endCalendar.set(Calendar.YEAR, year)
endCalendar.set(Calendar.MONTH, monthOfYear) endCalendar.set(Calendar.MONTH, monthOfYear)
@ -139,12 +142,13 @@ class SetTimeBottomSheet : DialogFragment() {
updateDateAndTimeButtons() updateDateAndTimeButtons()
} }
DatePickerDialog( DatePickerDialog(
context, dateFromDialog, it, dateFromDialog,
endCalendar.get(Calendar.YEAR), endCalendar.get(Calendar.YEAR),
endCalendar.get(Calendar.MONTH), endCalendar.get(Calendar.MONTH),
endCalendar.get(Calendar.DAY_OF_MONTH) endCalendar.get(Calendar.DAY_OF_MONTH)
).show() ).show()
} }
}
private fun selectEndTime() { private fun selectEndTime() {
TimePickerDialog( TimePickerDialog(

View file

@ -53,7 +53,7 @@ class TimelineTabFragment : Fragment() {
inflater: LayoutInflater, inflater: LayoutInflater,
container: ViewGroup?, container: ViewGroup?,
savedInstanceState: Bundle? savedInstanceState: Bundle?
): View? { ): View {
mainView = inflater.inflate(R.layout.fragment_timeline_tab, container, false) mainView = inflater.inflate(R.layout.fragment_timeline_tab, container, false)
val appBarLayout = mainView.findViewById<View>(R.id.app_bar_layout) val appBarLayout = mainView.findViewById<View>(R.id.app_bar_layout)
@ -139,6 +139,7 @@ class TimelineTabFragment : Fragment() {
fun tabClosed() {} fun tabClosed() {}
private fun selectDate() { private fun selectDate() {
context?.let {
val dateSetListener = val dateSetListener =
DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth -> DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
calendar = Calendar.getInstance() calendar = Calendar.getInstance()
@ -150,12 +151,13 @@ class TimelineTabFragment : Fragment() {
updateDateButton() updateDateButton()
} }
DatePickerDialog( DatePickerDialog(
context, dateSetListener, it, dateSetListener,
calendar.get(Calendar.YEAR), calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH), calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH) calendar.get(Calendar.DAY_OF_MONTH)
).show() ).show()
} }
}
private fun getStartOfDay(calendar: Calendar): Long { private fun getStartOfDay(calendar: Calendar): Long {
calendar.set(Calendar.HOUR_OF_DAY, 0) calendar.set(Calendar.HOUR_OF_DAY, 0)

View file

@ -32,11 +32,11 @@ class BottomSheetDialog(ctx: Context) : Dialog(ctx, R.style.AppTheme_BottomSheet
super.setContentView(wrapInContainer(layoutResID, null, null)) super.setContentView(wrapInContainer(layoutResID, null, null))
} }
override fun setContentView(view: View?) { override fun setContentView(view: View) {
super.setContentView(wrapInContainer(0, view, null)) 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)) super.setContentView(wrapInContainer(0, view, params))
} }

View file

@ -40,7 +40,7 @@ class TextViewEx : AppCompatTextView {
} }
val typefaceName = resolvedAttrs.getString(R.styleable.TextViewEx_typeface) val typefaceName = resolvedAttrs.getString(R.styleable.TextViewEx_typeface)
val typeface = FontCache.getFont(context, typefaceName) val typeface = FontCache.getFont(context, typefaceName!!)
if (typeface != null) { if (typeface != null) {
val style = getTypeface()?.style ?: 0 val style = getTypeface()?.style ?: 0
setTypeface(typeface, style) setTypeface(typeface, style)

View file

@ -93,6 +93,7 @@
android:paddingRight="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding_small"
android:scrollHorizontally="false" android:scrollHorizontally="false"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_list_text_size"
android:imeOptions="actionDone"
tools:text="@string/lorem_ipsum" /> tools:text="@string/lorem_ipsum" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -143,6 +144,7 @@
android:paddingEnd="@dimen/content_padding_small" android:paddingEnd="@dimen/content_padding_small"
android:paddingRight="@dimen/content_padding_small" android:paddingRight="@dimen/content_padding_small"
android:textSize="@dimen/default_list_text_size" android:textSize="@dimen/default_list_text_size"
android:imeOptions="actionDone"
tools:text="@string/lorem_ipsum" /> tools:text="@string/lorem_ipsum" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
@ -253,6 +255,7 @@
android:text="@string/add_description" android:text="@string/add_description"
android:textSize="@dimen/default_desc_text_size" android:textSize="@dimen/default_desc_text_size"
osmand:typeface="@string/font_roboto_medium" osmand:typeface="@string/font_roboto_medium"
android:imeOptions="actionDone"
tools:text="@string/add_description" /> tools:text="@string/add_description" />
<View <View

View file

@ -4006,4 +4006,6 @@
<string name="select_picture">Elegir imagen</string> <string name="select_picture">Elegir imagen</string>
<string name="lang_de_casual">Alemán (casual)</string> <string name="lang_de_casual">Alemán (casual)</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="elevation_data">Puedes usar los datos de elevación para considerar el ascenso o descenso de su viaje</string>
<string name="app_mode_light_aircraft">Avión ligero</string>
</resources> </resources>

View file

@ -3977,4 +3977,5 @@
<string name="select_picture">Sélectionnez une image</string> <string name="select_picture">Sélectionnez une image</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="lang_de_casual">Allemand (courant)</string> <string name="lang_de_casual">Allemand (courant)</string>
<string name="app_mode_light_aircraft">Aviation légère</string>
</resources> </resources>

View file

@ -187,7 +187,7 @@
<string name="lang_zh_cn">Chinés sinxelo</string> <string name="lang_zh_cn">Chinés sinxelo</string>
<string name="lang_sk">Eslovaco</string> <string name="lang_sk">Eslovaco</string>
<string name="lang_sl">Esloveno</string> <string name="lang_sl">Esloveno</string>
<string name="lang_es">Español ou castelán</string> <string name="lang_es">Español</string>
<string name="lang_sv">Sueco</string> <string name="lang_sv">Sueco</string>
<string name="lang_zh_tw">Chinés tradicional</string> <string name="lang_zh_tw">Chinés tradicional</string>
<string name="lang_tr">Turco</string> <string name="lang_tr">Turco</string>
@ -1420,7 +1420,7 @@
<string name="lang_bn">Bengalí</string> <string name="lang_bn">Bengalí</string>
<string name="lang_tl">Tagalo</string> <string name="lang_tl">Tagalo</string>
<string name="lang_sh">Serbo-croata</string> <string name="lang_sh">Serbo-croata</string>
<string name="lang_az">Azarí ou acerbaixano</string> <string name="lang_az">Azarí</string>
<string name="lang_br">Bretón</string> <string name="lang_br">Bretón</string>
<string name="lang_sq">Albanés</string> <string name="lang_sq">Albanés</string>
<string name="lang_is">Islandés</string> <string name="lang_is">Islandés</string>
@ -4024,4 +4024,7 @@ Lon %2$s</string>
\nMapillary - maxes a nivel de rúa; \nMapillary - maxes a nivel de rúa;
\nWeb / Wikimedia - imaxes POI especificadas nos datos do OpenStreetMap.</string> \nWeb / Wikimedia - imaxes POI especificadas nos datos do OpenStreetMap.</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="lang_de_casual">Alemán casual</string>
<string name="elevation_data">Podes empregar os datos de elevación para considerar o ascenso ou descenso da túa viaxe</string>
<string name="app_mode_light_aircraft">Avión lixeiro</string>
</resources> </resources>

View file

@ -3981,10 +3981,10 @@
<string name="gpx_upload_trackable_visibility_descr">\"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.</string> <string name="gpx_upload_trackable_visibility_descr">\"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.</string>
<string name="add_to_mapillary">Aggiungi a Mapillary</string> <string name="add_to_mapillary">Aggiungi a Mapillary</string>
<string name="add_to_opr">Aggiungi a OpenPlaceReviews</string> <string name="add_to_opr">Aggiungi a OpenPlaceReviews</string>
<string name="add_photos_descr">OsmAnd mostra foto da più sorgenti: <string name="add_photos_descr">OsmAnd mostra foto da diverse fonti:
\nOpenPlaceReviews - foto PDI; \nOpenPlaceReviews - foto POI;
\nMapillary - immagini stradali; \nMapillary - immagini stradali;
\nWeb / Wikimedia - foto PDI OpenStreetMap.</string> \nWeb / Wikimedia - foto POI specificate nei dati di OpenStreetMap.</string>
<string name="shared_string_resources">Risorse</string> <string name="shared_string_resources">Risorse</string>
<string name="approximate_file_size">Dimesione approssimativa del file</string> <string name="approximate_file_size">Dimesione approssimativa del file</string>
<string name="select_data_to_export">Seleziona i dati da esportare nel file.</string> <string name="select_data_to_export">Seleziona i dati da esportare nel file.</string>
@ -3998,5 +3998,7 @@
<string name="cannot_upload_image">Impossibile caricare l\'immagine, riprovare in seguito</string> <string name="cannot_upload_image">Impossibile caricare l\'immagine, riprovare in seguito</string>
<string name="select_picture">Scegli la foto</string> <string name="select_picture">Scegli la foto</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="lang_de_casual">German (casual)</string> <string name="lang_de_casual">Tedesco (informale)</string>
<string name="elevation_data">Puoi utililizzare i dati dell\'altitudine per valutare la Salita/Discesa del tuo percorso</string>
<string name="app_mode_light_aircraft">Ultraleggeri</string>
</resources> </resources>

View file

@ -4003,4 +4003,6 @@
<string name="select_picture">בחירת תמונה</string> <string name="select_picture">בחירת תמונה</string>
<string name="lang_de_casual">גרמנית (עממית)</string> <string name="lang_de_casual">גרמנית (עממית)</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="elevation_data">אפשר להשתמש בנתוני רום לצורך התחשבות בעליה / ירידה במהלך הטיול</string>
<string name="app_mode_light_aircraft">כלי טיס קל</string>
</resources> </resources>

View file

@ -2705,8 +2705,8 @@
<string name="poi_diplomatic_consulate_general">Konsulat generalny</string> <string name="poi_diplomatic_consulate_general">Konsulat generalny</string>
<string name="poi_diplomatic_honorary_consulate">Konsul honorowy</string> <string name="poi_diplomatic_honorary_consulate">Konsul honorowy</string>
<string name="poi_diplomatic_permanent_mission">Misja dyplomatyczna</string> <string name="poi_diplomatic_permanent_mission">Misja dyplomatyczna</string>
<string name="poi_diplomatic_ambassadors_residence">Ambasada</string> <string name="poi_diplomatic_ambassadors_residence">Rezydencja ambasadora</string>
<string name="poi_diplomatic_delegation">Delegacja UE</string> <string name="poi_diplomatic_delegation">Delegacja</string>
<string name="poi_diplomatic_high_commission">Wysoka komisja</string> <string name="poi_diplomatic_high_commission">Wysoka komisja</string>
<string name="poi_inscription_n">Inskrypcja: N (północ)</string> <string name="poi_inscription_n">Inskrypcja: N (północ)</string>
<string name="poi_inscription_nw">Inskrypcja: NW (północny-zachód)</string> <string name="poi_inscription_nw">Inskrypcja: NW (północny-zachód)</string>
@ -3849,4 +3849,27 @@
<string name="poi_parking_sheds">Wiaty parkingowe</string> <string name="poi_parking_sheds">Wiaty parkingowe</string>
<string name="poi_gpx_point">Punkt GPX</string> <string name="poi_gpx_point">Punkt GPX</string>
<string name="poi_beehive">Ul</string> <string name="poi_beehive">Ul</string>
<string name="poi_diplomatic_services_citizen_services_no">Nie</string>
<string name="poi_diplomatic_services_citizen_services_yes">Tak</string>
<string name="poi_diplomatic_services_immigrant_visas_no">Nie</string>
<string name="poi_diplomatic_services_immigrant_visas_yes">Tak</string>
<string name="poi_diplomatic_services_non_immigrant_visas_no">Nie</string>
<string name="poi_diplomatic_services_non_immigrant_visas_yes">Tak</string>
<string name="poi_liaison_liaison_office">Biuro</string>
<string name="poi_consulate_consulate_general">Konsulat generalny</string>
<string name="poi_consulate_consular_agency">Agencja konsularna</string>
<string name="poi_consulate_yes">Kierowany przez konsula</string>
<string name="poi_embassy_residence">Rezydencja</string>
<string name="poi_embassy_nunciature">Nuncjatura</string>
<string name="poi_embassy_mission">Misja</string>
<string name="poi_embassy_high_commission">Wysoka komisja</string>
<string name="poi_embassy_delegation">Delegacja</string>
<string name="poi_embassy_branch_embassy">Dział</string>
<string name="poi_embassy_yes">Na czele z ambasadorem</string>
<string name="poi_diplomatic_embassy">Ambasada</string>
<string name="poi_diplomatic_services_citizen_services_filter">Usługi dla obywateli</string>
<string name="poi_diplomatic_services_immigrant_visas_filter">Wizy imigracyjne</string>
<string name="poi_diplomatic_services_non_immigrant_visas_filter">Wizy nieimigracyjne</string>
<string name="poi_consulate_filter">Konsulat</string>
<string name="poi_embassy_filter">Ambasada</string>
</resources> </resources>

View file

@ -3028,7 +3028,7 @@
<string name="downloaded_maps">Pobrane mapy</string> <string name="downloaded_maps">Pobrane mapy</string>
<string name="visited_screens">Odwiedzane ekrany</string> <string name="visited_screens">Odwiedzane ekrany</string>
<string name="colleted_data">Zebrane Informacje</string> <string name="colleted_data">Zebrane Informacje</string>
<string name="routing_attr_piste_type_downhill_name">Narciarstwo alpejskie/zjazdowe</string> <string name="routing_attr_piste_type_downhill_name">Narciarstwo alpejskie i zjazdowe</string>
<string name="collected_data_descr">Określ, które dane pozwalasz OsmAnd udostępniać.</string> <string name="collected_data_descr">Określ, które dane pozwalasz OsmAnd udostępniać.</string>
<string name="downloaded_maps_collect_descr">Pomóż nam poznać popularność map krajów i regionów.</string> <string name="downloaded_maps_collect_descr">Pomóż nam poznać popularność map krajów i regionów.</string>
<string name="visited_screens_collect_descr">Pomóż nam poznać popularność funkcji OsmAnd.</string> <string name="visited_screens_collect_descr">Pomóż nam poznać popularność funkcji OsmAnd.</string>
@ -3962,9 +3962,9 @@
<string name="login_open_street_map">Zaloguj się do OpenStreetMap</string> <string name="login_open_street_map">Zaloguj się do OpenStreetMap</string>
<string name="login_open_street_map_org">Zaloguj się do OpenStreetMap.org</string> <string name="login_open_street_map_org">Zaloguj się do OpenStreetMap.org</string>
<string name="sign_in_with_open_street_map">Zaloguj się za pomocą OpenStreetMap</string> <string name="sign_in_with_open_street_map">Zaloguj się za pomocą OpenStreetMap</string>
<string name="open_street_map_login_mode">Zaloguj się, aby przesłać nowe lub zmodyfikowane zmiany, <string name="open_street_map_login_mode">Musisz zalogować się, aby przesłać nowe lub zmodyfikowane zmiany,
\n \n
\nza pomocą protokołu OAuth lub nazwy użytkownika i hasła.</string> \nMożesz zalogować się za pomocą protokołu OAuth lub loginu i hasła.</string>
<string name="use_login_password">Użyj loginu i hasła</string> <string name="use_login_password">Użyj loginu i hasła</string>
<string name="login_account">Konto</string> <string name="login_account">Konto</string>
<string name="osm_edit_close_note">Zamknij uwagę OSM</string> <string name="osm_edit_close_note">Zamknij uwagę OSM</string>
@ -4004,4 +4004,5 @@
<string name="select_picture">Wybierz zdjęcie</string> <string name="select_picture">Wybierz zdjęcie</string>
<string name="cannot_upload_image">Nie można przesłać obrazu, spróbuj ponownie później</string> <string name="cannot_upload_image">Nie można przesłać obrazu, spróbuj ponownie później</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="lang_de_casual">Niemiecki (styl potoczny)</string>
</resources> </resources>

View file

@ -3868,4 +3868,6 @@
<string name="poi_consulate_consular_agency">Консульское агентство</string> <string name="poi_consulate_consular_agency">Консульское агентство</string>
<string name="poi_embassy_interests_section">Раздел интересов</string> <string name="poi_embassy_interests_section">Раздел интересов</string>
<string name="poi_consulate_filter">Консульство</string> <string name="poi_consulate_filter">Консульство</string>
<string name="poi_siren">Сирена</string>
</resources> </resources>

View file

@ -3998,4 +3998,6 @@
<string name="select_picture">Ischerta un\'immàgine</string> <string name="select_picture">Ischerta un\'immàgine</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="lang_de_casual">Tedescu (informale)</string> <string name="lang_de_casual">Tedescu (informale)</string>
<string name="elevation_data">Podes impreare sos datos de s\'artària pro pigare in cunsideru s\'Artziada / Achirrada pro su biàgiu tuo</string>
<string name="app_mode_light_aircraft">Aèreu lèbiu</string>
</resources> </resources>

View file

@ -3997,4 +3997,6 @@
<string name="select_picture">Вибрати зображення</string> <string name="select_picture">Вибрати зображення</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="lang_de_casual">Німецька (неформальна)</string> <string name="lang_de_casual">Німецька (неформальна)</string>
<string name="elevation_data">Ви можете використовувати дані про висоту для розгляду сходження / спуску для вашої подорожі</string>
<string name="app_mode_light_aircraft">Легкий літак</string>
</resources> </resources>

View file

@ -3996,4 +3996,6 @@
<string name="select_picture">選取圖片</string> <string name="select_picture">選取圖片</string>
<string name="lang_de_casual">德語(非正式)</string> <string name="lang_de_casual">德語(非正式)</string>
<string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string> <string name="ltr_or_rtl_combine_via_star">%1$s * %2$s</string>
<string name="elevation_data">您可以將海拔資料用於您旅程的上升與下降</string>
<string name="app_mode_light_aircraft">輕型飛機</string>
</resources> </resources>

View file

@ -4300,4 +4300,10 @@
<string name="poi_diplomatic_services_citizen_services_yes">Yes</string> <string name="poi_diplomatic_services_citizen_services_yes">Yes</string>
<string name="poi_diplomatic_services_citizen_services_no">No</string> <string name="poi_diplomatic_services_citizen_services_no">No</string>
<string name="poi_mobile_money_agent">Mobile money agent</string>
<string name="poi_nurse">Nurse</string>
<string name="poi_siren">Siren</string>
</resources> </resources>

View file

@ -36,19 +36,17 @@ import java.util.List;
public class DownloadTilesDialog { 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 Context ctx;
private final OsmandApplication app; private final OsmandApplication app;
private final OsmandMapTileView mapView; private final OsmandMapTileView mapView;
public DownloadTilesDialog(Context ctx, OsmandApplication app, OsmandMapTileView mapView){ public DownloadTilesDialog(Context ctx, OsmandApplication app, OsmandMapTileView mapView) {
this.ctx = ctx; this.ctx = ctx;
this.app = app; this.app = app;
this.mapView = mapView; this.mapView = mapView;
} }
public void openDialog(){ public void openDialog(){
BaseMapLayer mainLayer = mapView.getMainLayer(); BaseMapLayer mainLayer = mapView.getMainLayer();
if (!(mainLayer instanceof MapTileLayer) || !((MapTileLayer) mainLayer).isVisible()) { if (!(mainLayer instanceof MapTileLayer) || !((MapTileLayer) mainLayer).isVisible()) {
@ -77,7 +75,8 @@ public class DownloadTilesDialog {
final TextView downloadText = ((TextView) view.findViewById(R.id.DownloadDescription)); final TextView downloadText = ((TextView) view.findViewById(R.id.DownloadDescription));
final String template = ctx.getString(R.string.tiles_to_download_estimated_size); 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) { if (max > zoom) {
slider.setValueTo(max - zoom); slider.setValueTo(max - zoom);
int progress = (max - zoom) / 2; int progress = (max - zoom) / 2;
@ -85,7 +84,7 @@ public class DownloadTilesDialog {
slider.addOnChangeListener(new Slider.OnChangeListener() { slider.addOnChangeListener(new Slider.OnChangeListener() {
@Override @Override
public void onValueChange(@NonNull Slider slider, float value, boolean fromUser) { 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 volatile boolean cancel = false;
private IMapDownloaderCallback callback; 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; cancel = false;
int numberTiles = 0; final boolean ellipticYTile = map.isEllipticYTile();
for (int z = zoom; z <= progress + zoom; z++) { int numberTiles = getNumberTiles(zoom, progress, latlonRect, ellipticYTile);
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 ProgressDialog progressDlg = new ProgressDialog(ctx); final ProgressDialog progressDlg = new ProgressDialog(ctx);
progressDlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDlg.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDlg.setMessage(ctx.getString(R.string.shared_string_downloading)); progressDlg.setMessage(ctx.getString(R.string.shared_string_downloading));
progressDlg.setCancelable(true); progressDlg.setCancelable(true);
progressDlg.setMax(numberTiles); progressDlg.setMax(numberTiles);
progressDlg.setOnCancelListener(new DialogInterface.OnCancelListener(){ progressDlg.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
@ -152,8 +145,15 @@ public class DownloadTilesDialog {
for (int z = zoom; z <= zoom + progress && !cancel; z++) { for (int z = zoom; z <= zoom + progress && !cancel; z++) {
int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left); int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left);
int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right); int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right);
int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); int y1;
int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); 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 x = x1; x <= x2 && !cancel; x++) {
for (int y = y1; y <= y2 && !cancel; y++) { for (int y = y1; y <= y2 && !cancel; y++) {
String tileId = rm.calculateTileId(map, x, y, z); String tileId = rm.calculateTileId(map, x, y, z);
@ -178,7 +178,6 @@ public class DownloadTilesDialog {
} }
} }
} }
} }
if(cancel){ if(cancel){
instance.refuseAllPreviousRequests(); instance.refuseAllPreviousRequests();
@ -205,26 +204,34 @@ public class DownloadTilesDialog {
} }
progressDlg.dismiss(); progressDlg.dismiss();
} }
}; };
new Thread(r, "Downloading tiles").start(); //$NON-NLS-1$ new Thread(r, "Downloading tiles").start(); //$NON-NLS-1$
progressDlg.show(); 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; int numberTiles = 0;
for (int z = zoom; z <= progress + zoom; z++) { for (int z = zoom; z <= progress + zoom; z++) {
int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left); int x1 = (int) MapUtils.getTileNumberX(z, latlonRect.left);
int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right); int x2 = (int) MapUtils.getTileNumberX(z, latlonRect.right);
int y1 = (int) MapUtils.getTileNumberY(z, latlonRect.top); int y1;
int y2 = (int) MapUtils.getTileNumberY(z, latlonRect.bottom); 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); numberTiles += (x2 - x1 + 1) * (y2 - y1 + 1);
} }
downloadText.setText(MessageFormat.format(template, (progress + zoom)+"", //$NON-NLS-1$ return numberTiles;
numberTiles, (double)numberTiles*12/1000));
} }
} }

View file

@ -62,10 +62,12 @@ public class TracksCard extends BaseCard {
@SuppressLint("DefaultLocale") @SuppressLint("DefaultLocale")
@Override @Override
protected void updateContent() { protected void updateContent() {
String gpxDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR).getAbsolutePath();
final List<GpxItem> list = new ArrayList<>(); final List<GpxItem> list = new ArrayList<>();
for (GPXFile gpx : gpxFiles) { for (GPXFile gpx : gpxFiles) {
File f = new File(gpx.path); 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<GpxItem>() { Collections.sort(list, new Comparator<GpxItem>() {
@Override @Override