From 2f0a7f48a07c3e1fd8c8efe65eb5b58b67eb5ad6 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 6 Feb 2020 13:03:47 +0200 Subject: [PATCH 01/10] Fix #8303 ui logic changes --- OsmAnd/res/xml/monitoring_settings.xml | 1 + .../MonitoringSettingsFragment.java | 24 ++++++++++++++++++- .../ChangeGeneralProfilesPrefBottomSheet.java | 16 +++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/xml/monitoring_settings.xml b/OsmAnd/res/xml/monitoring_settings.xml index 6a1e03358d..d331163df4 100644 --- a/OsmAnd/res/xml/monitoring_settings.xml +++ b/OsmAnd/res/xml/monitoring_settings.xml @@ -37,6 +37,7 @@ android:key="save_global_track_interval" android:layout="@layout/preference_with_descr" android:title="@string/save_global_track_interval" + android:persistent="false" tools:icon="@drawable/ic_action_time_span" tools:summary="3 seconds" /> diff --git a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java index 08528fe019..3d856d1113 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java @@ -33,8 +33,10 @@ import static net.osmand.plus.OsmandSettings.MONTHLY_DIRECTORY; import static net.osmand.plus.OsmandSettings.REC_DIRECTORY; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS; +import static net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet.*; -public class MonitoringSettingsFragment extends BaseSettingsFragment implements CopyAppModePrefsListener, ResetAppModePrefsListener { +public class MonitoringSettingsFragment extends BaseSettingsFragment + implements CopyAppModePrefsListener, ResetAppModePrefsListener, OnApplyChanges { private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings"; private static final String RESET_TO_DEFAULT = "reset_to_default"; @@ -85,6 +87,12 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment implements ListPreferenceEx saveTrackInterval = (ListPreferenceEx) findPreference(settings.SAVE_GLOBAL_TRACK_INTERVAL.getId()); saveTrackInterval.setEntries(entry.values().toArray(new String[0])); saveTrackInterval.setEntryValues(entry.keySet().toArray()); + ApplicationMode selectedAppMode = getSelectedAppMode(); + if (!settings.SAVE_GLOBAL_TRACK_REMEMBER.getModeValue(selectedAppMode)) { + saveTrackInterval.setValue(settings.SAVE_GLOBAL_TRACK_REMEMBER.getModeValue(selectedAppMode)); + } else { + saveTrackInterval.setValue(settings.SAVE_GLOBAL_TRACK_INTERVAL.getModeValue(selectedAppMode)); + } saveTrackInterval.setIcon(getActiveIcon(R.drawable.ic_action_time_span)); saveTrackInterval.setDescription(R.string.save_global_track_interval_descr); } @@ -321,4 +329,18 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment implements updateAllSettings(); } } + + @Override + public void onApplySingleChange(String prefId) { + if (settings.SAVE_GLOBAL_TRACK_INTERVAL.getId().equals(prefId)) { + app.getSettings().setPreference(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true, getSelectedAppMode()); + } + } + + @Override + public void onApplyAllChanges(String prefId) { + if (settings.SAVE_GLOBAL_TRACK_INTERVAL.getId().equals(prefId)) { + app.getSettings().setPreferenceForAllModes(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true); + } + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java index ea0e0e914c..43986c3e5a 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java @@ -55,6 +55,10 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh @Override public void onClick(View v) { app.getSettings().setPreferenceForAllModes(prefId, newValue); + Fragment target = getTargetFragment(); + if (target instanceof OnApplyChanges) { + ((OnApplyChanges) target).onApplyAllChanges(prefId); + } updateTargetSettings(false); dismiss(); } @@ -72,6 +76,10 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh @Override public void onClick(View v) { app.getSettings().setPreference(prefId, newValue, getAppMode()); + Fragment target = getTargetFragment(); + if (target instanceof OnApplyChanges) { + ((OnApplyChanges) target).onApplySingleChange(prefId); + } updateTargetSettings(false); dismiss(); } @@ -144,4 +152,12 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh LOG.error("showInstance", e); } } + + public interface OnApplyChanges { + + void onApplySingleChange(String prefId); + + void onApplyAllChanges(String prefId); + + } } \ No newline at end of file From 0d14e5dc579cbd4e4150c5b95dc0f8f312e1cc4d Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 6 Feb 2020 15:47:50 +0200 Subject: [PATCH 02/10] Fix Configure POI Search categories --- .../bottom_sheet_item_description_long.xml | 1 + OsmAnd/res/layout/order_poi_list_item.xml | 20 +++++++++---------- OsmAnd/res/values/strings.xml | 2 +- .../src/net/osmand/plus/poi/PoiUIFilter.java | 2 +- .../plus/poi/RearrangePoiFiltersFragment.java | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/OsmAnd/res/layout/bottom_sheet_item_description_long.xml b/OsmAnd/res/layout/bottom_sheet_item_description_long.xml index d841ca0430..caa5a6ae92 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_description_long.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_description_long.xml @@ -12,4 +12,5 @@ android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" android:linksClickable="true" + android:lineSpacingMultiplier="1.25" tools:text="Some long description"/> diff --git a/OsmAnd/res/layout/order_poi_list_item.xml b/OsmAnd/res/layout/order_poi_list_item.xml index f1d493e094..fc68ff274d 100644 --- a/OsmAnd/res/layout/order_poi_list_item.xml +++ b/OsmAnd/res/layout/order_poi_list_item.xml @@ -11,20 +11,18 @@ - @@ -47,6 +45,8 @@ android:ellipsize="marquee" android:paddingLeft="@dimen/content_padding" android:paddingRight="@dimen/content_padding" + android:paddingTop="@dimen/content_padding_half" + android:paddingBottom="@dimen/content_padding_half" android:singleLine="true" android:textColor="?android:textColorPrimary" android:textSize="@dimen/default_list_text_size" @@ -56,7 +56,7 @@ Rearrange categories You can add custom categories hide categories that you don’t find necessary and change the sort order of the list. The list can be imported and exported with profiles. You can add a new custom category by selecting one or a few needed categories. - Reset to default will delete or custom categories and reset sort order to the default state after installation. + Reset to default will reset sort order to the default state after installation. Available Add custom category Show only at night diff --git a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java index 5b7ad8dc85..facbc5a6ed 100644 --- a/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java +++ b/OsmAnd/src/net/osmand/plus/poi/PoiUIFilter.java @@ -800,7 +800,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable String anotherFilterByName = another.filterByName == null ? "" : another.filterByName; return thisFilterByName.compareToIgnoreCase(anotherFilterByName); } else { - return this.name.compareTo(another.name); + return this.name.compareToIgnoreCase(another.name); } } diff --git a/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java b/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java index 01500d3007..5bb86da388 100644 --- a/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java +++ b/OsmAnd/src/net/osmand/plus/poi/RearrangePoiFiltersFragment.java @@ -212,7 +212,7 @@ public class RearrangePoiFiltersFragment extends DialogFragment { String filterByName2 = o2.filterByName == null ? "" : o2.filterByName; return filterByName1.compareToIgnoreCase(filterByName2); } else { - return o1.name.compareTo(o2.name); + return o1.name.compareToIgnoreCase(o2.name); } } }); @@ -641,7 +641,7 @@ public class RearrangePoiFiltersFragment extends DialogFragment { private TextView title; private TextView description; private ImageView icon; - private ImageButton actionIcon; + private ImageView actionIcon; private ImageView moveIcon; private View itemsContainer; From 3b4174cc9f16769cfd0d41439b181cd2bef2d5ef Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 6 Feb 2020 16:07:17 +0200 Subject: [PATCH 03/10] remove incorrect string translations --- OsmAnd/res/values-ar/strings.xml | 1 - OsmAnd/res/values-ca/strings.xml | 1 - OsmAnd/res/values-da/strings.xml | 1 - OsmAnd/res/values-eo/strings.xml | 1 - OsmAnd/res/values-es-rAR/strings.xml | 1 - OsmAnd/res/values-hu/strings.xml | 1 - OsmAnd/res/values-it/strings.xml | 1 - OsmAnd/res/values-ja/strings.xml | 1 - OsmAnd/res/values-pl/strings.xml | 1 - OsmAnd/res/values-pt-rBR/strings.xml | 1 - OsmAnd/res/values-sc/strings.xml | 1 - OsmAnd/res/values-tr/strings.xml | 1 - OsmAnd/res/values-uk/strings.xml | 1 - OsmAnd/res/values-zh-rTW/strings.xml | 1 - OsmAnd/res/values/strings.xml | 2 +- 15 files changed, 1 insertion(+), 15 deletions(-) diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml index f1bb63d704..f72650603d 100644 --- a/OsmAnd/res/values-ar/strings.xml +++ b/OsmAnd/res/values-ar/strings.xml @@ -3390,7 +3390,6 @@ إعادة ترتيب الفئات يمكنك إضافة فئات مخصصة للإخفاء التي لا تجدها ضرورية وتغيير ترتيب الفرز في القائمة. يمكن استيراد القائمة وتصديرها مع الملفات الشخصية. يمكنك إضافة فئة مخصصة جديدة عن طريق تحديد فئة أو بضع فئات مطلوبة. - ستؤدي إعادة التعيين إلى الافتراضي إلى حذف أو تخصيص الفئات وإعادة تعيين ترتيب الفرز إلى الحالة الافتراضية بعد التثبيت. متاح إضافة فئة مخصصة اظهر في الليل فقط diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index 7ef445eee6..9d6c1059e1 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -3463,7 +3463,6 @@ Abasta l\'àrea: %1$s x %2$s Reorganitza les categories Podeu afegir categories personalitzades, amagar categories que considereu innecessàries i canviar l\'ordenació de la llista. La llista es pot importar i exportar amb perfils. Podeu afegir una nova categoria personalitzada seleccionant-ne una o, si cal, alguna categoria més. - La reinicialització suprimirà les categories personalitzades i restablirà l\'ordre de l\'estat per defecte després de la instal·lació. Disponible Afegeix una categoria personalitzada Mostra només de nit diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index b4ef0ffac7..3bcb065b12 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -3473,7 +3473,6 @@ Repræsenterer område: %1$s x %2$s Omarrangere kategorier Tilføj brugerdefinerede kategorier, skjul kategorier, som ikke er nødvendige, og ændre sorteringsrækkefølgen på listen. Listen kan importeres og eksporteres med profiler. Tilføj en ny brugerdefineret kategori ved at vælge en eller nogle få nødvendige kategorier. - Nulstilling til standard sletter brugerdefinerede kategorier og nulstiller sorteringsrækkefølge til standardtilstand efter installation. Tilgængelig Tilføje brugerdefineret kategori Vis kun om natten diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml index da65e50f11..9dd3f8a99d 100644 --- a/OsmAnd/res/values-eo/strings.xml +++ b/OsmAnd/res/values-eo/strings.xml @@ -3459,7 +3459,6 @@ Indikas lokon: %1$s x %2$s" Registritaj estos nur punktoj mezuritaj kun la minimuma precizo (en metroj kiel raportitaj fare de Androido per la GPS‑cirkvitaro). Precizo rilatas al disiĝo de valoro dum ripetaj mezuroj kaj ne ĉiam rilatas al ekzakteco, kiu determinas proksimecon de mezuroj al via vera pozicio. Kromefiko: pro filtri laŭ precizo, iuj punktoj – mezuritaj ekz. sub pontoj aŭ arboj, inter altaj konstruaĵoj, aŭ dum malbonaj veteraj kondiĉoj – povos manki. Konsilo: estas malfacile antaŭscii pri kio estos registra kaj kio estos filtrita, do estus bone ne aktivigi tiun ĉi filtrilon. - Per restarigi implicitajn agordojn, propraj kategorioj foriĝos kaj ordigo revenos al la postinstalada stato. Disponebla Aldoni propran kategorion Montri nur dum nokto diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml index aea9a5e2f6..f25bd8334b 100644 --- a/OsmAnd/res/values-es-rAR/strings.xml +++ b/OsmAnd/res/values-es-rAR/strings.xml @@ -3485,7 +3485,6 @@ Lon %2$s Reordenar categorías Puedes añadir categorías personalizadas, ocultar las categorías que no parezcan necesarias y cambiar el orden de clasificación de la lista. La lista puede ser importada y exportada con perfiles. Puedes añadir una nueva categoría personalizada marcando una o varias categorías necesarias. - Si se restablece el valor predefinido, se borrarán o personalizarán las categorías y se restablecerá el orden de clasificación al estado predefinido después de la instalación. Disponible Añadir categoría personalizada Mostrar solo de noche diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml index 188bc9668b..7c02275ab0 100644 --- a/OsmAnd/res/values-hu/strings.xml +++ b/OsmAnd/res/values-hu/strings.xml @@ -3452,7 +3452,6 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük Kategóriák átrendezése Hozzáadhat egyedi kategóriát, elrejtheti a fölöslegesnek ítélt kategóriákat, és módosíthatja a lista sorrendjét. A lista a profilokkal importálható és exportálható. Egy vagy több szükséges kategória kijelölésével hozzáadhat egy egyedi kategóriát. - Az alapértelmezés visszaállítása törli az egyedi kategóriákat és visszaállítja a sorrendet a telepítés utáni alapértelmezett állapotba. Rendelkezésre áll Egyedi kategória hozzáadása Csak éjszaka jelenjék meg diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index e059b85606..96d9654c17 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -3448,7 +3448,6 @@ Rappresenta l\'area: %1$s x %2$s Sistema categorie Puoi aggiungere categorie personalizzate, nascondere quelle che non trovi necessarie e cambiarne l\'ordine nell\'elenco. La lista può essere importata ed esportata con i profili. Puoi aggiugere una nuova categoria personalizzata selezionandone una o alcune altre. - Resettando ai valori predefiniti cancellerà le categorie personalizzate e reimposterà l\'ordine allo stato predefinito dopo l\'installazione. Disponibile Aggiungi categoria personalizzata Mostra solo di notte diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml index 7e1561f8d6..6026310293 100644 --- a/OsmAnd/res/values-ja/strings.xml +++ b/OsmAnd/res/values-ja/strings.xml @@ -3479,7 +3479,6 @@ POIの更新は利用できません カテゴリーの並べ替え カスタムカテゴリーを含め、不要なカテゴリーを非表示にしたりリストの順序を変更できます。リストはプロファイルと同様インポート&エクスポートができます。 一つあるいは複数のカテゴリーを選択して、新しいカスタムカテゴリーを追加できます。 - デフォルトにリセットするとカテゴリーが削除またはカスタムされ、並び順がインストール直後の初期状態に戻ります。 利用可 カスタムカテゴリーを追加 夜にのみ表示 diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index adddad6a79..1d50859dff 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -3464,7 +3464,6 @@ Reprezentuje obszar: %1$s x %2$s Zmień układ kategorii Możesz dodać niestandardowe kategorie, ukryć kategorie, które uważasz za niepotrzebne i zmienić kolejność sortowania listy. Listę można importować i eksportować wraz z profilami. Możesz dodać nową niestandardową kategorię wybierając jedną lub kilka potrzebnych kategorii. - Przywrócenie ustawień domyślnych usunie niestandardowe kategorie i zresetuje kolejność sortowania do domyślnego stanu po instalacji. Dostępne Dodaj niestandardową kategorię Wyświetlaj tylko w nocy diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml index adf71c3464..635df44728 100644 --- a/OsmAnd/res/values-pt-rBR/strings.xml +++ b/OsmAnd/res/values-pt-rBR/strings.xml @@ -3473,7 +3473,6 @@ Pôr do Sol: %2$s Reorganizar categorias Você pode adicionar categorias personalizadas, ocultar categorias que não considera necessárias e alterar a ordem de classificação da lista. A lista pode ser importada e exportada com perfis. Você pode adicionar uma nova categoria personalizada selecionando uma ou algumas categorias necessárias. - Redefinir para padrão excluirá ou categorias personalizadas e redefinirá a ordem de classificação para o estado padrão após a instalação. Disponível Adicionar categoria personalizada Mostrar apenas à noite diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index b545eda10e..068e56cedd 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -3472,7 +3472,6 @@ Pro praghere iscrie su còdighe intreu Torra a ordinare sas categorias Podes importare categorias personalizadas, cuare categorias chi non pensas chi ti serbant e mudare s\'òrdine de sa lista. Sa lista podet èssere importada e esportada cun sos profilos. Podes annànghere una categoria personalizada noa ischertende·nde una o unas cantas pagas chi ti serbint. - Ripristinende sos valores predefinidos as a iscantzellare sas categorias personalizadas e a ripristinare s\'òrdine de sa lista torrende·lu a su valore predefinidu a pustis de s\'installatzione. Disponìbile Annanghe una categoria personalizada Ammustra a de note ebbia diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml index ac0445d812..6c60c1a9a9 100644 --- a/OsmAnd/res/values-tr/strings.xml +++ b/OsmAnd/res/values-tr/strings.xml @@ -3441,7 +3441,6 @@ Kategorileri yeniden düzenle Özel kategoriler ekleyebilir, gerekli bulmadığınız kategorileri gizleyebilir ve listenin sıralama düzenini değiştirebilirsiniz. Liste, profillerle içe ve dışa aktarılabilir. Bir veya birkaç gerekli kategori seçerek yeni bir özel kategori ekleyebilirsiniz. - Varsayılana sıfırla, özel kategorileri silecek ve sıralama düzenini kurulumdan sonraki varsayılan duruma sıfırlayacaktır. Mevcut Özel kategori ekle Sadece geceleri göster diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml index ae73320493..f05abeda89 100644 --- a/OsmAnd/res/values-uk/strings.xml +++ b/OsmAnd/res/values-uk/strings.xml @@ -3476,7 +3476,6 @@ Перевпорядкувати категорії Ви можете додати особливі приховані категорії, які вам не здаються потрібними, і змінити упорядкування списку. Список можна імпортувати та експортувати за допомогою профілів. Ви можете додати нову власну категорію, вибравши одну або кілька необхідних категорій. - Скидання до усталеного видалить користувацькі категорії, а після встановлення встановить упорядкування до усталеного стану. Доступні Додати власну категорію Показувати лише вночі diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index 8bfb433f56..26fdb6d483 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -3476,7 +3476,6 @@ 重新排列分類 您可以新增自訂的分類,隱藏您不需要的分類並變更清單順序。清單可與設定檔一起匯入與匯出。 您可以透過選取一個或多個需要的分類來新增自訂的分類。 - 重設為預設值將會刪除自訂分類並重設排序回安裝後的預設狀態。 可用 新增自訂分類 僅在夜間顯示 diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 0001ed50a1..446212e7fd 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,13 +11,13 @@ Thx - Hardy --> + Reset to default will reset sort order to the default state after installation. Use system screen timeout Disabled by default, if OsmAnd running on foreground, the screen doesn’t time out.\n\nIf enabled OsmAnd will use system timeout settings. Accessibility mode disabled in your system. Rearrange categories You can add custom categories hide categories that you don’t find necessary and change the sort order of the list. The list can be imported and exported with profiles. You can add a new custom category by selecting one or a few needed categories. - Reset to default will reset sort order to the default state after installation. Available Add custom category Show only at night From ab97a06798d0f5dfd9ca03f4357293aff0ff0151 Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 6 Feb 2020 16:13:30 +0200 Subject: [PATCH 04/10] small fixes --- OsmAnd/res/layout/bottom_sheet_item_description_long.xml | 2 +- OsmAnd/res/values/sizes.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OsmAnd/res/layout/bottom_sheet_item_description_long.xml b/OsmAnd/res/layout/bottom_sheet_item_description_long.xml index caa5a6ae92..1331d736bc 100644 --- a/OsmAnd/res/layout/bottom_sheet_item_description_long.xml +++ b/OsmAnd/res/layout/bottom_sheet_item_description_long.xml @@ -12,5 +12,5 @@ android:textColor="?android:textColorSecondary" android:textSize="@dimen/default_desc_text_size" android:linksClickable="true" - android:lineSpacingMultiplier="1.25" + android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier" tools:text="Some long description"/> diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index 0719147898..c1d1228ffa 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -256,6 +256,7 @@ 64dp 10dp 56dp + 1.25 236dp 68dp From 5be515409c61d839ec30f054121397d7a7f7387e Mon Sep 17 00:00:00 2001 From: Nazar-Kutz Date: Thu, 6 Feb 2020 16:19:38 +0200 Subject: [PATCH 05/10] small fixes p.2 --- OsmAnd/res/values/sizes.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/res/values/sizes.xml b/OsmAnd/res/values/sizes.xml index c1d1228ffa..020d67735b 100644 --- a/OsmAnd/res/values/sizes.xml +++ b/OsmAnd/res/values/sizes.xml @@ -256,7 +256,7 @@ 64dp 10dp 56dp - 1.25 + 1.25 236dp 68dp From ee1a0b2e08e263739b55ea6eb8c5426cb37ab425 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Thu, 6 Feb 2020 18:12:25 +0200 Subject: [PATCH 06/10] Fix #8029 --- .../osmand/router/RouteStatisticsHelper.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java b/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java index 3aecefa06e..4fe500de2b 100644 --- a/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java +++ b/OsmAnd-java/src/main/java/net/osmand/router/RouteStatisticsHelper.java @@ -362,24 +362,27 @@ public class RouteStatisticsHelper { RenderingRulesStorage rrs, RenderingRuleSearchRequest req, RouteSegmentWithIncline segment, int slopeClass) { //String additional = attrName + "=" + attribute; + boolean mainTagAdded = false; + StringBuilder additional = new StringBuilder(slopeClass >= 0 ? (BOUNDARIES_CLASS[slopeClass] + ";") : ""); RouteDataObject obj = segment.obj; - int[] tps = obj.getTypes(); - String additional = slopeClass >= 0 ? (BOUNDARIES_CLASS[slopeClass] + ";") : ""; - for (int k = 0; k < tps.length; k++) { - BinaryMapRouteReaderAdapter.RouteTypeRule tp = obj.region.quickGetEncodingRule(tps[k]); - if (tp.getTag().equals("highway") || tp.getTag().equals("route") || + for (int type : obj.getTypes()) { + BinaryMapRouteReaderAdapter.RouteTypeRule tp = obj.region.quickGetEncodingRule(type); + if (tp.getTag().equals("highway") || tp.getTag().equals("route") || tp.getTag().equals("railway") || tp.getTag().equals("aeroway") || tp.getTag().equals("aerialway")) { - req.setStringFilter(rrs.PROPS.R_TAG, tp.getTag()); - req.setStringFilter(rrs.PROPS.R_VALUE, tp.getValue()); + if (!mainTagAdded) { + req.setStringFilter(rrs.PROPS.R_TAG, tp.getTag()); + req.setStringFilter(rrs.PROPS.R_VALUE, tp.getValue()); + mainTagAdded = true; + } } else { - additional += tp.getTag() + "=" + tp.getValue() + ";"; + additional.append(tp.getTag()).append("=").append(tp.getValue()).append(";"); } } - req.setStringFilter(rrs.PROPS.R_ADDITIONAL, additional); + req.setStringFilter(rrs.PROPS.R_ADDITIONAL, additional.toString()); return req.searchRenderingAttribute(attribute); - } } + public static class RouteSegmentAttribute { private final int color; @@ -400,11 +403,11 @@ public class RouteStatisticsHelper { this.slopeIndex = segmentAttribute.slopeIndex; this.userPropertyName = segmentAttribute.userPropertyName; } - + public String getUserPropertyName() { return userPropertyName == null ? propertyName : userPropertyName; } - + public void setUserPropertyName(String userPropertyName) { this.userPropertyName = userPropertyName; } From 4a74ebdba9d7e71d1b818b46caca0bbc872a3607 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 6 Feb 2020 19:24:43 +0300 Subject: [PATCH 07/10] Fix #8284 --- .../main/java/net/osmand/GPXUtilities.java | 56 ++++++------------- .../src/net/osmand/data/WptLocationPoint.java | 5 +- .../osmand/plus/helpers/WaypointHelper.java | 9 ++- .../src/net/osmand/plus/views/RouteLayer.java | 38 +++++++------ 4 files changed, 50 insertions(+), 58 deletions(-) diff --git a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java index 1716464c30..d869b22eff 100644 --- a/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java +++ b/OsmAnd-java/src/main/java/net/osmand/GPXUtilities.java @@ -1785,28 +1785,25 @@ public class GPXUtilities { try { XmlPullParser parser = PlatformUtil.newXMLPullParser(); parser.setInput(getUTF8Reader(f)); + Track routeTrack = new Track(); + TrkSegment routeTrackSegment = new TrkSegment(); + routeTrack.segments.add(routeTrackSegment); Stack parserState = new Stack<>(); boolean extensionReadMode = false; - boolean parseExtension = false; - boolean endOfTrkSegment = false; + boolean routePointExtension = false; parserState.push(res); int tok; while ((tok = parser.next()) != XmlPullParser.END_DOCUMENT) { if (tok == XmlPullParser.START_TAG) { GPXExtensions parse = parserState.peek(); String tag = parser.getName(); - if (extensionReadMode && parse != null && !parseExtension) { + if (extensionReadMode && parse != null && !routePointExtension) { switch (tag.toLowerCase()) { case "routepointextension": - parseExtension = true; - Track track = new Track(); - res.tracks.add(track); - GPXExtensions parent = parserState.size() > 1 ? parserState.get(parserState.size() - 2) : null; - if (parse instanceof WptPt && parent instanceof Route) { - track.getExtensionsToWrite().putAll(parent.getExtensionsToRead()); - track.getExtensionsToWrite().putAll(parse.getExtensionsToRead()); + routePointExtension = true; + if (parse instanceof WptPt) { + parse.getExtensionsToWrite().put("offset", routeTrackSegment.points.size() + ""); } - parserState.push(track); break; default: @@ -1829,6 +1826,12 @@ public class GPXUtilities { } } else if (parse != null && tag.equals("extensions")) { extensionReadMode = true; + } else if (routePointExtension) { + if (tag.equals("rpt")) { + WptPt wptPt = parseWptAttributes(parser); + routeTrackSegment.points.add(wptPt); + parserState.push(wptPt); + } } else { if (parse instanceof GPXFile) { if (tag.equals("gpx")) { @@ -1934,16 +1937,6 @@ public class GPXUtilities { ((Track) parse).segments.add(trkSeg); parserState.push(trkSeg); } - if (tag.equals("rpt")) { - endOfTrkSegment = false; - TrkSegment trkSeg = new TrkSegment(); - ((Track) parse).segments.add(trkSeg); - parserState.push(trkSeg); - WptPt wptPt = parseWptAttributes(parser); - parse = parserState.peek(); - ((TrkSegment) parse).points.add(wptPt); - parserState.push(wptPt); - } } else if (parse instanceof TrkSegment) { if (tag.equals("trkpt") || tag.equals("rpt")) { WptPt wptPt = parseWptAttributes(parser); @@ -2012,8 +2005,6 @@ public class GPXUtilities { } else if (tag.equals("time")) { String text = readText(parser, "time"); ((WptPt) parse).time = parseTime(text, format, formatMillis); - } else if (tag.toLowerCase().equals("subclass")) { - endOfTrkSegment = true; } } } @@ -2023,9 +2014,7 @@ public class GPXUtilities { String tag = parser.getName(); if (tag.toLowerCase().equals("routepointextension")) { - parseExtension = false; - Object pop = parserState.pop(); - assert pop instanceof Track; + routePointExtension = false; } if (parse != null && tag.equals("extensions")) { extensionReadMode = false; @@ -2067,25 +2056,16 @@ public class GPXUtilities { } else if (tag.equals("rpt")) { Object pop = parserState.pop(); assert pop instanceof WptPt; - if (endOfTrkSegment) { - Object popSegment = parserState.pop(); - if (popSegment instanceof TrkSegment) { - List segments = res.tracks.get(res.tracks.size() - 1).segments; - int last = segments.size() - 1; - if (!Algorithms.isEmpty(segments) && segments.get(last).points.size() < 2) { - segments.remove(last); - } - } - endOfTrkSegment = false; - } } } } + if (!routeTrackSegment.points.isEmpty()) { + res.tracks.add(routeTrack); + } } catch (Exception e) { res.error = e; log.error("Error reading gpx", e); //$NON-NLS-1$ } - return res; } diff --git a/OsmAnd/src/net/osmand/data/WptLocationPoint.java b/OsmAnd/src/net/osmand/data/WptLocationPoint.java index 6ab3bfecec..52c30d54b3 100644 --- a/OsmAnd/src/net/osmand/data/WptLocationPoint.java +++ b/OsmAnd/src/net/osmand/data/WptLocationPoint.java @@ -12,7 +12,6 @@ public class WptLocationPoint implements LocationPoint { this.pt = p; } - @Override public double getLatitude() { return pt.lat; @@ -36,4 +35,8 @@ public class WptLocationPoint implements LocationPoint { public PointDescription getPointDescription(Context ctx) { return new PointDescription(PointDescription.POINT_TYPE_WPT, pt.name); } + + public GPXUtilities.WptPt getPt() { + return pt; + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java index d37361d853..7f51847964 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java +++ b/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java @@ -13,6 +13,7 @@ import net.osmand.data.Amenity.AmenityRoutePoint; import net.osmand.data.FavouritePoint; import net.osmand.data.LocationPoint; import net.osmand.data.PointDescription; +import net.osmand.data.WptLocationPoint; import net.osmand.osm.PoiType; import net.osmand.plus.ApplicationMode; import net.osmand.plus.OsmAndFormatter; @@ -774,7 +775,13 @@ public class WaypointHelper { } else if (type == FAVORITES ) { return FavoriteImageDrawable.getOrCreate(uiCtx, point.getColor(), false, (FavouritePoint) point); } else if (type == WAYPOINTS) { - return FavoriteImageDrawable.getOrCreate(uiCtx, point.getColor(), false, (GPXUtilities.WptPt) point); + if (point instanceof WptLocationPoint) { + return FavoriteImageDrawable.getOrCreate(uiCtx, point.getColor(), false, ((WptLocationPoint) point).getPt()); + } else if (point instanceof GPXUtilities.WptPt) { + return FavoriteImageDrawable.getOrCreate(uiCtx, point.getColor(), false, (GPXUtilities.WptPt) point); + } else { + return null; + } } else if (type == ALARMS) { //assign alarm list icons manually for now String typeString = ((AlarmInfo) point).getType().toString(); diff --git a/OsmAnd/src/net/osmand/plus/views/RouteLayer.java b/OsmAnd/src/net/osmand/plus/views/RouteLayer.java index 2c0b5727d2..6475fa6d78 100644 --- a/OsmAnd/src/net/osmand/plus/views/RouteLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/RouteLayer.java @@ -233,24 +233,26 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont private void drawXAxisPoints(Canvas canvas, RotatedTileBox tileBox) { QuadRect latLonBounds = tileBox.getLatLonBounds(); List xAxisPoints = trackChartPoints.getXAxisPoints(); - float r = 3 * tileBox.getDensity(); - float density = (float) Math.ceil(tileBox.getDensity()); - float outerRadius = r + 2 * density; - float innerRadius = r + density; - QuadRect prevPointRect = null; - for (int i = 0; i < xAxisPoints.size(); i++) { - LatLon axisPoint = xAxisPoints.get(i); - if (axisPoint.getLatitude() >= latLonBounds.bottom - && axisPoint.getLatitude() <= latLonBounds.top - && axisPoint.getLongitude() >= latLonBounds.left - && axisPoint.getLongitude() <= latLonBounds.right) { - float x = tileBox.getPixXFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); - float y = tileBox.getPixYFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); - QuadRect pointRect = new QuadRect(x - outerRadius, y - outerRadius, x + outerRadius, y + outerRadius); - if (prevPointRect == null || !QuadRect.intersects(prevPointRect, pointRect)) { - canvas.drawCircle(x, y, outerRadius, paintGridOuterCircle); - canvas.drawCircle(x, y, innerRadius, paintGridCircle); - prevPointRect = pointRect; + if (xAxisPoints != null) { + float r = 3 * tileBox.getDensity(); + float density = (float) Math.ceil(tileBox.getDensity()); + float outerRadius = r + 2 * density; + float innerRadius = r + density; + QuadRect prevPointRect = null; + for (int i = 0; i < xAxisPoints.size(); i++) { + LatLon axisPoint = xAxisPoints.get(i); + if (axisPoint.getLatitude() >= latLonBounds.bottom + && axisPoint.getLatitude() <= latLonBounds.top + && axisPoint.getLongitude() >= latLonBounds.left + && axisPoint.getLongitude() <= latLonBounds.right) { + float x = tileBox.getPixXFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); + float y = tileBox.getPixYFromLatLon(axisPoint.getLatitude(), axisPoint.getLongitude()); + QuadRect pointRect = new QuadRect(x - outerRadius, y - outerRadius, x + outerRadius, y + outerRadius); + if (prevPointRect == null || !QuadRect.intersects(prevPointRect, pointRect)) { + canvas.drawCircle(x, y, outerRadius, paintGridOuterCircle); + canvas.drawCircle(x, y, innerRadius, paintGridCircle); + prevPointRect = pointRect; + } } } } From 5d74129eddab0abe9656ed52a7a1cfff2515f0d8 Mon Sep 17 00:00:00 2001 From: Dima-1 Date: Thu, 6 Feb 2020 19:35:23 +0200 Subject: [PATCH 08/10] Fix 8303 ui logic changes fix remarks --- .../MonitoringSettingsFragment.java | 17 +++++------- .../plus/settings/BaseSettingsFragment.java | 3 +++ .../ChangeGeneralProfilesPrefBottomSheet.java | 27 +++++-------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java index 39f51ef2b3..f1b46ac35c 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java @@ -37,11 +37,10 @@ import static net.osmand.plus.OsmandSettings.MONTHLY_DIRECTORY; import static net.osmand.plus.OsmandSettings.REC_DIRECTORY; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES; import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS; -import static net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet.*; import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID; public class MonitoringSettingsFragment extends BaseSettingsFragment - implements CopyAppModePrefsListener, ResetAppModePrefsListener, OnApplyChanges { + implements CopyAppModePrefsListener, ResetAppModePrefsListener { private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings"; private static final String RESET_TO_DEFAULT = "reset_to_default"; @@ -343,16 +342,14 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment } @Override - public void onApplySingleChange(String prefId) { + public void applySetting(String prefId, boolean applyToAllProfiles) { if (settings.SAVE_GLOBAL_TRACK_INTERVAL.getId().equals(prefId)) { - app.getSettings().setPreference(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true, getSelectedAppMode()); - } - } + if (applyToAllProfiles) { + app.getSettings().setPreferenceForAllModes(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true); + } else { + app.getSettings().setPreference(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true, getSelectedAppMode()); + } - @Override - public void onApplyAllChanges(String prefId) { - if (settings.SAVE_GLOBAL_TRACK_INTERVAL.getId().equals(prefId)) { - app.getSettings().setPreferenceForAllModes(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true); } } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java index 66de62f708..954329b119 100644 --- a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java @@ -545,6 +545,9 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl updateAllSettings(); } + public void applySetting(String prefId, boolean applyToAllProfiles){ + } + public void updateAllSettings() { PreferenceScreen screen = getPreferenceScreen(); if (screen != null) { diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java index 43986c3e5a..d297382688 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java @@ -55,11 +55,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh @Override public void onClick(View v) { app.getSettings().setPreferenceForAllModes(prefId, newValue); - Fragment target = getTargetFragment(); - if (target instanceof OnApplyChanges) { - ((OnApplyChanges) target).onApplyAllChanges(prefId); - } - updateTargetSettings(false); + updateTargetSettings(false, true); dismiss(); } }) @@ -76,11 +72,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh @Override public void onClick(View v) { app.getSettings().setPreference(prefId, newValue, getAppMode()); - Fragment target = getTargetFragment(); - if (target instanceof OnApplyChanges) { - ((OnApplyChanges) target).onApplySingleChange(prefId); - } - updateTargetSettings(false); + updateTargetSettings(false, false); dismiss(); } }) @@ -94,7 +86,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh .setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - updateTargetSettings(true); + updateTargetSettings(true, false); dismiss(); } }) @@ -113,9 +105,12 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh outState.putSerializable(NEW_VALUE_KEY, newValue); } - private void updateTargetSettings(boolean discard) { + private void updateTargetSettings(boolean discard, boolean applyToAllProfiles) { BaseSettingsFragment target = (BaseSettingsFragment) getTargetFragment(); if (target != null) { + if (!discard) { + target.applySetting(getPrefId(), applyToAllProfiles); + } target.updateSetting(getPrefId()); if (!discard) { if (target.shouldDismissOnChange()) { @@ -152,12 +147,4 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh LOG.error("showInstance", e); } } - - public interface OnApplyChanges { - - void onApplySingleChange(String prefId); - - void onApplyAllChanges(String prefId); - - } } \ No newline at end of file From fa8479abbe7d8a246bbe76433e3c9f1701d38e77 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 6 Feb 2020 21:09:25 +0300 Subject: [PATCH 09/10] Rename applySetting --- .../osmand/plus/monitoring/MonitoringSettingsFragment.java | 4 ++-- OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java | 2 +- .../bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java index f1b46ac35c..409eb695ea 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java @@ -342,9 +342,9 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment } @Override - public void applySetting(String prefId, boolean applyToAllProfiles) { + public void onSettingApplied(String prefId, boolean appliedToAllProfiles) { if (settings.SAVE_GLOBAL_TRACK_INTERVAL.getId().equals(prefId)) { - if (applyToAllProfiles) { + if (appliedToAllProfiles) { app.getSettings().setPreferenceForAllModes(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true); } else { app.getSettings().setPreference(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true, getSelectedAppMode()); diff --git a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java index 954329b119..d53bb0cd81 100644 --- a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java @@ -545,7 +545,7 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl updateAllSettings(); } - public void applySetting(String prefId, boolean applyToAllProfiles){ + public void onSettingApplied(String prefId, boolean appliedToAllProfiles) { } public void updateAllSettings() { diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java index d297382688..f4851ab5a6 100644 --- a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/ChangeGeneralProfilesPrefBottomSheet.java @@ -105,11 +105,11 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh outState.putSerializable(NEW_VALUE_KEY, newValue); } - private void updateTargetSettings(boolean discard, boolean applyToAllProfiles) { + private void updateTargetSettings(boolean discard, boolean appliedToAllProfiles) { BaseSettingsFragment target = (BaseSettingsFragment) getTargetFragment(); if (target != null) { if (!discard) { - target.applySetting(getPrefId(), applyToAllProfiles); + target.onSettingApplied(getPrefId(), appliedToAllProfiles); } target.updateSetting(getPrefId()); if (!discard) { From b83fc093e6a130def92168100204536fece11a78 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 6 Feb 2020 21:25:05 +0300 Subject: [PATCH 10/10] Fix #8386 --- OsmAnd/src/net/osmand/plus/download/DownloadActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index ce3738ff49..a43c7f7ce9 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -671,7 +671,7 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo if (dir.canRead()) { StatFs fs = new StatFs(dir.getAbsolutePath()); size = AndroidUtils.formatSize(activity, ((long)fs.getAvailableBlocks()) * fs.getBlockSize()); - percent = 100 - fs.getAvailableBlocks() * 100 / fs.getBlockCount(); + percent = 100 - (int)((long)fs.getAvailableBlocks() * 100 / fs.getBlockCount()); } sizeProgress.setIndeterminate(false); sizeProgress.setProgress(percent);