Merge branch 'master' into Fix_7752

This commit is contained in:
Dima-1 2020-02-07 12:53:35 +02:00
commit 319f74b64a
30 changed files with 113 additions and 104 deletions

View file

@ -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<GPXExtensions> 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<TrkSegment> 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;
}

View file

@ -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]);
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")) {
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;

View file

@ -12,4 +12,5 @@
android:textColor="?android:textColorSecondary"
android:textSize="@dimen/default_desc_text_size"
android:linksClickable="true"
android:lineSpacingMultiplier="@dimen/bottom_sheet_text_spacing_multiplier"
tools:text="Some long description"/>

View file

@ -11,20 +11,18 @@
<LinearLayout
android:id="@+id/selectable_list_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/content_padding_half"
android:paddingBottom="@dimen/content_padding_half"
android:layout_height="match_parent"
android:orientation="horizontal"
tools:background="?android:attr/selectableItemBackground">
<ImageButton
<ImageView
android:id="@+id/action_icon"
style="@style/Widget.AppCompat.ActionButton"
android:layout_width="@dimen/standard_icon_size"
android:layout_height="@dimen/standard_icon_size"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/content_padding"
android:layout_marginRight="@dimen/content_padding"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"
android:minHeight="@dimen/bottom_sheet_list_item_height"
tools:src="@drawable/ic_action_remove"
tools:tint="@color/icon_color_default_light" />
@ -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 @@
<ImageView
android:id="@+id/move_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingLeft="@dimen/content_padding"
android:paddingRight="@dimen/content_padding"

View file

@ -3390,7 +3390,6 @@
<string name="rearrange_categories">إعادة ترتيب الفئات</string>
<string name="create_custom_categories_list_promo">يمكنك إضافة فئات مخصصة للإخفاء التي لا تجدها ضرورية وتغيير ترتيب الفرز في القائمة. يمكن استيراد القائمة وتصديرها مع الملفات الشخصية.</string>
<string name="add_new_custom_category_button_promo">يمكنك إضافة فئة مخصصة جديدة عن طريق تحديد فئة أو بضع فئات مطلوبة.</string>
<string name="reset_to_default_category_button_promo">ستؤدي إعادة التعيين إلى الافتراضي إلى حذف أو تخصيص الفئات وإعادة تعيين ترتيب الفرز إلى الحالة الافتراضية بعد التثبيت.</string>
<string name="shared_string_available">متاح</string>
<string name="add_custom_category">إضافة فئة مخصصة</string>
<string name="rendering_attr_streetLightingNight_name">اظهر في الليل فقط</string>

View file

@ -3463,7 +3463,6 @@ Abasta l\'àrea: %1$s x %2$s</string>
<string name="rearrange_categories">Reorganitza les categories</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Podeu afegir una nova categoria personalitzada seleccionant-ne una o, si cal, alguna categoria més.</string>
<string name="reset_to_default_category_button_promo">La reinicialització suprimirà les categories personalitzades i restablirà l\'ordre de l\'estat per defecte després de la instal·lació.</string>
<string name="shared_string_available">Disponible</string>
<string name="add_custom_category">Afegeix una categoria personalitzada</string>
<string name="rendering_attr_streetLightingNight_name">Mostra només de nit</string>

View file

@ -3473,7 +3473,6 @@ Repræsenterer område: %1$s x %2$s</string>
<string name="rearrange_categories">Omarrangere kategorier</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Tilføj en ny brugerdefineret kategori ved at vælge en eller nogle få nødvendige kategorier.</string>
<string name="reset_to_default_category_button_promo">Nulstilling til standard sletter brugerdefinerede kategorier og nulstiller sorteringsrækkefølge til standardtilstand efter installation.</string>
<string name="shared_string_available">Tilgængelig</string>
<string name="add_custom_category">Tilføje brugerdefineret kategori</string>
<string name="rendering_attr_streetLightingNight_name">Vis kun om natten</string>

View file

