This commit is contained in:
xmd5a 2015-02-28 17:27:11 +03:00
commit 01752750c2
33 changed files with 321 additions and 366 deletions

View file

@ -67,7 +67,7 @@ public class BinaryInspector {
// "-vstreets", "-vbuildings", "-vintersections",
// "-zoom=16",
// "-bbox=1.74,51.17,1.75,51.16",
// "/home/victor/projects/osmand/osm-gen/Map.obf"
// "/Users/victorshcherb/osmand/osm-gen/World_seamarks_2.obf"
});
} else {
in.inspector(args);

View file

@ -1,11 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6
org.eclipse.jdt.core.compiler.source=1.7

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -34,6 +34,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/card_bg"
android:visibility="gone"
android:orientation="vertical">
<LinearLayout

View file

@ -17,6 +17,27 @@
android:layout_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/check_local_index"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:visibility="gone"
android:layout_marginLeft="@dimen/local_index_check_right_margin"
android:layout_marginTop="@dimen/favorites_icon_top_margin"/>
<ImageView
android:id="@+id/icon"
android:src="@drawable/ic_gpx_track"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginLeft="@dimen/list_content_padding"
android:layout_marginTop="@dimen/favorites_icon_top_margin"
android:focusable="false"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -36,6 +57,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/read_section"
android:visibility="visible"
android:orientation="horizontal">
<ImageView
@ -43,25 +66,28 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/gpx_small_icon_margin"
android:src="@drawable/ic_small_point"/>
<TextView
android:id="@+id/points_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/gpx_small_text_margin"
android:textColor="@color/icon_color_light"/>
<ImageView
android:id="@+id/distance_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/gpx_small_icon_margin"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dashPluginMargin"
android:src="@drawable/ic_small_distance"/>
<TextView
android:id="@+id/distance"
android:layout_width="wrap_content"
android:layout_marginRight="@dimen/gpx_small_text_margin"
android:layout_height="wrap_content"
android:textColor="@color/icon_color_light"/>
@ -70,37 +96,73 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/gpx_small_icon_margin"
android:src="@drawable/ic_small_time"/>
<TextView
android:id="@+id/time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/gpx_small_text_margin"
android:textColor="@color/icon_color_light"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/unknown_section"
android:visibility="gone"
android:orientation="horizontal">
<TextView
android:id="@+id/date_and_size_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/icon_color_light"/>
</LinearLayout>
<TextView
android:id="@+id/description"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:textColorPrimary"/>
</LinearLayout>
<ImageButton
android:id="@+id/stop"
android:visibility="gone"
android:layout_width="@dimen/dashListItemHeight"
android:layout_height="@dimen/dashListItemHeight"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:background="?attr/options_button_background"
android:src="@drawable/ic_action_rec_stop"
android:visibility="gone"
tools:visibility="visible"/>
<ImageButton
android:id="@+id/show_on_map"
android:visibility="gone"
android:layout_width="@dimen/dashListItemHeight"
android:layout_height="@dimen/dashListItemHeight"
android:layout_gravity="center_vertical"
android:background="?attr/options_button_background"
android:src="@drawable/ic_action_gsave_dark"/>
<ImageButton
android:id="@+id/options"
android:visibility="gone"
android:layout_width="@dimen/list_item_height"
android:layout_height="@dimen/list_item_height"
android:background="?attr/options_button_background"
android:focusable="false"
android:src="?attr/list_settings_icon"/>
<!--
<include layout="@layout/check_item_rel" />
-->
</LinearLayout>

View file

@ -19,7 +19,7 @@
<ImageView
android:id="@+id/icon"
android:src="@drawable/ic_sdcard"
android:src="@drawable/ic_gpx_track"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/favorites_icon_right_margin"

View file

@ -20,6 +20,6 @@
android:id="@+id/bottomControls"
android:background="?attr/bottomToolBarColor"
android:layout_width="fill_parent"
android:layout_height="@dimen/bottom_tool_bar_size"/>
android:layout_height="wrap_content"/>
</LinearLayout>

View file

@ -139,14 +139,14 @@
<string name="poi_public_transport_platform">Прыпынак грамадзкага транспарту</string>
<string name="poi_public_transport_platform_bus">Прыпынак аўтобусу</string>
<string name="poi_public_transport_platform_trolleybus">Прыпынак тралейбусу</string>
<string name="poi_bus_stop">Прыпынак аўтобусу (састар.)</string>
<string name="poi_bus_stop">Аўтобусны прыпынак</string>
<string name="poi_public_transport_platform_tram">Прыпынак трамваю</string>
<string name="poi_shop_tea">Чайная крама</string>
<string name="poi_tram_stop">Прыпынак трамваю (састар.)</string>
<string name="poi_tram_stop">Трамвайны прыпынак</string>
<string name="poi_public_transport_station">Станцыя грамадзкага транспарту</string>
<string name="poi_bus_station">Аўтобусная станцыя (састар.)</string>
<string name="poi_railway_station">Чыгуначная станцыя (састар.)</string>
<string name="poi_railway_platform">Чыгуначная плятформа (састар.)</string>
<string name="poi_bus_station">Аўтобусная станцыя</string>
<string name="poi_railway_station">Чыгуначная станцыя</string>
<string name="poi_railway_platform">Чыгуначная плятформа</string>
<string name="poi_railway_halt">Чыгуначная плятформа (састар.)</string>
<string name="poi_subway_entrance">Уваход у мэтро</string>
<string name="poi_subway_station">Станцыя мэтро</string>
@ -673,7 +673,7 @@
<string name="poi_car_parts">Аўтазапчасткі</string>
<string name="poi_public_transport_stop_position">Месца прыпынку грамадзкага транспарту</string>
<string name="poi_halt">Чыгуначны прыпынак (састарэла)</string>
<string name="poi_halt">Чыгуначны прыпынак</string>
<string name="poi_internet_access_wlan">Доступ у Інтэрнэт: WLAN</string>
<string name="poi_internet_access_terminal">Доступ у Інтэрнэт: тэрмінал</string>
<string name="poi_internet_access_wired">Доступ у Інтэрнэт: дротавы</string>

View file

@ -136,13 +136,13 @@
<string name="poi_public_transport_platform">Offentlig transport stoppested</string>
<string name="poi_public_transport_platform_bus">Busstoppested</string>
<string name="poi_public_transport_platform_trolleybus">Trolleybus stoppested</string>
<string name="poi_bus_stop">Busstoppested (forældet)</string>
<string name="poi_bus_stop">Busstoppested</string>
<string name="poi_public_transport_platform_tram">Sporvognsstoppested</string>
<string name="poi_tram_stop">Sporvognsstoppestedet (forældet)</string>
<string name="poi_tram_stop">Sporvognsstoppestedet</string>
<string name="poi_public_transport_station">Offentligtransport station</string>
<string name="poi_bus_station">Busstation (forældet)</string>
<string name="poi_railway_station">Banegård (forældet)</string>
<string name="poi_railway_platform">Perron (forældet)</string>
<string name="poi_bus_station">Busstation</string>
<string name="poi_railway_station">Banegård</string>
<string name="poi_railway_platform">Perron</string>
<string name="poi_railway_halt">Trinbrædt (forældet)</string>
<string name="poi_subway_entrance">Metroindgang</string>
<string name="poi_subway_station">Metrostation</string>
@ -690,7 +690,7 @@
<string name="poi_farm">Gårdbutik</string>
<string name="poi_car_parts">Bildele</string>
<string name="poi_public_transport_stop_position">Offentlig transport stoppested</string>
<string name="poi_halt">Jernbane stop (forældet)</string>
<string name="poi_halt">Jernbane stop</string>
<string name="poi_lodging">Logi</string>
<string name="poi_internet_access_wlan">Internetadgang: wlan</string>
<string name="poi_internet_access_terminal">Internetadgang: terminal</string>

View file

@ -52,7 +52,7 @@
<string name="index_srtm_parts">dele</string>
<string name="index_srtm_ele">Højdekurver</string>
<string name="srtm_plugin_description">Ekstern udvidelse (hentes separat) som muliggør at hente offline højdekurver og relief (\'Indstillinger\' → \'Administrer kortfiler\' → \'Hent\' → Vælg den ønskede korttype). Disse kan vises i kombination med OsmAnd offline kort.</string>
<string name="srtm_plugin_name">Højdekurver (ekstern udvidelse)</string>
<string name="srtm_plugin_name">Højdekurver</string>
<string name="download_select_map_types">Andre kort</string>
<string name="download_roads_only_item">Kun veje</string>
<string name="download_srtm_maps">Højdekurver</string>
@ -303,7 +303,7 @@
<string name="osmand_parking_am">AM</string>
<string name="osmand_parking_position_name">Parkeringssted</string>
<string name="osmand_parking_plugin_description">Ekstern udvidelse (hentes separat) gør det muligt at huske placeringen af den parkerede bil.</string>
<string name="osmand_parking_plugin_name">Parkeringsposition (ekstern udvidelse)</string>
<string name="osmand_parking_plugin_name">Parkeringsposition</string>
<string name="context_menu_item_add_parking_point">Marker som parkeringsplads</string>
<string name="context_menu_item_delete_parking_point">Slet en parkeringsmarkør</string>
<string name="gpxup_public">Offentligt</string>

View file

@ -1117,8 +1117,7 @@
<string name="recording_error">"Error durante la grabación" </string>
<string name="recording_camera_not_available">La cámara no está disponible</string>
<string name="recording_playing">Reproduciendo audio de la grabación especificada.\n%1$s</string>
<string name="tip_recent_changes_1_1_0_t">"Cambios en versión 1.1.0 :\n\t* Extra de cálculo de distancia\n\t* Extra de notas de audio\n\t* Extra de curvas de nivel\n\t* Corrección de errores\n\t* Opción de estilo de mapas \'Vista de tour\' con más detalles de mapa, nuevos estilos de carreteras, más contraste y opción para travesías alpinas (escala SAC)\n\t* Correción de desplazamiento del geoide EGM96 para lecturas GPS de altitud"
</string>
<string name="tip_recent_changes_1_1_0_t">"Cambios en versión 1.1.0 :\n\t* Extra de cálculo de distancia\n\t* Extra de notas de audio\n\t* Extra de curvas de nivel\n\t* Corrección de errores\n\t* Opción de estilo de mapas \'Vista de turismo\' con más detalles de mapa, nuevos estilos de carreteras, más contraste y opción para travesías alpinas (escala SAC)\n\t* Correción de desplazamiento del geoide EGM96 para lecturas GPS de altitud "</string>
<string name="recording_description">Grabado %1$s %3$s %2$s</string>
<string name="srtm_paid_version_msg">Considere la compra del extra de curvas de nivel en la Tienda para apoyar desarrollos adicionales.</string>
<string name="srtm_paid_version_title">Extra curvas de nivel</string>
@ -1944,7 +1943,7 @@
<string name="plugin_ski_descr3">Esta vista se puede revertir desactivándola de nuevo aquí, o cambiando el \'Estilo de mapa\' bajo \'Configurar mapa\' al valor deseado.</string>
<string name="plugin_touringview_descr1">Activando esta vista cambia el estilo de mapa a \'Vista de Touring\', que es una vista de alto detalle especial para los viajeros y conductores profesionales.</string>
<string name="plugin_touringview_descr2">Esta vista proporciona, en cualquier nivel de zoom del mapa, la máxima cantidad de detalles de viaje disponible en los datos del mapa (especialmente carreteras, pistas, senderos y marcas de orientación). También representa claramente todos los tipos de carreteras sin ambigüedades por códigos de color, que es útil cuando por ejemplo conduciendo vehículos grandes.</string>
<string name="plugin_touringview_descr2">Esta vista proporciona, en cualquier nivel de zoom del mapa, la máxima cantidad de detalles de viaje disponible en los datos del mapa (especialmente carreteras, pistas, senderos y marcas de orientación). También representa claramente todos los tipos de carreteras sin ambigüedades por códigos de color, que es útil, por ejemplo, cuando se conducen vehículos grandes.</string>
<string name="days_behind">días atrás</string>
<string name="plugin_touringview_descr3">No es necesario descargar un mapa especial, la vista se crea a partir de nuestros mapas estándar.</string>
<string name="plugin_touringview_descr4">Esta vista puede ser revertida desactivandola de nuevo aquí, o cambiando el \'Estilo de mapa\' desde \'Configurar mapa\'.</string>
@ -1952,7 +1951,7 @@
<string name="watch">Ver</string>
<string name="plugin_touringview_name">Vista de mapa Touring</string>
<string name="turn_off_all">Apagar todo</string>
<string name="turn_off_all">Apagar_todo</string>
<string name="showed_on_map">Mostrado en el mapa</string>
<string name="rename_failed">Falló el renombrado.</string>
<string name="currently_recording_track">Actualmente registrando traza</string>

View file

@ -134,13 +134,13 @@
<string name="poi_public_transport_platform">대중 교통 정류장</string>
<string name="poi_public_transport_platform_bus">버스 정류장</string>
<string name="poi_public_transport_platform_trolleybus">무궤도 전차 정류장</string>
<string name="poi_bus_stop">버스 정류장 (사용 되지 않음)</string>
<string name="poi_bus_stop">버스 정류장</string>
<string name="poi_public_transport_platform_tram">트램 정류장</string>
<string name="poi_tram_stop">트램 정류장 (사용 되지 않음)</string>
<string name="poi_tram_stop">트램 정류장</string>
<string name="poi_public_transport_station">대중 교통 스테이션</string>
<string name="poi_bus_station">버스 정류장 (사용 되지 않음)</string>
<string name="poi_railway_station">기차역 (사용 되지 않음)</string>
<string name="poi_railway_platform">철도 플랫폼 (사용 되지 않음)</string>
<string name="poi_bus_station">버스 정류장</string>
<string name="poi_railway_station">기차역</string>
<string name="poi_railway_platform">철도 플랫폼</string>
<string name="poi_railway_halt">철도 정류장 (사용 되지 않음)</string>
<string name="poi_subway_entrance">지하철 입구</string>
<string name="poi_subway_station">지하철 역</string>
@ -673,7 +673,7 @@
<string name="poi_car">자동차 가게</string>
<string name="poi_car_parts">자동차 부품</string>
<string name="poi_public_transport_stop_position">대중 교통 정류장 위치</string>
<string name="poi_halt">철도 정거장 (사용 되지 않음)</string>
<string name="poi_halt">철도 정거장</string>
<string name="poi_railway_buffer_stop">철도 버퍼 정거장</string>
<string name="poi_lodging">숙박</string>
<string name="poi_internet_access_wlan">인터넷 접속: 무선랜</string>

View file

@ -1200,7 +1200,7 @@
<string name="index_srtm_parts">부분</string>
<string name="index_srtm_ele">등고선</string>
<string name="srtm_plugin_description">오프라인 등고선 과 음영을 다운로드하기 위해 외부플러그인을 이용합니다 (설정→지도 관리→다운로드→ 원하는 지도 유형 선택). OsmAnd 오프라인 지도에서 조합하여 표시할 수 있습니다.</string>
<string name="srtm_plugin_name">등고선 (외부 플러그인)</string>
<string name="srtm_plugin_name">등고선</string>
<string name="download_select_map_types">다른 지도</string>
<string name="download_roads_only_item">도로 전용</string>
<string name="download_srtm_maps">등고선</string>
@ -1467,7 +1467,7 @@
<string name="osmand_parking_am">오전</string>
<string name="osmand_parking_position_name">주차 포인트</string>
<string name="osmand_parking_plugin_description">주차된 차의 위치를 저장하기 위한 외부 플러그인.</string>
<string name="osmand_parking_plugin_name">주차 위치 (외부 플러그인)</string>
<string name="osmand_parking_plugin_name">주차 위치</string>
<string name="context_menu_item_add_parking_point">주차 위치로 마크(표시)</string>
<string name="context_menu_item_delete_parking_point">주차 마커를 삭제</string>
<string name="gpxup_public">공용</string>

View file

@ -113,13 +113,13 @@
<string name="poi_public_transport_platform">Firmada trasportu pùblicu</string>
<string name="poi_public_transport_platform_bus">Firmada àutobus</string>
<string name="poi_public_transport_platform_trolleybus">Firmada filobus</string>
<string name="poi_bus_stop">Firmada àutobus (disusadu)</string>
<string name="poi_bus_stop">Firmada àutobus</string>
<string name="poi_public_transport_platform_tram">Firmada tram</string>
<string name="poi_tram_stop">Firmada tram (disusada)</string>
<string name="poi_tram_stop">Firmada tram</string>
<string name="poi_public_transport_station">Istatzione trasportu pùblicu</string>
<string name="poi_bus_station">Istatzione bus (disusadu)</string>
<string name="poi_bus_station">Istatzione bus</string>
<string name="poi_railway_station">Istatzione de sos trenos</string>
<string name="poi_railway_platform">Piattaredda ferroviària (disusasu)</string>
<string name="poi_railway_platform">Piattaredda ferroviària</string>
<string name="poi_railway_halt">Firmada de sos trenos (disusada)</string>
<string name="poi_subway_entrance">Intrada de sa metropolitana</string>
<string name="poi_subway_station">Istatzione de sa metropolitana</string>
@ -624,6 +624,6 @@
<string name="poi_car">Cuntzessionàriu de màchinas</string>
<string name="poi_car_parts">Cantos de màchinas</string>
<string name="poi_public_transport_stop_position">Firmada de su trasportu pùblicu</string>
<string name="poi_halt">Firmada de sa ferrovia (obsoleta)</string>
<string name="poi_halt">Firmada de sa ferrovia</string>
<string name="poi_railway_buffer_stop">Denegante pro sos trenos</string>
</resources>

View file

@ -206,7 +206,7 @@
<string name="osmand_parking_am">fm</string>
<string name="osmand_parking_position_name">Parkeringspunkt</string>
<string name="osmand_parking_plugin_description">Extern modul (särskild nedladdning) som gör det möjligt att spara platsen där du parkerade bilen.</string>
<string name="osmand_parking_plugin_name">Parkeringsplats (extern modul)</string>
<string name="osmand_parking_plugin_name">Parkeringsplats</string>
<string name="context_menu_item_add_parking_point">Markera som parkeringsplats</string>
<string name="context_menu_item_delete_parking_point">Ta bort P-markering</string>
<string name="asap">Snarast</string>
@ -959,7 +959,7 @@
<string name="index_srtm_parts">delar</string>
<string name="index_srtm_ele">Höjdkurvor</string>
<string name="download_select_map_types">Andra kartor</string>
<string name="srtm_plugin_name">Höjdkurvor (extern modul)</string>
<string name="srtm_plugin_name">Höjdkurvor</string>
<string name="download_srtm_maps">Höjdkurvsdata</string>
<string name="tip_recent_changes_1_1_0_t">"Förändringar i 1.1.0:
\n\t* Insticksmodul för beräkning av avstånd\n\t* Insticksmodul för ljud-/videoanteckningar\n\t* Insticksmodul för höjdkurvor\n\t* Buggfixar

View file

@ -150,7 +150,7 @@
<string name="osmand_parking_am">AM</string>
<string name="osmand_parking_position_name">停車地點</string>
<string name="osmand_parking_plugin_description">該外掛元件(單獨下載)可記住您的愛車停車地點。</string>
<string name="osmand_parking_plugin_name">停車地點(外掛元件)</string>
<string name="osmand_parking_plugin_name">停車地點</string>
<string name="context_menu_item_add_parking_point">標記為停車地點</string>
<string name="context_menu_item_delete_parking_point">刪除停車標記</string>
<string name="gpxup_public">公用的</string>
@ -1124,7 +1124,7 @@
<string name="audionotes_plugin_name">音訊/視訊注解</string>
<string name="index_srtm_parts">部件</string>
<string name="index_srtm_ele">等高線</string>
<string name="srtm_plugin_name">等高線(外掛元件)</string>
<string name="srtm_plugin_name">等高線</string>
<string name="download_select_map_types">其它地圖</string>
<string name="download_roads_only_item">僅道路</string>
<string name="download_srtm_maps">等高線</string>

View file

@ -40,6 +40,8 @@
<dimen name="dialog_content_bottom_margin">16dp</dimen>
<dimen name="local_size_height">34dp</dimen>
<dimen name="favorite_icon_size">24dp</dimen>
<dimen name="gpx_small_icon_margin">3dp</dimen>
<dimen name="gpx_small_text_margin">14dp</dimen>
<!-- TextSizes -->
<dimen name="list_header_text_size">14sp</dimen>

View file

@ -822,7 +822,7 @@
<string name="index_srtm_parts">parts</string>
<string name="index_srtm_ele">Contour lines</string>
<string name="srtm_plugin_description">External plugin (separate download) facilitating to download offline contour lines and hillshades (\'Settings\' → \'Manage map files\' → \'Download\' → Select desired map type). These be can be displayed in combination with the OsmAnd offline maps.</string>
<string name="srtm_plugin_name">Contour Lines (external plugin)</string>
<string name="srtm_plugin_name">Contour Lines</string>
<string name="download_select_map_types">Other maps</string>
<string name="download_roads_only_item">Roads only</string>
<string name="download_srtm_maps">Contour lines</string>
@ -1216,7 +1216,7 @@ Afghanistan, Albania, Algeria, Andorra, Angola, Anguilla, Antigua and Barbuda, A
<string name="osmand_parking_am">AM</string>
<string name="osmand_parking_position_name">Parking point</string>
<string name="osmand_parking_plugin_description">External plugin (separate download) allowing to memorize the location of your parked car.</string>
<string name="osmand_parking_plugin_name">Parking Position (external plugin)</string>
<string name="osmand_parking_plugin_name">Parking Position</string>
<string name="context_menu_item_add_parking_point">Mark as a parking position</string>
<string name="context_menu_item_delete_parking_point">Delete a parking marker</string>
<string name="gpxup_public">Public</string>

View file

@ -207,19 +207,6 @@ public class GPXUtilities {
return maxElevation != -100;
}
public int getTimeHours(long time) {
return (int) ((time / 1000) / 3600);
}
public int getTimeSeconds(long time) {
return (int) ((time / 1000) % 60);
}
public int getTimeMinutes(long time) {
return (int) (((time / 1000) / 60) % 60);
}
public boolean isSpeedSpecified() {
return avgSpeed > 0;
}

View file

@ -401,6 +401,7 @@ public class GpxSelectionHelper {
private boolean showCurrentTrack;
private GPXFile gpxFile;
private int color;
private GPXTrackAnalysis trackAnalysis;
private List<List<WptPt>> processedPointsToDisplay = new ArrayList<List<WptPt>>();
private List<GpxDisplayGroup> displayGroups = null;
private boolean routePoints;
@ -410,9 +411,14 @@ public class GpxSelectionHelper {
if(gpxFile.tracks.size() > 0) {
this.color = gpxFile.tracks.get(0).getColor(0);
}
trackAnalysis = gpxFile.getAnalysis(new File(gpxFile.path).lastModified());
processPoints();
}
public GPXTrackAnalysis getTrackAnalysis() {
return trackAnalysis;
}
public void processPoints() {
this.processedPointsToDisplay = gpxFile.proccessPoints();
if(this.processedPointsToDisplay.isEmpty()) {

View file

@ -2,9 +2,11 @@ package net.osmand.plus.activities;
import java.io.File;
import java.text.Collator;
import java.text.DateFormat;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
@ -20,6 +22,7 @@ import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.GPXUtilities.WptPt;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.OsmandSettings;
@ -84,14 +87,15 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
private ActionMode actionMode;
private LoadGpxTask asyncLoader;
private GpxIndexesAdapter allGpxAdapter;
private ShowedOnMapAdapter showOnMapGpxAdapter;
MessageFormat formatMb = new MessageFormat("{0, number,##.#} MB", Locale.US);
private static MessageFormat formatMb = new MessageFormat("{0, number,##.#} MB", Locale.US);
private LoadLocalIndexDescriptionTask descriptionLoader;
private ContextMenuAdapter optionsMenuAdapter;
private AsyncTask<GpxInfo, ?, ?> operationTask;
private GpxSelectionHelper selectedGpxHelper;
private SavingTrackHelper savingTrackHelper;
private OsmandApplication app;
private Drawable gpxNormal;
private Drawable gpxOnMap;
@Override
@ -122,17 +126,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
updateCurrentTrack(getView());
}
private void createShowedOnMapsView(View v) {
ListView onMap = (ListView) v.findViewById(R.id.gpx_on_map);
showOnMapGpxAdapter = new ShowedOnMapAdapter(getActivity(), R.layout.dash_gpx_track_item);
onMap.setAdapter(showOnMapGpxAdapter);
v.findViewById(R.id.turn_off_all).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showOnMapGpxAdapter.notifyDataSetChanged();
}
});
}
@Override
public void onPause() {
@ -142,20 +135,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
}
private void setShowedOnMapVisibility(boolean visibility) {
View v = getView();
if (v == null) {
return;
}
//temporary hiding this view
v.findViewById(R.id.show_on_map).setVisibility(View.GONE);
/* if (visibility) {
v.findViewById(R.id.on_map_layout).setVisibility(View.VISIBLE);
} else {
v.findViewById(R.id.on_map_layout).setVisibility(View.GONE);
}*/
}
private void updateCurrentTrack(View v) {
if (v == null) {
return;
@ -195,8 +174,13 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
MapActivity.launchMapActivityMoveToTop(getActivity());
}
});
gpxNormal = getResources().getDrawable(R.drawable.ic_gpx_track).mutate();
gpxOnMap = getResources().getDrawable(R.drawable.ic_gpx_track).mutate();
gpxOnMap.setColorFilter(getResources().getColor(R.color.color_distance), PorterDuff.Mode.MULTIPLY);
if (getMyApplication().getSettings().isLightContent()) {
gpxNormal.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
createShowedOnMapsView(v);
return v;
}
@ -205,7 +189,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
icon.mutate();
boolean light = app.getSettings().isLightContent();
if (light) {
icon.setColorFilter(0xff727272, PorterDuff.Mode.MULTIPLY);
icon.setColorFilter(app.getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
ImageButton stop = ((ImageButton) v.findViewById(R.id.stop));
stop.setImageDrawable(icon);
@ -227,7 +211,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
icon = app.getResources().getDrawable(R.drawable.ic_action_gsave_dark);
icon.mutate();
if (light) {
icon.setColorFilter(0xff727272, PorterDuff.Mode.MULTIPLY);
icon.setColorFilter(app.getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
ImageButton save = ((ImageButton) v.findViewById(R.id.show_on_map));
save.setOnClickListener(new View.OnClickListener() {
@ -442,7 +426,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
@Override
public void onDestroyActionMode(ActionMode mode) {
enableSelectionMode(false);
getView().findViewById(R.id.memory_size).setVisibility(View.GONE);
runSelection(false);
allGpxAdapter.notifyDataSetChanged();
}
@ -504,16 +487,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
@Override
public void onDestroyActionMode(ActionMode mode) {
enableSelectionMode(false);
getView().findViewById(R.id.memory_size).setVisibility(View.GONE);
allGpxAdapter.notifyDataSetChanged();
}
});
if (R.string.local_index_mi_upload_gpx == actionResId) {
((TextView) getView().findViewById(R.id.memory_size)).setText(R.string.local_index_upload_gpx_description);
((TextView) getView().findViewById(R.id.memory_size)).setVisibility(View.VISIBLE);
}
allGpxAdapter.notifyDataSetChanged();
}
@ -552,68 +529,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
}
}
private void basicFileOperation(final GpxInfo info, ContextMenuAdapter adapter) {
OnContextMenuClick listener = new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int resId, int pos, boolean isChecked) {
if (resId == R.string.local_index_mi_rename) {
renameFile(info);
} else if (resId == R.string.local_index_unselect_gpx_file ||
resId == R.string.local_index_select_gpx_file) {
if (info.gpx == null) {
loadGpxAsync(info, resId == R.string.local_index_select_gpx_file);
} else {
getMyApplication().getSelectedGpxHelper().selectGpxFile(info.gpx, resId == R.string.local_index_select_gpx_file, true);
showOnMapGpxAdapter.addGpxInfo(info);
allGpxAdapter.notifyDataSetChanged();
selectedGpxHelper.runUiListeners();
}
} else if (resId == R.string.local_index_mi_delete) {
Builder confirm = new AlertDialog.Builder(getActivity());
confirm.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
new DeleteGpxTask().execute(info);
}
});
confirm.setNegativeButton(R.string.default_buttons_no, null);
confirm.setMessage(getString(R.string.delete_confirmation_msg, info.file.getName()));
confirm.show();
} else if (resId == R.string.local_index_mi_export) {
final Uri fileUri = Uri.fromFile(info.file);
final Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, fileUri);
sendIntent.setType("application/gpx+xml");
startActivity(sendIntent);
} else if (resId == R.string.show_gpx_route) {
showGpxOnMap(info);
}
return true;
}
};
if (info.gpx != null && info.file == null) {
GpxSelectionHelper.SelectedGpxFile selectedGpxFile = selectedGpxHelper.getSelectedCurrentRecordingTrack();
if (selectedGpxFile != null && selectedGpxFile.getGpxFile() == info.gpx) {
adapter.item(R.string.local_index_unselect_gpx_file).listen(listener).reg();
} else {
adapter.item(R.string.local_index_select_gpx_file).listen(listener).reg();
}
} else if (info.file != null) {
if (getMyApplication().getSelectedGpxHelper().getSelectedFileByPath(info.file.getAbsolutePath()) == null) {
adapter.item(R.string.local_index_select_gpx_file).listen(listener).reg();
} else {
adapter.item(R.string.local_index_unselect_gpx_file).listen(listener).reg();
}
}
adapter.item(R.string.show_gpx_route).listen(listener).reg();
if (info.file != null) {
adapter.item(R.string.local_index_mi_rename).listen(listener).reg();
adapter.item(R.string.local_index_mi_delete).listen(listener).reg();
adapter.item(R.string.local_index_mi_export).listen(listener).reg();
}
OsmandPlugin.onContextMenuActivity(getActivity(), this, info, adapter);
}
private void showGpxOnMap(GpxInfo info) {
info.updateGpxInfo(getMyApplication());
@ -626,10 +541,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
e = false;
getMyApplication().getSelectedGpxHelper().setGpxFileToDisplay(info.gpx);
MapActivity.launchMapActivityMoveToTop(getActivity());
if (showOnMapGpxAdapter.getCount() == 0) {
setShowedOnMapVisibility(true);
}
showOnMapGpxAdapter.addGpxInfo(info);
}
}
if (e) {
@ -660,36 +571,24 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
protected void onPreExecute() {
((ActionBarActivity) getActivity()).setSupportProgressBarIndeterminateVisibility(true);
allGpxAdapter.clear();
if (showOnMapGpxAdapter != null) {
showOnMapGpxAdapter.clear();
}
}
@Override
protected void onProgressUpdate(GpxInfo... values) {
for (GpxInfo v : values) {
allGpxAdapter.addLocalIndexInfo(v);
if (selectedGpxHelper.getSelectedFileByName(v.getFileName()) != null) {
showOnMapGpxAdapter.addGpxInfo(v);
}
}
showOnMapGpxAdapter.notifyDataSetChanged();
allGpxAdapter.notifyDataSetChanged();
}
public void setResult(List<GpxInfo> result) {
this.result = result;
allGpxAdapter.clear();
showOnMapGpxAdapter.clear();
if (result != null) {
for (GpxInfo v : result) {
allGpxAdapter.addLocalIndexInfo(v);
if (selectedGpxHelper.getSelectedFileByName(v.getFileName()) != null) {
showOnMapGpxAdapter.addGpxInfo(v);
}
}
allGpxAdapter.notifyDataSetChanged();
showOnMapGpxAdapter.notifyDataSetChanged();
onPostExecute(result);
}
}
@ -703,12 +602,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
if (allGpxAdapter.getGroupCount() > 0) {
getExpandableListView().expandGroup(0);
}
if (showOnMapGpxAdapter.getCount() > 0) {
setShowedOnMapVisibility(true);
} else {
setShowedOnMapVisibility(false);
}
}
private File[] listFilesSorted(File dir) {
@ -763,7 +656,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
Map<String, List<GpxInfo>> data = new LinkedHashMap<>();
List<String> category = new ArrayList<>();
int warningColor;
int okColor;
int defaultColor;
int corruptedColor;
private SearchFilter filter;
@ -771,7 +663,6 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
public GpxIndexesAdapter(Context ctx) {
warningColor = ctx.getResources().getColor(R.color.color_warning);
okColor = ctx.getResources().getColor(R.color.color_ok);
TypedArray ta = ctx.getTheme().obtainStyledAttributes(new int[]{android.R.attr.textColorPrimary});
defaultColor = ta.getColor(0, ctx.getResources().getColor(R.color.color_unknown));
ta.recycle();
@ -849,42 +740,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
final GpxInfo child = getChild(groupPosition, childPosition);
if (v == null) {
LayoutInflater inflater = getActivity().getLayoutInflater();
v = inflater.inflate(net.osmand.plus.R.layout.local_index_list_item, parent, false);
}
TextView viewName = ((TextView) v.findViewById(R.id.local_index_name));
viewName.setText(child.getName());
if (child.isCorrupted()) {
viewName.setTextColor(corruptedColor);
viewName.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
} else if (selectedGpxHelper.getSelectedFileByName(child.getFileName()) != null) {
viewName.setTextColor(okColor);
viewName.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
} else {
viewName.setTextColor(defaultColor);
viewName.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
}
TextView sizeText = (TextView) v.findViewById(R.id.local_index_size);
if (child.getSize() >= 0) {
String size;
if (child.getSize() > 100) {
size = formatMb.format(new Object[]{(float) child.getSize() / (1 << 10)});
} else {
size = child.getSize() + " kB";
}
sizeText.setText(size);
} else {
sizeText.setText("");
}
TextView descr = ((TextView) v.findViewById(R.id.local_index_descr));
if (child.isExpanded()) {
descr.setVisibility(View.VISIBLE);
descr.setText(child.getHtmlDescription());
sizeText.setVisibility(View.GONE);
} else {
descr.setVisibility(View.GONE);
sizeText.setVisibility(View.VISIBLE);
v = inflater.inflate(R.layout.dash_gpx_track_item, parent, false);
}
udpateGpxInfoView(v, child, app, gpxNormal, gpxOnMap, false);
ImageView icon = (ImageView) v.findViewById(R.id.icon);
ImageButton options = (ImageButton) v.findViewById(R.id.options);
options.setOnClickListener(new View.OnClickListener() {
@Override
@ -892,9 +751,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
openPopUpMenu(v, child);
}
});
final CheckBox checkbox = (CheckBox) v.findViewById(R.id.check_local_index);
checkbox.setVisibility(selectionMode ? View.VISIBLE : View.GONE);
ImageView icon = (ImageView) v.findViewById(R.id.icon);
if (selectionMode) {
checkbox.setChecked(selectedItems.contains(child));
checkbox.setOnClickListener(new View.OnClickListener() {
@ -926,6 +786,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
return v;
}
@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
View v = convertView;
@ -1020,8 +881,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
DirectionsDialogs.setupPopUpMenuIcon(optionsMenu);
Drawable showIcon = getResources().getDrawable(R.drawable.ic_show_on_map);
if (light) {
showIcon.mutate();
showIcon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
showIcon.mutate().setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
MenuItem item = optionsMenu.getMenu().add(R.string.show_gpx_route)
.setIcon(showIcon);
@ -1042,6 +902,19 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
return true;
}
});
item = optionsMenu.getMenu().add(R.string.share_fav)
.setIcon(light ? R.drawable.ic_action_gshare_light : R.drawable.ic_action_gshare_dark);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
final Uri fileUri = Uri.fromFile(gpxInfo.file);
final Intent sendIntent = new Intent(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_STREAM, fileUri);
sendIntent.setType("application/gpx+xml");
startActivity(sendIntent);
return true;
}
});
final OsmEditingPlugin osmEditingPlugin = OsmandPlugin.getEnabledPlugin(OsmEditingPlugin.class);
if (osmEditingPlugin != null && osmEditingPlugin.isActive()) {
@ -1271,15 +1144,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
if (results.values != null) {
synchronized (allGpxAdapter) {
allGpxAdapter.clear();
showOnMapGpxAdapter.clear();
for (GpxInfo i : ((List<GpxInfo>) results.values)) {
allGpxAdapter.addLocalIndexInfo(i);
if (selectedGpxHelper.getSelectedFileByName(i.getFileName()) != null) {
showOnMapGpxAdapter.addGpxInfo(i);
}
}
}
showOnMapGpxAdapter.notifyDataSetChanged();
allGpxAdapter.notifyDataSetChanged();
if (constraint != null && constraint.length() > 3) {
collapseTrees(10);
@ -1334,6 +1202,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
private boolean corrupted;
private boolean expanded;
private Spanned htmlDescription;
private GPXUtilities.GPXTrackAnalysis analysis;
public GpxInfo() {
}
@ -1387,6 +1256,10 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
return description;
}
public long getFileDate() {
return file.lastModified();
}
public Spanned getHtmlDescription() {
if (htmlDescription != null) {
return htmlDescription;
@ -1395,6 +1268,13 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
return htmlDescription;
}
public GPXUtilities.GPXTrackAnalysis getAnalysis() {
return analysis;
}
public void setAnalysis(GPXUtilities.GPXTrackAnalysis analysis) {
this.analysis = analysis;
}
public void setGpx(GPXFile gpx) {
this.gpx = gpx;
@ -1407,9 +1287,11 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
if (gpx.warning != null) {
corrupted = true;
description = gpx.warning;
analysis = null;
} else {
// 'Long-press for options' message
description = GpxUiHelper.getDescription(app, gpx, file, true);
analysis = gpx.getAnalysis(file.lastModified());
description = GpxUiHelper.getDescription(app, analysis, true);
}
htmlDescription = null;
getHtmlDescription();
@ -1436,79 +1318,86 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
getView().findViewById(R.id.gpx_on_map).setLayoutParams(params);
}
class ShowedOnMapAdapter extends ArrayAdapter<GpxInfo> {
public void addGpxInfo(GpxInfo info) {
boolean contains = false;
for (int i = 0; i < getCount(); i++) {
if (getItem(i).equals(info)) {
contains = true;
break;
}
}
if (contains) {
return;
}
add(info);
notifyDataSetChanged();
//if there's too many items, we need to set size of listview
if (getCount() == 4) {
adjustShowOnMapListViewSize();
}
}
public ShowedOnMapAdapter(Context context, int resource) {
super(context, resource);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater inflater = getActivity().getLayoutInflater();
v = inflater.inflate(R.layout.dash_gpx_track_item, parent, false);
}
final GpxInfo gpxInfo = getItem(position);
TextView viewName = ((TextView) v.findViewById(R.id.name));
viewName.setText(gpxInfo.getName());
v.findViewById(R.id.show_on_map).setVisibility(View.GONE);
v.findViewById(R.id.stop).setVisibility(View.GONE);
public static void udpateGpxInfoView(View v, GpxInfo child, OsmandApplication app,
Drawable gpxNormal, Drawable gpxOnMap,
boolean isDashItem) {
TextView viewName = ((TextView) v.findViewById(R.id.name));
if(!isDashItem) {
v.findViewById(R.id.divider).setVisibility(View.GONE);
if (gpxInfo.gpx != null) {
String description = GpxUiHelper.getDescription(getMyApplication(), gpxInfo.gpx, gpxInfo.file, true);
int startindex = description.indexOf(">");
int endindex = description.indexOf("</font>");
String distnace = description.substring(startindex + 1, endindex);
((TextView) v.findViewById(R.id.distance)).
setText(distnace);
} else {
v.findViewById(R.id.divider).setVisibility(View.VISIBLE);
}
}
final CompoundButton check = (CompoundButton) v.findViewById(R.id.check_item);
check.setVisibility(View.VISIBLE);
if (selectedGpxHelper.getSelectedFileByName(gpxInfo.getFileName()) != null) {
check.setChecked(true);
} else {
check.setChecked(false);
}
check.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (gpxInfo.gpx == null) {
loadGpxAsync(gpxInfo, check.isChecked());
} else {
selectedGpxHelper.selectGpxFile(gpxInfo.gpx, check.isChecked(), true);
}
allGpxAdapter.notifyDataSetChanged();
viewName.setText(child.getName());
GpxSelectionHelper selectedGpxHelper = app.getSelectedGpxHelper();
//ImageView icon = (ImageView) v.findViewById(!isDashItem? R.id.icon : R.id.show_on_map);
ImageView icon = (ImageView) v.findViewById(R.id.icon);
icon.setVisibility(View.VISIBLE);
icon.setImageDrawable(gpxNormal);
if (child.isCorrupted()) {
viewName.setTypeface(Typeface.DEFAULT, Typeface.ITALIC);
} else {
viewName.setTypeface(Typeface.DEFAULT, Typeface.NORMAL);
}
if (selectedGpxHelper.getSelectedFileByName(child.getFileName()) != null) {
icon.setImageDrawable(gpxOnMap);
}
boolean sectionRead = child.getAnalysis() == null;
if(sectionRead) {
v.findViewById(R.id.read_section).setVisibility(View.GONE);
v.findViewById(R.id.unknown_section).setVisibility(View.VISIBLE);
String date = "";
String size = "";
if (child.getSize() >= 0) {
if (child.getSize() > 100) {
size = formatMb.format(new Object[]{(float) child.getSize() / (1 << 10)});
} else {
size = child.getSize() + " kB";
}
});
return v;
}
DateFormat df = app.getResourceManager().getDateFormat();
long fd = child.getFileDate();
if(fd > 0) {
date = (df.format(new Date(fd)));
}
TextView sizeText = (TextView) v.findViewById(R.id.date_and_size_details);
sizeText.setText(date + " \u2022 " + size);
} else {
v.findViewById(R.id.read_section).setVisibility(View.VISIBLE);
v.findViewById(R.id.unknown_section).setVisibility(View.GONE);
TextView time = (TextView) v.findViewById(R.id.time);
TextView distance = (TextView) v.findViewById(R.id.distance);
TextView pointsCount= (TextView) v.findViewById(R.id.points_count);
GPXUtilities.GPXTrackAnalysis analysis = child.getAnalysis();
pointsCount.setText(analysis.wptPoints +"");
if(analysis.totalDistanceMoving != 0) {
distance.setText(OsmAndFormatter.getFormattedDistance(analysis.totalDistanceMoving, app));
} else {
distance.setText(OsmAndFormatter.getFormattedDistance(analysis.totalDistance, app));
}
if(analysis.isTimeSpecified()) {
if(analysis.isTimeMoving()) {
time.setText(Algorithms.formatDuration((int) (analysis.timeMoving / 1000))+"");
} else {
time.setText(Algorithms.formatDuration((int) (analysis.timeSpan/ 1000))+"");
}
} else {
time.setText("");
}
}
TextView descr = ((TextView) v.findViewById(R.id.description));
if (child.isExpanded()) {
descr.setVisibility(View.VISIBLE);
descr.setText(child.getHtmlDescription());
} else {
descr.setVisibility(View.GONE);
}
}
}

View file

@ -18,7 +18,7 @@ public class OsmandActionBarActivity extends ActionBarActivity {
//should be called after set content view
protected void setupHomeButton(){
Drawable back = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
back.setColorFilter(0xffffffff, PorterDuff.Mode.MULTIPLY);
back.setColorFilter(getResources().getColor(R.color.color_white), PorterDuff.Mode.MULTIPLY);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(back);

View file

@ -151,7 +151,7 @@ public class SettingsActivity extends SettingsBaseActivity {
Toolbar tb = new Toolbar(this);
tb.setClickable(true);
Drawable back = getResources().getDrawable(R.drawable.abc_ic_ab_back_mtrl_am_alpha);
back.setColorFilter(0xffffffff, PorterDuff.Mode.MULTIPLY);
back.setColorFilter(app.getResources().getColor(R.color.color_white), PorterDuff.Mode.MULTIPLY);
tb.setNavigationIcon(back);
tb.setTitle(R.string.about_settings);
tb.setBackgroundColor(getResources().getColor( getResIdFromAttribute(this, R.attr.pstsTabBackground)));

View file

@ -159,7 +159,7 @@ public class SearchAddressFragment extends Fragment {
});
menuItem = menu.add(0, ONLINE_SEARCH, 0, R.string.search_online_address);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS);
menuItem = menuItem.setIcon(R.drawable.ic_action_gnext_dark);
menuItem = menuItem.setIcon(R.drawable.ic_world_globe_dark);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -81,7 +81,7 @@ public class SearchAddressOnlineFragment extends Fragment implements SearchActiv
if (getActivity() instanceof SearchActivity) {
menuItem = menu.add(0, 0, 0, R.string.search_offline_address);
MenuItemCompat.setShowAsAction(menuItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT);
menuItem = menuItem.setIcon(R.drawable.ic_action_gnext_dark);
menuItem = menuItem.setIcon(R.drawable.ic_sdcard);
menuItem.setOnMenuItemClickListener(new OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {

View file

@ -178,12 +178,16 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
}
public boolean setName(String name) {
int index = file.getAbsolutePath().lastIndexOf("/") + 1;
if (index < 0) {
return false;
File directory = file.getParentFile();
String fileName = getFileName();
final String hashAndExtension;
int hashInd = fileName.lastIndexOf('_');
if (hashInd == -1) {
hashAndExtension = "_" + fileName;
} else {
hashAndExtension = fileName.substring(hashInd, fileName.length());
}
File directory = new File(file.getAbsolutePath().substring(0, index));
File to = new File(directory, name.trim());
File to = new File(directory, name+hashAndExtension);
if (file.renameTo(to)) {
file = to;
return true;
@ -198,9 +202,9 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
public String getName(Context ctx) {
String fileName = file.getName();
int hashInd = fileName.lastIndexOf("_");
int hashInd = fileName.lastIndexOf('_');
if (hashInd != -1) {
return fileName.substring(0, hashInd - 1);
return fileName.substring(0, hashInd);
} else if (this.isAudio()) {
return ctx.getResources().getString(R.string.audio);
} else if (this.isVideo()) {

View file

@ -213,16 +213,6 @@ public class NotesFragment extends ListFragment {
getListView(), false);
final EditText editText = (EditText) v.findViewById(R.id.name);
builder.setView(v);
String fileName = recording.getFileName();
final String hash;
int hashInd = fileName.lastIndexOf("_");
if (hashInd == -1) {
hash = "_" + fileName;
} else {
hash = fileName.substring(hashInd, fileName.length());
}
editText.setText(recording.getName(getActivity()));
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
@ -230,7 +220,7 @@ public class NotesFragment extends ListFragment {
builder.setPositiveButton(R.string.default_buttons_apply, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if(!recording.setName(editText.getText().toString() + hash)) {
if(!recording.setName(editText.getText().toString())) {
Toast.makeText(getActivity(),R.string.rename_failed,Toast.LENGTH_SHORT).show();
}
recording.setDescription();

View file

@ -131,7 +131,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment {
backup = getActivity().getResources().getDrawable(R.drawable.ic_type_archive);
backup.mutate();
if (light) {
backup.setColorFilter(0xff727272, PorterDuff.Mode.MULTIPLY);
backup.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
sdcard = getActivity().getResources().getDrawable(R.drawable.ic_sdcard);
sdcard.mutate();

View file

@ -4,7 +4,9 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.osmand.CallbackWithObject;
import net.osmand.IndexConstants;
@ -356,10 +358,33 @@ public class GpxUiHelper {
}
return dlg;
}
public static List<String> getSortedGPXFilenamesByDate(File dir) {
final Map<String, Long> mp = new HashMap<String, Long>();
readGpxDirectory(dir, mp, "");
ArrayList<String> list = new ArrayList<String>(mp.keySet());
Collections.sort(list, new Comparator<String>() {
@Override
public int compare(String object1, String object2) {
Long l1 = mp.get(object1);
Long l2 = mp.get(object2);
if(l2 == null) {
l2 = 0l;
}
if(l1== null) {
l1 = 0l;
}
return l1 < l2 ? 1 : (l1 == l2 ? 0 : -1);
}
});
return list;
}
private static List<String> getSortedGPXFilenames(File dir,String sub) {
final List<String> list = new ArrayList<String>();
readGpxDirectory(dir, list, "");
public static List<String> getSortedGPXFilenames(File dir) {
final Map<String, Long> mp = new HashMap<String, Long>();
readGpxDirectory(dir, mp, "");
ArrayList<String> list = new ArrayList<String>(mp.keySet());
Collections.sort(list, new Comparator<String>() {
@Override
public int compare(String object1, String object2) {
@ -375,23 +400,20 @@ public class GpxUiHelper {
return list;
}
private static void readGpxDirectory(File dir, final List<String> list, String parent) {
private static void readGpxDirectory(File dir, final Map<String, Long> map, String parent) {
if (dir != null && dir.canRead()) {
File[] files = dir.listFiles();
if (files != null) {
for (File f : files) {
if (f.getName().toLowerCase().endsWith(".gpx")) { //$NON-NLS-1$
list.add(parent + f.getName());
map.put(parent + f.getName(), f.lastModified());
} else if (f.isDirectory()) {
readGpxDirectory(f, list, parent + f.getName() + "/");
readGpxDirectory(f, map, parent + f.getName() + "/");
}
}
}
}
}
public static List<String> getSortedGPXFilenames(File dir) {
return getSortedGPXFilenames(dir, null);
}
private static void loadGPXFileInDifferentThread(final Activity activity, final CallbackWithObject<GPXFile[]> callbackWithObject,
final File dir, final GPXFile currentFile, final String... filename) {

View file

@ -1,6 +1,7 @@
package net.osmand.plus.monitoring;
import java.io.File;
import java.util.Date;
import java.util.List;
import net.osmand.IndexConstants;
@ -8,6 +9,7 @@ import net.osmand.access.AccessibleToast;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GpxSelectionHelper;
import net.osmand.plus.OsmAndAppCustomization;
import net.osmand.plus.OsmAndFormatter;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
@ -40,6 +42,10 @@ import android.widget.Toast;
*/
public class DashTrackFragment extends DashBaseFragment {
private Drawable gpxOnMap;
private Drawable gpxNormal;
private java.text.DateFormat format;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = getActivity().getLayoutInflater().inflate(R.layout.dash_common_fragment, container, false);
@ -47,7 +53,16 @@ public class DashTrackFragment extends DashBaseFragment {
TextView header = (TextView) view.findViewById(R.id.fav_text);
header.setTypeface(typeface);
header.setText(R.string.tracks);
gpxNormal = getResources().getDrawable(R.drawable.ic_gpx_track).mutate();
gpxOnMap = getResources().getDrawable(R.drawable.ic_gpx_track).mutate();
gpxOnMap.setColorFilter(getResources().getColor(R.color.color_distance), PorterDuff.Mode.MULTIPLY);
if (getMyApplication().getSettings().isLightContent()) {
gpxNormal.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
((Button) view.findViewById(R.id.show_all)).setTypeface(typeface);
format = getMyApplication().getResourceManager().getDateFormat();
(view.findViewById(R.id.show_all)).setOnClickListener(new View.OnClickListener() {
@Override
@ -90,7 +105,7 @@ public class DashTrackFragment extends DashBaseFragment {
}
}
OsmandApplication app = getMyApplication();
final OsmandApplication app = getMyApplication();
SavingTrackHelper savingTrackHelper = app.getSavingTrackHelper();
if (app.getSettings().SAVE_GLOBAL_TRACK_TO_GPX.get()) {
list.remove(2);
@ -99,61 +114,38 @@ public class DashTrackFragment extends DashBaseFragment {
AvailableGPXFragment.createCurrentTrackView(view, app);
GpxSelectionHelper.SelectedGpxFile currentTrack = savingTrackHelper.getCurrentTrack();
((TextView)view.findViewById(R.id.name)).setText(R.string.currently_recording_track);
String description = GpxUiHelper.getDescription(getMyApplication(), currentTrack.getGpxFile(), null, true);
int startindex = description.indexOf(">");
int endindex = description.indexOf("</font>");
String distance = description.substring(startindex + 1, endindex);
String points = String.valueOf(currentTrack.getGpxFile().points.size());
((TextView) view.findViewById(R.id.points_count)).setText(points);
((TextView)view.findViewById(R.id.distance)).setText(distance);
((TextView)view.findViewById(R.id.distance)).setText(
OsmAndFormatter.getFormattedDistance(savingTrackHelper.getDistance(), app));
tracks.addView(view);
}
for (String filename : list) {
final File f = new File(dir, filename);
final GPXUtilities.GPXFile res = GPXUtilities.loadGPXFile(getMyApplication(), f);
boolean haveInfo = false;
GpxSelectionHelper.SelectedGpxFile selectedGpxFile =
app.getSelectedGpxHelper().getSelectedFileByPath(f.getAbsolutePath());
GPXUtilities.GPXTrackAnalysis trackAnalysis = null;
if(selectedGpxFile != null) {
trackAnalysis = selectedGpxFile.getTrackAnalysis();
}
AvailableGPXFragment.GpxInfo info = new AvailableGPXFragment.GpxInfo();
info.subfolder = "";
info.setAnalysis(trackAnalysis);
info.file = f;
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.dash_gpx_track_item, null, false);
((TextView) view.findViewById(R.id.name)).setText(filename);
((TextView) view.findViewById(R.id.points_count)).
setText(res.points.size() + " " + getActivity().getString(R.string.points));
String description = GpxUiHelper.getDescription(getMyApplication(), res, f, true);
int startindex = description.indexOf(">");
int endindex = description.indexOf("</font>");
String distnace = description.substring(startindex + 1, endindex);
((TextView) view.findViewById(R.id.distance)).
setText(distnace);
view.findViewById(R.id.time_icon).setVisibility(View.GONE);
boolean light = getMyApplication().getSettings().isLightContent();
Drawable icon = getResources().getDrawable(R.drawable.ic_show_on_map);
GpxSelectionHelper gpxSelectionHelper = getMyApplication().getSelectedGpxHelper();
boolean isShowingOnMap = gpxSelectionHelper.getSelectedFileByName(filename) != null;
//setting proper icon color
if (isShowingOnMap) {
icon.mutate();
if (light) {
icon.setColorFilter(getResources().getColor(R.color.dashboard_gpx_on_map), PorterDuff.Mode.MULTIPLY);
} else {
icon.setColorFilter(getResources().getColor(R.color.color_distance), PorterDuff.Mode.MULTIPLY);
}
} else if (light) {
icon.mutate();
icon.setColorFilter(getResources().getColor(R.color.icon_color_light), PorterDuff.Mode.MULTIPLY);
}
final ImageButton showOnMap = (ImageButton) view.findViewById(R.id.show_on_map);
showOnMap.setImageDrawable(icon);
showOnMap.setVisibility(View.VISIBLE);
//view.findViewById(R.id.distance_icon).setVisibility(View.GONE);
view.findViewById(R.id.stop).setVisibility(View.GONE);
AvailableGPXFragment.udpateGpxInfoView(view, info, app, gpxNormal, gpxOnMap, true);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
showOnMap(res);
showOnMap(GPXUtilities.loadGPXFile(app, f));
}
});
tracks.addView(view);