@ -3459,7 +3459,6 @@ Indikas lokon: %1$s x %2$s"</string>
<string name="monitoring_min_accuracy_descr">Registritaj estos nur punktoj mezuritaj kun la minimuma precizo (en metroj kiel raportitaj fare de Androido per la GPScirkvitaro). 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.</string>
<string name="monitoring_min_accuracy_descr_side_effect">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.</string>
<string name="monitoring_min_accuracy_descr_recommendation">Konsilo: estas malfacile antaŭscii pri kio estos registra kaj kio estos filtrita, do estus bone ne aktivigi tiun ĉi filtrilon.</string>
<string name="reset_to_default_category_button_promo">Per restarigi implicitajn agordojn, propraj kategorioj foriĝos kaj ordigo revenos al la postinstalada stato.</string>
<string name="shared_string_available">Disponebla</string>
<string name="add_custom_category">Aldoni propran kategorion</string>
<string name="rendering_attr_streetLightingNight_name">Montri nur dum nokto</string>

View file

@ -3485,7 +3485,6 @@ Lon %2$s</string>
<string name="rearrange_categories">Reordenar categorías</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Puedes añadir una nueva categoría personalizada marcando una o varias categorías necesarias.</string>
<string name="reset_to_default_category_button_promo">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.</string>
<string name="shared_string_available">Disponible</string>
<string name="add_custom_category">Añadir categoría personalizada</string>
<string name="rendering_attr_streetLightingNight_name">Mostrar solo de noche</string>

View file

@ -3452,7 +3452,6 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
<string name="rearrange_categories">Kategóriák átrendezése</string>
<string name="create_custom_categories_list_promo">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ó.</string>
<string name="add_new_custom_category_button_promo">Egy vagy több szükséges kategória kijelölésével hozzáadhat egy egyedi kategóriát.</string>
<string name="reset_to_default_category_button_promo">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.</string>
<string name="shared_string_available">Rendelkezésre áll</string>
<string name="add_custom_category">Egyedi kategória hozzáadása</string>
<string name="rendering_attr_streetLightingNight_name">Csak éjszaka jelenjék meg</string>

View file

@ -3448,7 +3448,6 @@ Rappresenta l\'area: %1$s x %2$s</string>
<string name="rearrange_categories">Sistema categorie</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Puoi aggiugere una nuova categoria personalizzata selezionandone una o alcune altre.</string>
<string name="reset_to_default_category_button_promo">Resettando ai valori predefiniti cancellerà le categorie personalizzate e reimposterà l\'ordine allo stato predefinito dopo l\'installazione.</string>
<string name="shared_string_available">Disponibile</string>
<string name="add_custom_category">Aggiungi categoria personalizzata</string>
<string name="rendering_attr_streetLightingNight_name">Mostra solo di notte</string>

View file

@ -3479,7 +3479,6 @@ POIの更新は利用できません</string>
<string name="rearrange_categories">カテゴリーの並べ替え</string>
<string name="create_custom_categories_list_promo">カスタムカテゴリーを含め、不要なカテゴリーを非表示にしたりリストの順序を変更できます。リストはプロファイルと同様インポート&エクスポートができます。</string>
<string name="add_new_custom_category_button_promo">一つあるいは複数のカテゴリーを選択して、新しいカスタムカテゴリーを追加できます。</string>
<string name="reset_to_default_category_button_promo">デフォルトにリセットするとカテゴリーが削除またはカスタムされ、並び順がインストール直後の初期状態に戻ります。</string>
<string name="shared_string_available">利用可</string>
<string name="add_custom_category">カスタムカテゴリーを追加</string>
<string name="rendering_attr_streetLightingNight_name">夜にのみ表示</string>

View file

@ -3464,7 +3464,6 @@ Reprezentuje obszar: %1$s x %2$s</string>
<string name="rearrange_categories">Zmień układ kategorii</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Możesz dodać nową niestandardową kategorię wybierając jedną lub kilka potrzebnych kategorii.</string>
<string name="reset_to_default_category_button_promo">Przywrócenie ustawień domyślnych usunie niestandardowe kategorie i zresetuje kolejność sortowania do domyślnego stanu po instalacji.</string>
<string name="shared_string_available">Dostępne</string>
<string name="add_custom_category">Dodaj niestandardową kategorię</string>
<string name="rendering_attr_streetLightingNight_name">Wyświetlaj tylko w nocy</string>

View file

@ -3473,7 +3473,6 @@ Pôr do Sol: %2$s</string>
<string name="rearrange_categories">Reorganizar categorias</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Você pode adicionar uma nova categoria personalizada selecionando uma ou algumas categorias necessárias.</string>
<string name="reset_to_default_category_button_promo">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.</string>
<string name="shared_string_available">Disponível</string>
<string name="add_custom_category">Adicionar categoria personalizada</string>
<string name="rendering_attr_streetLightingNight_name">Mostrar apenas à noite</string>

View file

@ -3472,7 +3472,6 @@ Pro praghere iscrie su còdighe intreu</string>
<string name="rearrange_categories">Torra a ordinare sas categorias</string>
<string name="create_custom_categories_list_promo">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.</string>
<string name="add_new_custom_category_button_promo">Podes annànghere una categoria personalizada noa ischertende·nde una o unas cantas pagas chi ti serbint.</string>
<string name="reset_to_default_category_button_promo">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.</string>
<string name="shared_string_available">Disponìbile</string>
<string name="add_custom_category">Annanghe una categoria personalizada</string>
<string name="rendering_attr_streetLightingNight_name">Ammustra a de note ebbia</string>

View file

@ -3441,7 +3441,6 @@
<string name="rearrange_categories">Kategorileri yeniden düzenle</string>
<string name="create_custom_categories_list_promo">Ö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.</string>
<string name="add_new_custom_category_button_promo">Bir veya birkaç gerekli kategori seçerek yeni bir özel kategori ekleyebilirsiniz.</string>
<string name="reset_to_default_category_button_promo">Varsayılana sıfırla, özel kategorileri silecek ve sıralama düzenini kurulumdan sonraki varsayılan duruma sıfırlayacaktır.</string>
<string name="shared_string_available">Mevcut</string>
<string name="add_custom_category">Özel kategori ekle</string>
<string name="rendering_attr_streetLightingNight_name">Sadece geceleri göster</string>

View file

@ -3476,7 +3476,6 @@
<string name="rearrange_categories">Перевпорядкувати категорії</string>
<string name="create_custom_categories_list_promo">Ви можете додати особливі приховані категорії, які вам не здаються потрібними, і змінити упорядкування списку. Список можна імпортувати та експортувати за допомогою профілів.</string>
<string name="add_new_custom_category_button_promo">Ви можете додати нову власну категорію, вибравши одну або кілька необхідних категорій.</string>
<string name="reset_to_default_category_button_promo">Скидання до усталеного видалить користувацькі категорії, а після встановлення встановить упорядкування до усталеного стану.</string>
<string name="shared_string_available">Доступні</string>
<string name="add_custom_category">Додати власну категорію</string>
<string name="rendering_attr_streetLightingNight_name">Показувати лише вночі</string>

View file

@ -3476,7 +3476,6 @@
<string name="rearrange_categories">重新排列分類</string>
<string name="create_custom_categories_list_promo">您可以新增自訂的分類,隱藏您不需要的分類並變更清單順序。清單可與設定檔一起匯入與匯出。</string>
<string name="add_new_custom_category_button_promo">您可以透過選取一個或多個需要的分類來新增自訂的分類。</string>
<string name="reset_to_default_category_button_promo">重設為預設值將會刪除自訂分類並重設排序回安裝後的預設狀態。</string>
<string name="shared_string_available">可用</string>
<string name="add_custom_category">新增自訂分類</string>
<string name="rendering_attr_streetLightingNight_name">僅在夜間顯示</string>

View file

@ -256,6 +256,7 @@
<dimen name="bottom_sheet_divider_margin_start">64dp</dimen>
<dimen name="bottom_sheet_image_text_margin_start">10dp</dimen>
<dimen name="bottom_sheet_selected_item_title_height">56dp</dimen>
<dimen name="bottom_sheet_text_spacing_multiplier" format="float">1.25</dimen>
<dimen name="action_bar_image_width_land">236dp</dimen>
<dimen name="action_bar_image_top_margin_land">68dp</dimen>

View file

@ -11,13 +11,13 @@
Thx - Hardy
-->
<string name="reset_to_default_category_button_promo">Reset to default will reset sort order to the default state after installation.</string>
<string name="use_system_screen_timeout">Use system screen timeout</string>
<string name="use_system_screen_timeout_promo">Disabled by default, if OsmAnd running on foreground, the screen doesnt time out.\n\nIf enabled OsmAnd will use system timeout settings.</string>
<string name="accessibility_mode_disabled">Accessibility mode disabled in your system.</string>
<string name="rearrange_categories">Rearrange categories</string>
<string name="create_custom_categories_list_promo">You can add custom categories hide categories that you dont find necessary and change the sort order of the list. The list can be imported and exported with profiles.</string>
<string name="add_new_custom_category_button_promo">You can add a new custom category by selecting one or a few needed categories.</string>
<string name="reset_to_default_category_button_promo">Reset to default will delete or custom categories and reset sort order to the default state after installation.</string>
<string name="shared_string_available">Available</string>
<string name="add_custom_category">Add custom category</string>
<string name="rendering_attr_streetLightingNight_name">Show only at night</string>

View file

@ -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" />

View file

@ -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;
}
}

View file

@ -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);

View file

@ -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) {
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();

View file

@ -39,7 +39,8 @@ import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS;
import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID;
public class MonitoringSettingsFragment extends BaseSettingsFragment implements CopyAppModePrefsListener, ResetAppModePrefsListener {
public class MonitoringSettingsFragment extends BaseSettingsFragment
implements CopyAppModePrefsListener, ResetAppModePrefsListener {
private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
private static final String RESET_TO_DEFAULT = "reset_to_default";
@ -90,6 +91,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);
}
@ -333,4 +340,16 @@ public class MonitoringSettingsFragment extends BaseSettingsFragment implements
updateAllSettings();
}
}
@Override
public void onSettingApplied(String prefId, boolean appliedToAllProfiles) {
if (settings.SAVE_GLOBAL_TRACK_INTERVAL.getId().equals(prefId)) {
if (appliedToAllProfiles) {
app.getSettings().setPreferenceForAllModes(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true);
} else {
app.getSettings().setPreference(settings.SAVE_GLOBAL_TRACK_REMEMBER.getId(), true, getSelectedAppMode());
}
}
}
}

View file

@ -800,7 +800,7 @@ public class PoiUIFilter implements SearchPoiTypeFilter, Comparable<PoiUIFilter>
String anotherFilterByName = another.filterByName == null ? "" : another.filterByName;
return thisFilterByName.compareToIgnoreCase(anotherFilterByName);
} else {
return this.name.compareTo(another.name);
return this.name.compareToIgnoreCase(another.name);
}
}

View file

@ -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;

View file

@ -545,6 +545,9 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
updateAllSettings();
}
public void onSettingApplied(String prefId, boolean appliedToAllProfiles) {
}
public void updateAllSettings() {
PreferenceScreen screen = getPreferenceScreen();
if (screen != null) {

View file

@ -55,7 +55,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh
@Override
public void onClick(View v) {
app.getSettings().setPreferenceForAllModes(prefId, newValue);
updateTargetSettings(false);
updateTargetSettings(false, true);
dismiss();
}
})
@ -72,7 +72,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh
@Override
public void onClick(View v) {
app.getSettings().setPreference(prefId, newValue, getAppMode());
updateTargetSettings(false);
updateTargetSettings(false, false);
dismiss();
}
})
@ -86,7 +86,7 @@ public class ChangeGeneralProfilesPrefBottomSheet extends BasePreferenceBottomSh
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
updateTargetSettings(true);
updateTargetSettings(true, false);
dismiss();
}
})
@ -105,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 appliedToAllProfiles) {
BaseSettingsFragment target = (BaseSettingsFragment) getTargetFragment();
if (target != null) {
if (!discard) {
target.onSettingApplied(getPrefId(), appliedToAllProfiles);
}
target.updateSetting(getPrefId());
if (!discard) {
if (target.shouldDismissOnChange()) {

View file

@ -233,6 +233,7 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont
private void drawXAxisPoints(Canvas canvas, RotatedTileBox tileBox) {
QuadRect latLonBounds = tileBox.getLatLonBounds();
List<LatLon> xAxisPoints = trackChartPoints.getXAxisPoints();
if (xAxisPoints != null) {
float r = 3 * tileBox.getDensity();
float density = (float) Math.ceil(tileBox.getDensity());
float outerRadius = r + 2 * density;
@ -255,6 +256,7 @@ public class RouteLayer extends OsmandMapLayer implements ContextMenuLayer.ICont
}
}
}
}
@Override
public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {}