mirror of
https://codeberg.org/OpenTracksApp/OpenTracks.git
synced 2026-10-02 09:33:06 +02:00
merge heads
This commit is contained in:
@@ -119,7 +119,7 @@ limitations under the License.
|
||||
android:autoLink="web"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:text="@string/about_weburl"
|
||||
android:text="@string/my_tracks_web_url"
|
||||
android:textSize="18sp" />
|
||||
</TableRow>
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ services.
|
||||
android:id="@+id/send_to_google_result_error"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/error_generic"
|
||||
android:text="@string/error_sending_to_google"
|
||||
android:visibility="gone"
|
||||
style="?android:attr/textAppearanceLarge"/>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -41,7 +41,7 @@ limitations under the License.
|
||||
<string name="error_unable_to_stop_recording">No es pot aturar l\'enregistrament. Proveu de nou.</string>
|
||||
<string name="error_import_unable_to_read_file">No es pot llegir des del fitxer.</string>
|
||||
<string name="error_import_invalid_gpx_format">El fitxer no conté un format GPX vàlid.</string>
|
||||
<string name="error_generic">S\'ha produït un error. Proveu de nou.</string>
|
||||
<string name="error_sending_to_google">S\'ha produït un error. Proveu de nou.</string>
|
||||
<string name="error_export_track_does_not_exist">No existeix la ruta.</string>
|
||||
<string name="error_import_out_of_memory">Aquest fitxer és massa gran (ha d\'ésser inferior a 500KB. S\'està cancel·lant.</string>
|
||||
<string name="error_unable_to_insert_marker">No es pot inserir un marcador. No hi ha cap ubicació fixa disponible.</string>
|
||||
@@ -50,10 +50,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">S\'està esperant per tenir una posició GPS fixa. Assegureu-vos que el cel és visible.</string>
|
||||
<string name="status_now_recording">Ara s\'està enregistrant una ruta nova.</string>
|
||||
<string name="status_stopped_recording">S\'ha aturat l\'enregistrament de la ruta.</string>
|
||||
<string name="sending_to_fusion_tables_success">S\'ha creat un Google Fusion Table nou a google.com/fusiontables.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">S\'ha enviat la ruta a maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">S\'ha enviat la ruta a un full de càlcul a docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">S\'ha enviat la ruta a docs.google.com.</string>
|
||||
<string name="status_need_to_enable_gps">Toqueu aquí per anar als paràmetres de seguretat i ubicació i activeu \'habilita els satèl·lits GPS\'. Premeu el botó d\'anar enrere per tornar.</string>
|
||||
<string name="status_approximate_current_location">Nota: Es mostra una ubicació determinada a partir de les xarxes sense fils i antenes telefòniques.</string>
|
||||
<string name="status_no_current_location">No es pot determinar la ubicació. Habiliteu més fonts d\'ubicació (vegeu els paràmetres de seguretat i ubicació) i assegureu-vos que el cel és visible. Proveu de nou més tard.</string>
|
||||
@@ -82,8 +78,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="new_map_description">Creat per My Tracks a l\'Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Creat per <a href=\'http://mytracks.appspot.com\'>My Tracks</a> a l\'Android.</string>
|
||||
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="recorded_date">Enregistrat</string>
|
||||
<string name="category">Tipus d\'activitat</string>
|
||||
|
||||
@@ -41,7 +41,7 @@ limitations under the License.
|
||||
<string name="error_unable_to_stop_recording">Anhalten unmöglich. Bitte versuche es noch einmal.</string>
|
||||
<string name="error_import_unable_to_read_file">Konnte Datei nicht lesen.</string>
|
||||
<string name="error_import_invalid_gpx_format">Datei ist nicht im GPX-Format.</string>
|
||||
<string name="error_generic">Ein Fehler ist aufgetreten. Bitte versuche es noch einmal.</string>
|
||||
<string name="error_sending_to_google">Ein Fehler ist aufgetreten. Bitte versuche es noch einmal.</string>
|
||||
<string name="error_export_track_does_not_exist">Track existiert nicht.</string>
|
||||
<string name="error_import_out_of_memory">Die Datei ist zu groß (maximal 500 KB). Operation abgebrochen.</string>
|
||||
<string name="error_unable_to_insert_marker">Der Wegpunkt kann nicht einfügt werden. Keine Positionsbestimmung möglich.</string>
|
||||
@@ -50,10 +50,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Warte auf ein besseres GPS-Signal. Bitte stelle sicher, dass der Himmel sichtbar ist.</string>
|
||||
<string name="status_now_recording">Ein neuer Track wird aufgezeichnet.</string>
|
||||
<string name="status_stopped_recording">Die Aufzeichnung wurde angehalten.</string>
|
||||
<string name="sending_to_fusion_tables_success">Eine neue Tabelle wurde auf google.com/fusiontables erstellt.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">Dein Track wurde auf maps.google.com gespeichert.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Dein Track wurde in einer neuen Tabelle bei docs.google.com gespeichert.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Dein Track wurde an docs.google.com gesendet.</string>
|
||||
<string name="status_need_to_enable_gps">Hier berühren, um zu den Sicherheits- und Positionseinstellungen zu gelangen. Aktiviere \'GPS-Satelliten\'. Drücke dann den Zurück-Knopf, um hierher zurückzukehren.</string>
|
||||
<string name="status_approximate_current_location">Anmerkung: Eine ungefähre Position wird angezeigt, bestimmt mittels Mobilfunkstationen und WiFi-Netzwerken.</string>
|
||||
<string name="status_no_current_location">Die Position kann derzeit nicht bestimmt werden. Aktiviere mehr Positionsquellen (siehe Sicherheits- und Positionseinstellungen) und stelle sicher, dass der Himmel sichtbar ist.</string>
|
||||
@@ -82,8 +78,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google Fusion Tables -->
|
||||
<string name="new_map_description">Erstellt von My Tracks für Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Erstellt von <a href=\'http://mytracks.appspot.com\'>My Tracks</a> für Android.</string>
|
||||
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="points">Punkte</string>
|
||||
<string name="recorded_date">Aufgezeichnet am</string>
|
||||
|
||||
@@ -43,7 +43,7 @@ limitations under the License.
|
||||
<string name="error_unable_to_stop_recording">No se puede detener la grabación. Inténtelo de nuevo.</string>
|
||||
<string name="error_import_unable_to_read_file">No pude leer del archivo.</string>
|
||||
<string name="error_import_invalid_gpx_format">El archivo no tiene un format GPX válido.</string>
|
||||
<string name="error_generic">A ocurrido un error. Por favor, inténtelo de nuevo.</string>
|
||||
<string name="error_sending_to_google">A ocurrido un error. Por favor, inténtelo de nuevo.</string>
|
||||
<string name="error_export_track_does_not_exist">El recorrido no existe.</string>
|
||||
<string name="error_export_operation_canceled">La operación fue cancelada.</string>
|
||||
<string name="error_import_out_of_memory">El archivo es demasiado grande (tiene que ser menor a 500 KB). Abortando.</string>
|
||||
@@ -53,11 +53,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Esperando una ubicación mas exacta del GPS. Asegúrese que el cielo sea visible.</string>
|
||||
<string name="status_now_recording">Grabando un nuevo recorrido.</string>
|
||||
<string name="status_stopped_recording">Grabación interrumpida.</string>
|
||||
<string name="sending_to_my_maps_success_new_map">Un nuevo sitio ha sido añadido en maps.google.com.</string>
|
||||
<string name="sending_to_fusion_tables_success">Una nueva tabla de Google Fusion ha sido creada en google.com/fusiontables.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">Su recorrido ha sido enviado a maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Su recorrido ha sido enviado a una nueva hoja de cálculo de docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Su recorrido ha sido enviado a docs.google.com.</string>
|
||||
<string name="sending_to_google_additional_info">Es posible que pasen unos minutos hasta que los nuevos recorridos aparezcan.</string>
|
||||
<string name="status_need_to_enable_gps">Por favor, presione aquí para ir al menú de Seguridad y Ubicación, y asegúrese que el GPS esté habilitado. Presione el botón "atrás" para regresar.</string>
|
||||
<string name="status_approximate_current_location">Nota: Una ubicación aproximada es determinada a partir de torres de telefonía celular y redes WIFI.</string>
|
||||
@@ -92,8 +87,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google Fusion Tables -->
|
||||
<string name="new_map_description">Creado por My Tracks para Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Creado por <a href=\'http://mytracks.appspot.com\'>My Tracks</a> en Android.</string>
|
||||
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="my_map_link">Created by <a href=\'http://mytracks.appspot.com\'>My Tracks</a> en Android.</string>
|
||||
<string name="new_map_title">Nuevo Sitio</string>
|
||||
|
||||
@@ -53,11 +53,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Odotetaan parempaa GPS-yhteyttä. Varmista että taivas on näkyvissä.</string>
|
||||
<string name="status_now_recording">Tallennetaan uutta reittiä.</string>
|
||||
<string name="status_stopped_recording">Reitin tallentaminen lopetettiin.</string>
|
||||
<string name="sending_to_my_maps_success_new_map">Uusi Google My Map on luotu osoitteeseen maps.google.com.</string>
|
||||
<string name="sending_to_fusion_tables_success">Uusi Google Fusion taulukko on luotu osoitteeseen google.com/fusiontables.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">Reittisi on lähetetty osoitteeseen maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Reittisi on luotu taulukoksi osoitteeseen docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Reittisi on lähetetty osoitteeseen docs.google.com.</string>
|
||||
<string name="sending_to_google_additional_info">Reitin näkyminen saattaa kestää muutaman minuutin.</string>
|
||||
<string name="status_need_to_enable_gps">Avaa tästä Sijainti ja suojaus -asetukset ja valitse \'Käytä GPS-satelliitteja\'. Palaa ohjelmaan painamalla Takaisin-näppäintä.</string>
|
||||
<string name="status_approximate_current_location">Huomio: Näkyvä sijainti perustuu kännykkämastoista ja WLAN-verkoista arvioituun paikkatietoon.</string>
|
||||
@@ -91,8 +86,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google Fusion Tables -->
|
||||
<string name="new_map_description">Created by My Tracks on Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Created by <a href=\'http://mytracks.appspot.com\'>My Tracks</a> on Android.</string>
|
||||
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="my_map_link">Created by <a href=\'http://mytracks.appspot.com\'>My Tracks</a> on Android.</string>
|
||||
<string name="new_map_title">Uusi kartta</string>
|
||||
|
||||
@@ -51,10 +51,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Attente du signal GPS. Assurez-vous que le ciel est bien visible.</string>
|
||||
<string name="status_now_recording">Parcours en cours d\'enregistrement.</string>
|
||||
<string name="status_stopped_recording">Enregistrement du parcours terminé.</string>
|
||||
<string name="sending_to_fusion_tables_success">Une nouvelle table Google Fusion vient d\'être créée sur google.com/fusiontables.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">Votre parcours a été envoyé à maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Votre parcours a été envoyé dans un tableur à docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Votre parcours a été envoyé à docs.google.com.</string>
|
||||
<string name="status_need_to_enable_gps">Cliquez ici et allez dans \'Paramètres\', \'Sécurité et Localisation\' et selectionnez \'Activer les satellites GPS\'. Appuyez sur le bouton de retour pour revenir au menu.</string>
|
||||
<string name="status_approximate_current_location">Note : Votre position est approximative, elle a été déterminée par les antennes de téléphonie ou le réseau WiFi.</string>
|
||||
<string name="status_no_current_location">Votre position ne peut être déterminée. Vérifiez votre configuration dans \'Paramètres\', \'Sécurité et Localisation\'. Assurez-vous également que le ciel soit bien visible.</string>
|
||||
@@ -83,8 +79,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="new_map_description">Créée par My Tracks sous Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Créée par <a href=\'http://mytracks.appspot.com\'>My Tracks</a> sous Android.</string>
|
||||
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="recorded_date">Enregistré</string>
|
||||
<string name="category">Type d\'activité</string>
|
||||
|
||||
@@ -48,10 +48,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Sto aspettando il fix del GPS. Accertati che il cielo sia visibile.</string>
|
||||
<string name="status_now_recording">Sto registrando un nuovo percorso.</string>
|
||||
<string name="status_stopped_recording">Registrazione del percorso terminata.</string>
|
||||
<!-- <string name="sending_to_fusion_tables_success">Una nuova mappa è stata creata in «Le mie mappe» su maps.google.com.</string> -->
|
||||
<string name="sending_to_my_maps_success_existing_map">Il tuo percorso è stato inviato a maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Il tuo percorso è stato inviato ad un nuovo foglio di calcolo su docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Il tuo percorso è stato inviato a docs.google.com.</string>
|
||||
<string name="status_need_to_enable_gps">Premi qui per andare a «Impostazioni di posizione e protezione» e attiva «Utilizza satelliti GPS». Poi premi il tasto di ritorno per tornare qui.</string>
|
||||
<string name="status_approximate_current_location">Nota: la posizione indicata è un\'approssimazione determinata in base alle antenne cellulari e reti WIFI vicine.</string>
|
||||
<string name="status_no_current_location">La posizione non può essere determinata. Attiva più fonti di posizione (vedi «Impostazioni di posizione e protezione») e eccertati che il cielo sia visibile. Riprova più tardi.</string>
|
||||
@@ -80,8 +76,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="new_map_description">Creato da My Tracks su Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Creato da <a href=\'http://mytracks.appspot.com\'>My Tracks</a> su Android.</string>
|
||||
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="points">Punti</string>
|
||||
<string name="recorded_date">Registrato</string>
|
||||
|
||||
@@ -51,11 +51,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">GPS位置精度がよくなるまで待機しています.空が見えるところにいて下さい.</string>
|
||||
<string name="status_now_recording">新しいトラックを記録中です.</string>
|
||||
<string name="status_stopped_recording">トラック記録を停止しました.</string>
|
||||
<string name="sending_to_my_maps_success_new_map">新しいマイマップをmap.google.comに作成しました.</string>
|
||||
<string name="sending_to_fusion_tables_success">新しいGoogle Fusion Tableをgoogle.com/fusiontablesに作成しました.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">トラックをmaps.google.comに送信しました.</string>
|
||||
<string name="sending_to_docs_success_new_doc">トラックをdocs.google.comの新しいスプレッドシートに送信しました.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">トラックをdocs.google.comに送信しました.</string>
|
||||
<string name="sending_to_google_additional_info">新しいトラックが表示されるまでに数分かかることがあります.</string>
|
||||
<string name="status_need_to_enable_gps">ここをタップして「位置情報とセキュリティの設定」を開いて「GPS機能を使用」にチェックを入れて下さい.バックボタンで戻ってください.</string>
|
||||
<string name="status_approximate_current_location">ご注意: 携帯電話中継局とWi-Fiネットワークから大まかな位置を特定します.</string>
|
||||
@@ -88,8 +83,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google Fusion Tables -->
|
||||
<string name="new_map_description">Android用My Tracksで作成</string>
|
||||
<string name="send_to_google_by_mytracks">Android用<a href=\'http://mytracks.appspot.com\'>My Tracks</a>で作成しました.</string>
|
||||
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="my_map_link">Android用<a href=\'http://mytracks.appspot.com\'>My Tracks</a>で作成しました.</string>
|
||||
<string name="new_map_title">新規マップ</string>
|
||||
|
||||
@@ -49,10 +49,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Oczekiwanie na lepsze ustalenie pozycji GPS. Upewnij się, że niebo jest widoczne.</string>
|
||||
<string name="status_now_recording">Rejestrowanie nowej trasy.</string>
|
||||
<string name="status_stopped_recording">Zatrzymano rejestrowanie nowej trasy.</string>
|
||||
<!-- <string name="sending_to_fusion_tables_success">Utworzona nową Mapę Google na maps.google.com.</string> -->
|
||||
<string name="sending_to_my_maps_success_existing_map">Twoja trasa został wysłana do maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Twoja trasa została wysłana do nowego arkusza na docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Twoja trasa została wysłana do docs.google.com.</string>
|
||||
<string name="status_need_to_enable_gps">Tapnij tutaj, aby przejść do ustawień Lokalizacji i zabezpieczeń, a następnie zaznacz Użyj satelitów GPS. Naciśnij klawisz Wstecz, aby powrócić.</string>
|
||||
<string name="status_approximate_current_location">Uwaga: używana jest przybliżona lokalizacja ustalona za pomocą stacji komórkowych i sieci WIFI.</string>
|
||||
<string name="status_no_current_location">Lokalizacja nie może być obecnie ustalona. Włącz wiecej źródeł (zobacz ustawienia Lokalizacji i zabezpieczeń) i upewnij się, że niebo jest widoczne. Spróbuj później.</string>
|
||||
@@ -81,8 +77,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="new_map_description">Utworzono za pomocą My Tracks na Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Utworzona przez <a href=\'http://mytracks.appspot.com\'>My Tracks</a> na Android.</string>
|
||||
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="points">Punkty</string>
|
||||
<string name="recorded_date">Zapisana</string>
|
||||
|
||||
@@ -48,10 +48,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Esperando por um sinal melhor do GPS. Assegure-se de que o céu está visível.</string>
|
||||
<string name="status_now_recording">Gravando um novo caminho.</string>
|
||||
<string name="status_stopped_recording">Gravação interrompida.</string>
|
||||
<string name="sending_to_fusion_tables_success">Uma nova Fusion Table Google foi criada em google.com/fusiontables.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">Seu caminho foi enviado para maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Seu caminho foi enviado para uma nova planilha em docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Seu caminho foi enviado para docs.google.com.</string>
|
||||
<string name="status_need_to_enable_gps">"Por favor pressione aqui para ir aos ajustes de segurança e localização e verifique que o GPS esteja habilitado. Pressione o botão de voltar para retornar.</string>
|
||||
<string name="status_approximate_current_location">Nota: Uma localização aproximada, determinada por torres de telefonia celular, está sendo mostrada.</string>
|
||||
<string name="status_no_current_location">Sua localização não pôde ser determinada. Habilite fontes adicionais de localização (veja configurações de Segurança e Localização) e assegure-se de que o céu está visível.</string>
|
||||
@@ -80,8 +76,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="new_map_description">"Criado por My Tracks no Android.</string>
|
||||
<string name="send_to_google_by_mytracks">"Criado por <a href='http://mytracks.appspot.com'>My Tracks</a> no Android.</string>
|
||||
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="points">Pontos</string>
|
||||
<string name="recorded_date">Gravado</string>
|
||||
|
||||
@@ -52,11 +52,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Ожидание сигнала GPS. Убедитесь в том, что вы находитесь под открытым небом.</string>
|
||||
<string name="status_now_recording">Записывается новый трек.</string>
|
||||
<string name="status_stopped_recording">Запись вашего трека остановлена.</string>
|
||||
<string name="sending_to_my_maps_success_new_map">Новая Google \"Мои карты\" была создана на maps.google.com.</string>
|
||||
<string name="sending_to_fusion_tables_success">Новая таблица Google Fusion была создана на google.com/fusiontables.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">Твой трек был отправлен на maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Ваш трек был отправлен в новую электронную таблицу на docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Ваш трек был отправлен в docs.google.com.</string>
|
||||
<string name="sending_to_google_additional_info">Это может занять несколько минут, прежде чем появятся новые треки.</string>
|
||||
<string name="status_need_to_enable_gps">Пожалуйста, нажмите здесь для перехода к разделу настроек Координаты и отметьте пункт \"Спутники GPS\". Для возвращения нажмите кнопку Назад.</string>
|
||||
<string name="status_approximate_current_location">Примечание: приблизительное местоположение определено относительно вышек сотовой связи и беспроводных сетей.</string>
|
||||
@@ -90,8 +85,7 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google Fusion Tables -->
|
||||
<string name="new_map_description">Создано My Tracks на Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Создано <a href=\'http://mytracks.appspot.com\'>My Tracks</a> на Android.</string>
|
||||
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="my_map_link">Создано <a href=\'http://mytracks.appspot.com\'>My Tracks</a> на Android.</string>
|
||||
<string name="new_map_title">Новая карта</string>
|
||||
|
||||
@@ -49,10 +49,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">Väntar på bättre GPS-position. Se till att himlen är synlig.</string>
|
||||
<string name="status_now_recording">Spelar nu in ett nytt spår.</string>
|
||||
<string name="status_stopped_recording">Stoppade inspelning av ditt spår.</string>
|
||||
<!-- <string name="sending_to_fusion_tables_success">En ny Google Mina Kartor har skapats på maps.google.com.</string> -->
|
||||
<string name="sending_to_my_maps_success_existing_map">Ditt spår har skickats till maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">Ditt spår har skickats till ett nytt kalkylblad på docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">Ditt spår har skickats till docs.google.com.</string>
|
||||
<string name="status_need_to_enable_gps">Klicka här för att gå till Säkerhet och Platsinställningar och kryssa i \'aktivera gps-satteliter\'. Tryck på tillbakaknappen för att återgå.</string>
|
||||
<string name="status_approximate_current_location">OBS: En ungefärlig position som avgörs från mobilmaster och WIFI-nät visas.</string>
|
||||
<string name="status_no_current_location">En position kan för närvarande inte fastställas. Aktivera mer platskällor (se Säkerhet och Platsinställningar) och se till att himlen är synlig. Försök igen senare.</string>
|
||||
@@ -81,7 +77,6 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="new_map_description">Skapad av My Tracks på Android.</string>
|
||||
<string name="send_to_google_by_mytracks">Skapad av <a href=\'http://mytracks.appspot.com\'>My Tracks</a> på Android.</string>
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
<string name="points">Punkter</string>
|
||||
|
||||
@@ -53,11 +53,6 @@ limitations under the License.
|
||||
<string name="status_wait_for_gps_fix">等待更准确的 GPS 定位. 请确定可以看见天空.</string>
|
||||
<string name="status_now_recording">现在开始记录新的轨迹.</string>
|
||||
<string name="status_stopped_recording">停止记录你的轨迹.</string>
|
||||
<string name="sending_to_my_maps_success_new_map">已在 maps.google.com 创建了新的 Google My Map.</string>
|
||||
<string name="sending_to_fusion_tables_success">已在 google.com/fusiontables 创建新 Google Fusion Table.</string>
|
||||
<string name="sending_to_my_maps_success_existing_map">你的轨迹已经发送到 maps.google.com.</string>
|
||||
<string name="sending_to_docs_success_new_doc">你的轨迹已经作为新的电子表格发送到 docs.google.com.</string>
|
||||
<string name="sending_to_docs_success_existing_doc">你的轨迹已经发送到 docs.google.com.</string>
|
||||
<string name="sending_to_google_additional_info">可能需要等待几分钟才能看见新的轨迹.</string>
|
||||
<string name="status_need_to_enable_gps">请点击这里进入\'安全和位置设置\'并勾选上\'启用 GPS 卫星\'. 然后用后退键返回.</string>
|
||||
<string name="status_approximate_current_location">注意: 当前显示的位置是根据无线信号和无线网络计算的近似位置.</string>
|
||||
@@ -91,10 +86,6 @@ limitations under the License.
|
||||
|
||||
<!-- Text and links when uploading to Google Fusion Tables -->
|
||||
<string name="new_map_description">由 Android 平台的 My Tracks 创建.</string>
|
||||
<string name="send_to_google_by_mytracks">由 Android 平台的 <a href=\'http://mytracks.appspot.com\'>My Tracks</a> 创建.</string>
|
||||
|
||||
<!-- Text and links when uploading to Google My Maps -->
|
||||
<string name="send_to_google_by_mytracks">由 Android 上的 <a href=\'http://mytracks.appspot.com\'>My Tracks</a> 创建.</string>
|
||||
<string name="new_map_title">新地图</string>
|
||||
|
||||
<!-- Formatting of track and marker descriptions -->
|
||||
|
||||
@@ -20,8 +20,10 @@ limitations under the License.
|
||||
<!-- Application Name -->
|
||||
<string name="app_name">My Tracks</string>
|
||||
|
||||
<!-- About Page -->
|
||||
<string name="about_weburl">mytracks.appspot.com</string>
|
||||
<string name="my_tracks_web_url">mytracks.appspot.com</string>
|
||||
|
||||
<!-- About Dialog -->
|
||||
<string name="about_googlegroups">mytracks@googlegroups.com</string>
|
||||
<string name="about_privacy_weburl">m.google.com/privacy</string>
|
||||
<string name="about_bart">Bartłomiej Niechwiej</string>
|
||||
<string name="about_dylan">Dylan Casey</string>
|
||||
@@ -45,9 +47,9 @@ limitations under the License.
|
||||
<string name="unknown">-</string>
|
||||
|
||||
<!-- Send to Google URLs -->
|
||||
<string name="sendtogoogle_google_mymaps_url">maps.google.com</string>
|
||||
<string name="sendtogoogle_google_fusiontables_url">google.com/fusiontables</string>
|
||||
<string name="sendtogoogle_google_docs_url">docs.google.com</string>
|
||||
<string name="send_google_fusion_tables_url">google.com/fusiontables</string>
|
||||
<string name="send_google_my_maps_url">maps.google.com</string>
|
||||
<string name="send_google_docs_url">docs.google.com</string>
|
||||
|
||||
<!-- Google Analytics ID -->
|
||||
<string name="google_analytics_id">UA-7222692-2</string>
|
||||
@@ -57,7 +59,6 @@ limitations under the License.
|
||||
|
||||
<!-- Intent Actions -->
|
||||
<string name="save_intent_action">android.intent.action.SAVE</string>
|
||||
<string name="open_settings_screen">android.intent.action.settings.OPEN</string>
|
||||
<string name="start_new_track_action">com.google.android.apps.mytracks.START_NEW_TRACK</string>
|
||||
<string name="end_current_track_action">
|
||||
com.google.android.apps.mytracks.END_CURRENT_TRACK
|
||||
|
||||
@@ -23,6 +23,7 @@ limitations under the License.
|
||||
<string name="auto_resume_track_timeout_key">autoResumeTrackTimeout</string>
|
||||
<string name="bluetooth_pairing_key">bluetoothPairing</string>
|
||||
<string name="bluetooth_sensor_key">bluetoothSensor</string>
|
||||
<string name="default_category_key">defaultCategory</string>
|
||||
<string name="default_map_public_key">defaultMapPublic</string>
|
||||
<string name="max_recording_distance_key">maxRecordingDistance</string>
|
||||
<string name="metric_units_key">metricUnits</string>
|
||||
@@ -57,7 +58,6 @@ limitations under the License.
|
||||
<!-- Keys for non-persisted preferences. Sorted alphabetically. - DO NOT TRANSLATE -->
|
||||
<string name="ant_options_key">antOptions</string>
|
||||
<string name="backup_to_sd_key">backupToSd</string>
|
||||
<string name="display_settings_screen_key">displaySettingsScreen</string>
|
||||
<string name="reset_key">resetToDefaults</string>
|
||||
<string name="restore_from_sd_key">restoreFromSd</string>
|
||||
<string name="sensor_options_key">sensorOptions</string>
|
||||
|
||||
@@ -86,14 +86,12 @@ limitations under the License.
|
||||
Unable to insert marker. No GPS location. Try again.
|
||||
</string>
|
||||
|
||||
<!-- A generic error message. -->
|
||||
<string name="error_generic"
|
||||
translation_description="In an alert dialog, a generic error message indicating that an error
|
||||
has occurred and asking the user to try again.">
|
||||
<!-- Error messages when sending to Google. -->
|
||||
<string name="error_sending_to_google"
|
||||
translation_description="When sending a track to Google, a message indicating that an error has
|
||||
occurred and ask the user to try again.">
|
||||
An error occurred. Please try again.
|
||||
</string>
|
||||
|
||||
<!-- Error messages when sending to Google. -->
|
||||
<string name="error_sending_to_my_maps"
|
||||
translation_description="When sending a track to Google My Maps, a message indicating that an
|
||||
error has occured.">
|
||||
@@ -108,27 +106,8 @@ limitations under the License.
|
||||
translation_description="When sending a track to Google Docs, a message indicating that an error
|
||||
has occurred.">
|
||||
There was an error while sending your track to Google Docs.
|
||||
</string>
|
||||
|
||||
<!-- Error messages when importing a track. -->
|
||||
<string name="error_import_unable_to_read_file"
|
||||
translation_description="When importing a track from the SD card, a messsage indicating that
|
||||
My Tracks is unable to read the file.">
|
||||
Unable to read from file.
|
||||
</string>
|
||||
<string name="error_import_invalid_gpx_format"
|
||||
translation_description="When importing a track from the SD card, a message indicating that
|
||||
the file does not have a valid GPX format.">
|
||||
File does not have a valid GPX format.
|
||||
</string>
|
||||
|
||||
<!-- TODO(jshih@google.com) confirm if the file size limit is still 500 KB. -->
|
||||
<string name="error_import_out_of_memory"
|
||||
translation_description="When importing a track from the SD card, a message indicating that
|
||||
the file is too big, must be less than 500 KB, and aborting.">
|
||||
This file is too big (must be less than 500 KB). Aborting.
|
||||
</string>
|
||||
|
||||
</string>
|
||||
|
||||
<!-- Error messages when exporting a track. -->
|
||||
<string name="error_export_generic"
|
||||
translation_description="When exporting a track to the SD card, a generic error message
|
||||
@@ -189,32 +168,37 @@ limitations under the License.
|
||||
the result page.">
|
||||
It may take a few minutes before new tracks appear.
|
||||
</string>
|
||||
<string name="sending_to_my_maps_success_new_map"
|
||||
translation_description="When sending a track to Google My Maps, the message on the result page
|
||||
indicating that a new map is created.">
|
||||
A new Google My Map has been created at maps.google.com.
|
||||
<string name="send_google_docs_existing_doc_success"
|
||||
translation_description="When sending a track to Google Docs, the message on the result page
|
||||
indicating that the track is sent to an existing spreadsheet. E.g., 'Your track has been sent
|
||||
to docs.google.com.'.">
|
||||
Your track has been sent to %s.
|
||||
</string>
|
||||
<string name="sending_to_my_maps_success_existing_map"
|
||||
translation_description="When sending a track to Google My Maps, the message on the result page
|
||||
indicating that the track is sent to an existing map.">
|
||||
Your track has been sent to maps.google.com.
|
||||
<string name="send_google_docs_new_doc_success"
|
||||
translation_description="When sending a track to Google Docs, the message on the result page
|
||||
indicating that a new spreadsheet is created. E.g., 'A new spreadsheet is created at
|
||||
docs.google.com.'.">
|
||||
A new spreadsheet is created at %s.
|
||||
</string>
|
||||
<string name="sending_to_fusion_tables_success"
|
||||
<string name="send_google_fusion_tables_success"
|
||||
translation_description="When sending a track to Google Fusion Tables, the message on the result
|
||||
page indicating success.">
|
||||
A new Google Fusion table has been created at google.com/fusiontables.
|
||||
page indicating success. E.g., 'A new Google Fusion table has been created at
|
||||
google.com/fusiontables.'">
|
||||
A new Google Fusion table has been created at %s.
|
||||
</string>
|
||||
<string name="sending_to_docs_success_new_doc"
|
||||
translation_description="When sending a track to Google Docs, the message on the result page
|
||||
indicating that a new spreadsheet is created.">
|
||||
A new spreadsheet is created at docs.google.com.
|
||||
<string name="send_google_my_maps_existing_map_success"
|
||||
translation_description="When sending a track to Google My Maps, the message on the result page
|
||||
indicating that the track is sent to an existing map. E.g., 'Your track has been sent to
|
||||
maps.google.com.'">
|
||||
Your track has been sent to %s.
|
||||
</string>
|
||||
<string name="sending_to_docs_success_existing_doc"
|
||||
translation_description="When sending a track to Google Docs, the message on the result page
|
||||
indicating that the track is sent to an existing spreadsheet.">
|
||||
Your track has been sent to docs.google.com.
|
||||
<string name="send_google_my_maps_new_map_success"
|
||||
translation_description="When sending a track to Google My Maps, the message on the result page
|
||||
indicating that a new map is created. E.g., 'A new Google My Map has been created at
|
||||
maps.google.com.'.">
|
||||
A new Google My Map has been created at %s.
|
||||
</string>
|
||||
|
||||
|
||||
<!-- Progress dialog title -->
|
||||
<string name="progress_title"
|
||||
translation_description="When displaying a progress dialog, the title on the dialog asking the
|
||||
@@ -274,12 +258,7 @@ limitations under the License.
|
||||
Sending a track to Google Docs...
|
||||
</string>
|
||||
|
||||
<!-- Import and Export progress messages. -->
|
||||
<string name="progress_message_import"
|
||||
translation_description="When importing a track from the SD card, the message on the progress
|
||||
dialog indicating that it may take a while.">
|
||||
Importing a track from the SD card. This may take a while.
|
||||
</string>
|
||||
<!-- Export progress messages. -->
|
||||
<string name="progress_message_export"
|
||||
translation_description="When exporting a track to the SD card, the message on the progress
|
||||
dialog indicating that it may take a while.">
|
||||
@@ -310,12 +289,12 @@ limitations under the License.
|
||||
</string>
|
||||
|
||||
<!-- Text and link when uploading to Google. -->
|
||||
<!-- TODO(jshih@google.com) remove the html href tag from this string. -->
|
||||
<string name="send_to_google_by_mytracks"
|
||||
<string name="send_google_by_my_tracks"
|
||||
translation_description="When sending a track to Google, a note indicating it is created by
|
||||
My Tracks on Android, with the 'My Tracks' word containng a http link to
|
||||
http://mytracks.appspot.com.">
|
||||
Created by <a href=\'http://mytracks.appspot.com\'>My Tracks</a> on Android.
|
||||
My Tracks on Android. The two string placeholders are used to insert the html link tags around
|
||||
'My Tracks'. E.g., 'Created by <a href=\'http://mytracks.appspot.com\'>My Tracks
|
||||
</a> on Android.'.">
|
||||
Created by %1$sMy Tracks%2$s on Android.
|
||||
</string>
|
||||
|
||||
<!-- Tags for a track description. -->
|
||||
@@ -528,7 +507,7 @@ limitations under the License.
|
||||
<string name="import_multi_done"
|
||||
translation_description="After importing all the tracks from the SD card, the alert message
|
||||
indicating success. E.g., 'Imported 5 of 6 GPX files from /mnt/sdcard/MyTracks/gpx/'.">
|
||||
Imported %1$d of %2$d GPX files from %3$s
|
||||
Imported to My Tracks %1$d of %2$d GPX files from %3$s
|
||||
</string>
|
||||
<string name="import_multi_empty"
|
||||
translation_description="After importing all the tracks from the SD card, the alert message
|
||||
@@ -541,15 +520,6 @@ limitations under the License.
|
||||
one of the tracks. E.g., 'Import error for file /mnt/sdcard/MyTacks/gpx/1.gpx'.">
|
||||
Import error for file %s
|
||||
</string>
|
||||
<string name="import_success"
|
||||
translation_description="After successfully importing one track, the message on the confirmation
|
||||
dialog. E.g., 'Successfully imported 5 track(s) from file'.">
|
||||
Successfully imported %d track(s) from file.
|
||||
</string>
|
||||
<string name="import_show_track"
|
||||
translation_description="After importing one track, the button to see the track.">
|
||||
Show track
|
||||
</string>
|
||||
|
||||
<!-- Markers page. -->
|
||||
<string name="waypointslist_pick_one"
|
||||
@@ -879,7 +849,17 @@ limitations under the License.
|
||||
name' checkbox when it is unchecked explaining using a number as the default track name.">
|
||||
Use a number as the default track name
|
||||
</string>
|
||||
|
||||
<string name="settings_default_category"
|
||||
translation_description="In the Recording settings, the option to specify a new track's default
|
||||
activity type.">
|
||||
Default activity type
|
||||
</string>
|
||||
<string name="settings_default_category_summary"
|
||||
translation_description="In the Recording settings, the summary for the 'Default activity type'
|
||||
option explaining that it sets the default activity type for a new track.">
|
||||
Default activity type for a new track.
|
||||
</string>
|
||||
|
||||
<!-- Sensor settings -->
|
||||
<string name="settings_sensor_type"
|
||||
translation_description="In the Sensor settings, the dropdown option to choose a sensor type.">
|
||||
@@ -1630,18 +1610,23 @@ limitations under the License.
|
||||
My Tracks total distance %1$.2f %2$s in %3$s at %4$s %5$s
|
||||
</string>
|
||||
|
||||
<!-- Check Units -->
|
||||
<string name="check_units_title"
|
||||
translation_description="The title of the dialog asking the user to confirm if he wants to use
|
||||
metrics as the preferred units.">
|
||||
<!-- Preferred Units -->
|
||||
<string name="preferred_units_title"
|
||||
translation_description="The title of the dialog asking the user to choose a preferred units,
|
||||
metric or imperial.">
|
||||
Preferred Units
|
||||
</string>
|
||||
<string name="check_units_message"
|
||||
translation_description="The message of the dialog asking the user to confirm if he wants to use
|
||||
metrics as the preferred units.">
|
||||
Do you want to use metrics as the preferred units?
|
||||
<string name="preferred_units_metric"
|
||||
translation_description="In the dialog asking the user to choose a preferred units, the option
|
||||
to choose the metric units.">
|
||||
Metric
|
||||
</string>
|
||||
|
||||
<string name="preferred_units_imperial"
|
||||
translation_description="In the dialog asking the user to choose a preferred units, the option
|
||||
to choose the imperial units.">
|
||||
Imperial
|
||||
</string>
|
||||
|
||||
<!-- Sensor State page -->
|
||||
<string name="sensor_data_time"
|
||||
translation_description="In the 'Sensor State' page, the label for the last time the sensor has
|
||||
|
||||
@@ -18,8 +18,7 @@ limitations under the License.
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<!-- Display settings -->
|
||||
<PreferenceScreen android:title="@string/settings_display"
|
||||
android:key="@string/display_settings_screen_key">
|
||||
<PreferenceScreen android:title="@string/settings_display">
|
||||
<CheckBoxPreference
|
||||
android:key="@string/metric_units_key"
|
||||
android:title="@string/settings_metric_units"
|
||||
@@ -144,6 +143,12 @@ limitations under the License.
|
||||
android:summaryOn="@string/settings_timestamp_track_name_summary_on"
|
||||
android:summaryOff="@string/settings_timestamp_track_name_summary_off"
|
||||
android:defaultValue="true" />
|
||||
|
||||
<com.google.android.apps.mytracks.AutoCompleteTextPreference
|
||||
android:key="@string/default_category_key"
|
||||
android:title="@string/settings_default_category"
|
||||
android:summary="@string/settings_default_category_summary"
|
||||
android:defaultValue="" />
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.preference.EditTextPreference;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewParent;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
|
||||
/**
|
||||
* The {@link AutoCompleteTextPreference} class is a preference that allows for
|
||||
* string input using auto complete . It is a subclass of
|
||||
* {@link EditTextPreference} and shows the {@link AutoCompleteTextView} in a
|
||||
* dialog.
|
||||
* <p>
|
||||
* This preference will store a string into the SharedPreferences.
|
||||
*
|
||||
* @author Rimas Trumpa (with Matt Levan)
|
||||
*/
|
||||
public class AutoCompleteTextPreference extends EditTextPreference {
|
||||
|
||||
private AutoCompleteTextView mEditText = null;
|
||||
|
||||
public AutoCompleteTextPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mEditText = new AutoCompleteTextView(context, attrs);
|
||||
mEditText.setThreshold(0);
|
||||
|
||||
// Gets autocomplete values for 'Default Activity' preference
|
||||
if (getKey().equals(context.getString(R.string.default_category_key))) {
|
||||
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(context,
|
||||
R.array.activity_types, android.R.layout.simple_dropdown_item_1line);
|
||||
mEditText.setAdapter(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(View view) {
|
||||
AutoCompleteTextView editText = mEditText;
|
||||
editText.setText(getText());
|
||||
|
||||
ViewParent oldParent = editText.getParent();
|
||||
if (oldParent != view) {
|
||||
if (oldParent != null) {
|
||||
((ViewGroup) oldParent).removeView(editText);
|
||||
}
|
||||
onAddEditTextToDialogView(view, editText);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDialogClosed(boolean positiveResult) {
|
||||
if (positiveResult) {
|
||||
String value = mEditText.getText().toString();
|
||||
if (callChangeListener(value)) {
|
||||
setText(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,73 +23,63 @@ import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Check to see if the units are the default for the locale.
|
||||
* This comes down to warning Americans that the default is metric.
|
||||
* Checks with the user if he prefers the metric units or the imperial units.
|
||||
*
|
||||
* @author Sandor Dornbush
|
||||
*/
|
||||
class CheckUnits {
|
||||
private static final String PREFERENCE_UNITS_CHECKED = "checkunits.checked";
|
||||
private static final String PREFERENCES_CHECK_UNITS = "checkunits";
|
||||
private static final String CHECK_UNITS_PREFERENCE_FILE = "checkunits";
|
||||
private static final String CHECK_UNITS_PREFERENCE_KEY = "checkunits.checked";
|
||||
private static boolean metric = true;
|
||||
|
||||
static void check(final Context context) {
|
||||
final SharedPreferences preferences =
|
||||
context.getSharedPreferences(PREFERENCES_CHECK_UNITS, Activity.MODE_PRIVATE);
|
||||
|
||||
// Has the user already warned about the default units?
|
||||
if (preferences.getBoolean(PREFERENCE_UNITS_CHECKED, false)) {
|
||||
public static void check(final Context context) {
|
||||
final SharedPreferences checkUnitsSharedPreferences = context.getSharedPreferences(
|
||||
CHECK_UNITS_PREFERENCE_FILE, Activity.MODE_PRIVATE);
|
||||
if (checkUnitsSharedPreferences.getBoolean(CHECK_UNITS_PREFERENCE_KEY, false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Is the user in the US?
|
||||
Locale current = Locale.getDefault();
|
||||
Locale enUs = new Locale(Locale.ENGLISH.getLanguage(),
|
||||
Locale.US.getCountry());
|
||||
if (!current.equals(enUs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(R.string.check_units_title);
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(context.getString(R.string.preferred_units_title));
|
||||
CharSequence[] items = { context.getString(R.string.preferred_units_metric),
|
||||
context.getString(R.string.preferred_units_imperial) };
|
||||
builder.setSingleChoiceItems(items, 0, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
recordCheckPerformed(preferences);
|
||||
if (which == 0) {
|
||||
metric = true;
|
||||
} else {
|
||||
metric = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
builder.setCancelable(true);
|
||||
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
changeDefaultUnits(context, preferences);
|
||||
recordCheckPerformed(checkUnitsSharedPreferences);
|
||||
SharedPreferences useMetricPreferences = context.getSharedPreferences(
|
||||
Constants.SETTINGS_NAME, Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = useMetricPreferences.edit();
|
||||
String key = context.getString(R.string.metric_units_key);
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(
|
||||
editor.putBoolean(key, metric));
|
||||
}
|
||||
});
|
||||
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||
public void onCancel(DialogInterface dialog) {
|
||||
recordCheckPerformed(preferences);
|
||||
recordCheckPerformed(checkUnitsSharedPreferences);
|
||||
}
|
||||
});
|
||||
builder.setMessage(R.string.check_units_message);
|
||||
builder.show();
|
||||
}
|
||||
|
||||
private static void changeDefaultUnits(Context context, SharedPreferences preferences) {
|
||||
recordCheckPerformed(preferences);
|
||||
Intent startIntent = new Intent(context, SettingsActivity.class);
|
||||
startIntent.putExtra(context.getString(R.string.open_settings_screen),
|
||||
context.getString(R.string.display_settings_screen_key));
|
||||
context.startActivity(startIntent);
|
||||
}
|
||||
|
||||
private static void recordCheckPerformed(SharedPreferences preferences) {
|
||||
ApiFeatures.getInstance().getApiAdapter().applyPreferenceChanges(
|
||||
preferences.edit().putBoolean(PREFERENCE_UNITS_CHECKED, true));
|
||||
preferences.edit().putBoolean(CHECK_UNITS_PREFERENCE_KEY, true));
|
||||
}
|
||||
|
||||
private CheckUnits() {
|
||||
}
|
||||
private CheckUnits() {}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.google.android.apps.mytracks;
|
||||
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
import com.google.android.apps.mytracks.content.TracksColumns;
|
||||
import com.google.android.apps.mytracks.io.file.GpxImporter;
|
||||
import com.google.android.apps.mytracks.util.FileUtils;
|
||||
import com.google.android.apps.mytracks.util.SystemUtils;
|
||||
@@ -24,7 +25,11 @@ import com.google.android.maps.mytracks.R;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentUris;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.PowerManager.WakeLock;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
@@ -49,22 +54,36 @@ import org.xml.sax.SAXException;
|
||||
public class ImportAllTracks {
|
||||
|
||||
private final Activity activity;
|
||||
private FileUtils fileUtils;
|
||||
private boolean singleTrackSelected;
|
||||
private String gpxPath;
|
||||
private WakeLock wakeLock;
|
||||
private ProgressDialog progress;
|
||||
private FileUtils fileUtils;
|
||||
private String gpxPath;
|
||||
private int gpxFileCount;
|
||||
private int importSuccessCount;
|
||||
|
||||
private long importedTrackIds[];
|
||||
|
||||
public ImportAllTracks(Activity activity) {
|
||||
this.activity = activity;
|
||||
Log.i(Constants.TAG, "ImportAllTracks: Starting");
|
||||
fileUtils = new FileUtils();
|
||||
gpxPath = fileUtils.buildExternalDirectoryPath("gpx");
|
||||
|
||||
new Thread(runner).start();
|
||||
this(activity, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor to import tracks.
|
||||
*
|
||||
* @param activity the activity
|
||||
* @param path path of the gpx file to import and display. If null, then just
|
||||
* import all the gpx files under MyTracks/gpx and do not display any
|
||||
* track.
|
||||
*/
|
||||
public ImportAllTracks(Activity activity, String path) {
|
||||
Log.i(Constants.TAG, "ImportAllTracks: Starting");
|
||||
this.activity = activity;
|
||||
fileUtils = new FileUtils();
|
||||
singleTrackSelected = path != null;
|
||||
gpxPath = path == null ? fileUtils.buildExternalDirectoryPath("gpx") : path;
|
||||
new Thread(runner).start();
|
||||
}
|
||||
|
||||
private final Runnable runner = new Runnable() {
|
||||
public void run() {
|
||||
aquireLocksAndImport();
|
||||
@@ -81,7 +100,7 @@ public class ImportAllTracks {
|
||||
if (prefs != null) {
|
||||
recordingTrackId = prefs.getLong(activity.getString(R.string.recording_track_key), -1);
|
||||
}
|
||||
if (recordingTrackId != -1) {
|
||||
if (recordingTrackId == -1) {
|
||||
wakeLock = SystemUtils.acquireWakeLock(activity, wakeLock);
|
||||
}
|
||||
|
||||
@@ -107,12 +126,26 @@ public class ImportAllTracks {
|
||||
Log.i(Constants.TAG, "ImportAllTracks: Done");
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
if (gpxFileCount == 0) {
|
||||
builder.setMessage(activity.getString(R.string.import_multi_empty, gpxPath + "/"));
|
||||
builder.setMessage(activity.getString(R.string.import_multi_empty, gpxPath));
|
||||
} else {
|
||||
builder.setMessage(activity.getString(R.string.import_multi_done, importSuccessCount, gpxFileCount,
|
||||
gpxPath + "/"));
|
||||
gpxPath));
|
||||
}
|
||||
builder.setPositiveButton(R.string.ok, null);
|
||||
builder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
if (singleTrackSelected) {
|
||||
long lastTrackId = importedTrackIds[importedTrackIds.length - 1];
|
||||
Uri trackUri = ContentUris.withAppendedId(TracksColumns.CONTENT_URI, lastTrackId);
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(trackUri, TracksColumns.CONTENT_ITEMTYPE);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
activity.startActivity(intent);
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
builder.show();
|
||||
}
|
||||
|
||||
@@ -185,7 +218,7 @@ public class ImportAllTracks {
|
||||
private boolean importFile(File gpxFile, MyTracksProviderUtils providerUtils) {
|
||||
Log.i(Constants.TAG, "ImportAllTracks: importing: " + gpxFile.getName());
|
||||
try {
|
||||
GpxImporter.importGPXFile(new FileInputStream(gpxFile), providerUtils);
|
||||
importedTrackIds = GpxImporter.importGPXFile(new FileInputStream(gpxFile), providerUtils);
|
||||
return true;
|
||||
} catch (FileNotFoundException e) {
|
||||
Log.w(Constants.TAG, "GPX file wasn't found/went missing: "
|
||||
@@ -203,15 +236,22 @@ public class ImportAllTracks {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of the GPX Files found in the GPX directory.
|
||||
* Gets a list of the GPX files. If singleTrackSelected is true, returns a
|
||||
* list containing just the gpxPath file. If singleTrackSelected is false,
|
||||
* returns a list of GPX files under the gpxPath directory.
|
||||
*/
|
||||
private List<File> getGpxFiles() {
|
||||
List<File> gpxFiles = new LinkedList<File>();
|
||||
File[] gpxFileCandidates = new File(gpxPath).listFiles();
|
||||
if (gpxFileCandidates != null) {
|
||||
for (File file : gpxFileCandidates) {
|
||||
if (!file.isDirectory() && file.getName().endsWith(".gpx")) {
|
||||
gpxFiles.add(file);
|
||||
List<File> gpxFiles = new LinkedList<File>();
|
||||
File file = new File(gpxPath);
|
||||
if (singleTrackSelected) {
|
||||
gpxFiles.add(file);
|
||||
} else {
|
||||
File[] gpxFileCandidates = file.listFiles();
|
||||
if (gpxFileCandidates != null) {
|
||||
for (File candidate : gpxFileCandidates) {
|
||||
if (!candidate.isDirectory() && candidate.getName().endsWith(".gpx")) {
|
||||
gpxFiles.add(candidate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,10 +54,6 @@ import java.util.Set;
|
||||
/**
|
||||
* An activity that let's the user see and edit the settings.
|
||||
*
|
||||
* This activity has two entry points, "root" and "display" preference screen.
|
||||
* If bundle.getString("open_settings_screen") is set to "display_settings_screen_key", then
|
||||
* the "display" preference screen is shown, otherwise, the "root" display preference is shown.
|
||||
*
|
||||
* @author Leif Hendrik Wilden
|
||||
* @author Rodrigo Damazio
|
||||
*/
|
||||
@@ -104,16 +100,6 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
protected void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
|
||||
initActivityCommons();
|
||||
|
||||
// If we only need the display setting screen nothing else needs to load.
|
||||
if (processIntent())
|
||||
return;
|
||||
|
||||
initActivitySpecifics();
|
||||
}
|
||||
|
||||
private void initActivityCommons() {
|
||||
// The volume we want to control is the Text-To-Speech volume
|
||||
ApiFeatures apiFeatures = ApiFeatures.getInstance();
|
||||
int volumeStream =
|
||||
@@ -146,9 +132,7 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
|
||||
setRecordingIntervalOptions();
|
||||
setAutoResumeTimeoutOptions();
|
||||
}
|
||||
|
||||
private void initActivitySpecifics() {
|
||||
|
||||
// Hook up switching of displayed list entries between metric and imperial
|
||||
// units
|
||||
CheckBoxPreference metricUnitsPreference =
|
||||
@@ -259,23 +243,6 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
list.setEntries(options);
|
||||
}
|
||||
|
||||
private boolean processIntent() {
|
||||
boolean showDisplaySettings = false;
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
PreferenceScreen preferenceScreen;
|
||||
String intentString = getString(R.string.open_settings_screen);
|
||||
|
||||
if (bundle != null) {
|
||||
preferenceScreen = (PreferenceScreen) findPreference(bundle.getString(intentString));
|
||||
if (preferenceScreen != null) {
|
||||
showDisplaySettings = true;
|
||||
setPreferenceScreen(preferenceScreen);
|
||||
}
|
||||
}
|
||||
|
||||
return showDisplaySettings;
|
||||
}
|
||||
|
||||
private void customizeSensorOptionsPreferences() {
|
||||
ListPreference sensorTypePreference =
|
||||
(ListPreference) findPreference(getString(R.string.sensor_type_key));
|
||||
@@ -352,10 +319,6 @@ public class SettingsActivity extends PreferenceActivity {
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
// If we only need the display setting screen nothing else needs to load.
|
||||
if (processIntent())
|
||||
return;
|
||||
|
||||
configureBluetoothPreferences();
|
||||
Preference backupNowPreference =
|
||||
findPreference(getString(R.string.backup_to_sd_key));
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.io.docs.DocsHelper;
|
||||
import com.google.android.apps.mytracks.io.gdata.GDataClientFactory;
|
||||
import com.google.android.apps.mytracks.io.gdata.GDataWrapper;
|
||||
import com.google.android.apps.mytracks.io.sendtogoogle.SendType;
|
||||
import com.google.android.common.gdata.AndroidXmlParserFactory;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.wireless.gdata.client.GDataClient;
|
||||
@@ -115,13 +116,11 @@ public class SendToDocs {
|
||||
Log.d(Constants.TAG, "SendToDocs: Uploading to spreadsheet");
|
||||
success = uploadToDocs(track);
|
||||
if (success) {
|
||||
if (createdNewSpreadSheet) {
|
||||
statusMessage = activity.getString(
|
||||
R.string.sending_to_docs_success_new_doc);
|
||||
} else {
|
||||
statusMessage = activity.getString(
|
||||
R.string.sending_to_docs_success_existing_doc);
|
||||
}
|
||||
String format = createdNewSpreadSheet
|
||||
? activity.getString(R.string.send_google_docs_new_doc_success)
|
||||
: activity.getString(R.string.send_google_docs_existing_doc_success);
|
||||
String url = activity.getString(SendType.DOCS.getServiceUrl());
|
||||
statusMessage = String.format(format, url);
|
||||
} else {
|
||||
statusMessage = activity.getString(R.string.error_sending_to_docs);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.gdata.GDataWrapper;
|
||||
import com.google.android.apps.mytracks.io.gdata.GDataWrapper.QueryFunction;
|
||||
import com.google.android.apps.mytracks.io.sendtogoogle.SendType;
|
||||
import com.google.android.apps.mytracks.stats.DoubleBuffer;
|
||||
import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||
import com.google.android.apps.mytracks.util.ApiFeatures;
|
||||
@@ -71,7 +72,7 @@ public class SendToFusionTables implements Runnable {
|
||||
* Listener invoked when sending to fusion tables completes.
|
||||
*/
|
||||
public interface OnSendCompletedListener {
|
||||
void onSendCompleted(String tableId, boolean success, int statusMessage);
|
||||
void onSendCompleted(String tableId, boolean success, String statusMessage);
|
||||
}
|
||||
|
||||
/** The GData service id for Fusion Tables. */
|
||||
@@ -168,7 +169,7 @@ public class SendToFusionTables implements Runnable {
|
||||
}
|
||||
|
||||
private void doUpload() {
|
||||
int statusMessageId = R.string.error_sending_to_fusion_tables;
|
||||
String statusMessage = context.getString(R.string.error_sending_to_fusion_tables);
|
||||
boolean success = true;
|
||||
try {
|
||||
progressIndicator.setProgressValue(PROGRESS_INITIALIZATION);
|
||||
@@ -205,17 +206,18 @@ public class SendToFusionTables implements Runnable {
|
||||
return;
|
||||
}
|
||||
|
||||
statusMessageId = R.string.sending_to_fusion_tables_success;
|
||||
String format = context.getString(R.string.send_google_fusion_tables_success);
|
||||
String url = context.getString(SendType.FUSION_TABLES.getServiceUrl());
|
||||
statusMessage = String.format(format, url);
|
||||
Log.d(Constants.TAG, "SendToFusionTables: Done: " + success);
|
||||
progressIndicator.setProgressValue(PROGRESS_COMPLETE);
|
||||
} finally {
|
||||
final boolean finalSuccess = success;
|
||||
final int finalStatusMessageId = statusMessageId;
|
||||
final String finalStatusMessage = statusMessage;
|
||||
context.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (onCompletion != null) {
|
||||
onCompletion.onSendCompleted(
|
||||
tableId, finalSuccess, finalStatusMessageId);
|
||||
onCompletion.onSendCompleted(tableId, finalSuccess, finalStatusMessage);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.mymaps.MapsFacade;
|
||||
import com.google.android.apps.mytracks.io.sendtogoogle.SendType;
|
||||
import com.google.android.apps.mytracks.stats.DoubleBuffer;
|
||||
import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||
import com.google.android.apps.mytracks.util.LocationUtils;
|
||||
@@ -75,7 +76,7 @@ public class SendToMyMaps implements Runnable {
|
||||
private int totalSegmentsUploaded;
|
||||
|
||||
public interface OnSendCompletedListener {
|
||||
void onSendCompleted(String mapId, boolean success, int statusMessage);
|
||||
void onSendCompleted(String mapId, boolean success, String statusMessage);
|
||||
}
|
||||
|
||||
public SendToMyMaps(Activity context, String mapId, AuthManager auth,
|
||||
@@ -98,7 +99,7 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
private void doUpload() {
|
||||
int statusMessageId = R.string.error_sending_to_my_maps;
|
||||
String statusMessage = context.getString(R.string.error_sending_to_my_maps);
|
||||
boolean success = true;
|
||||
try {
|
||||
progressIndicator.setProgressMessage(
|
||||
@@ -173,9 +174,11 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
if (success) {
|
||||
statusMessageId = isNewMap
|
||||
? R.string.sending_to_my_maps_success_new_map
|
||||
: R.string.sending_to_my_maps_success_existing_map;
|
||||
String format = isNewMap
|
||||
? context.getString(R.string.send_google_my_maps_new_map_success)
|
||||
: context.getString(R.string.send_google_my_maps_existing_map_success);
|
||||
String url = context.getString(SendType.MYMAPS.getServiceUrl());
|
||||
statusMessage = String.format(format, url);
|
||||
}
|
||||
Log.d(TAG, "SendToMyMaps: Done: " + success);
|
||||
progressIndicator.setProgressValue(100);
|
||||
@@ -185,12 +188,11 @@ public class SendToMyMaps implements Runnable {
|
||||
}
|
||||
|
||||
final boolean finalSuccess = success;
|
||||
final int finalStatusMessageId = statusMessageId;
|
||||
final String finalStatusMessage = statusMessage;
|
||||
context.runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
if (onCompletion != null) {
|
||||
onCompletion.onSendCompleted(
|
||||
mapId, finalSuccess, finalStatusMessageId);
|
||||
onCompletion.onSendCompleted(mapId, finalSuccess, finalStatusMessage);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,56 +17,21 @@ package com.google.android.apps.mytracks.io.file;
|
||||
|
||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
import com.google.android.apps.mytracks.content.TracksColumns;
|
||||
import com.google.android.apps.mytracks.ImportAllTracks;
|
||||
import com.google.android.apps.mytracks.util.UriUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.AlertDialog.Builder;
|
||||
import android.app.Dialog;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.ContentUris;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
/**
|
||||
* Helper activity which imports tracks from a file.
|
||||
* An activity that imports a track from a file and displays the track in My Tracks.
|
||||
*
|
||||
* @author Rodrigo Damazio
|
||||
*/
|
||||
public class ImportActivity extends Activity {
|
||||
|
||||
private static final int PROGRESS_DIALOG = 1;
|
||||
private static final int SUCCESS_DIALOG = 2;
|
||||
private static final int FAILURE_DIALOG = 3;
|
||||
|
||||
private MyTracksProviderUtils providerUtils;
|
||||
|
||||
private ProgressDialog progressDialog;
|
||||
private int resultMessage;
|
||||
private long importedTrackIds[];
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedState) {
|
||||
super.onCreate(savedState);
|
||||
|
||||
providerUtils = MyTracksProviderUtils.Factory.get(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
@@ -74,143 +39,20 @@ public class ImportActivity extends Activity {
|
||||
Intent intent = getIntent();
|
||||
String action = intent.getAction();
|
||||
Uri data = intent.getData();
|
||||
if (!(Intent.ACTION_VIEW.equals(action) || Intent.ACTION_ATTACH_DATA.equals(action))
|
||||
|| !UriUtils.isFileUri(data)) {
|
||||
Log.e(TAG, "Received an intent with unsupported action or data: " + intent);
|
||||
if (!(Intent.ACTION_VIEW.equals(action) || Intent.ACTION_ATTACH_DATA.equals(action))) {
|
||||
Log.e(TAG, "Received an intent with unsupported action: " + intent);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.i(TAG, "Importing GPX file at " + data);
|
||||
startTrackImport(data.getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog(int id) {
|
||||
switch (id) {
|
||||
case PROGRESS_DIALOG:
|
||||
progressDialog = new ProgressDialog(this);
|
||||
progressDialog.setIcon(android.R.drawable.ic_dialog_info);
|
||||
progressDialog.setTitle(R.string.progress_title);
|
||||
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
progressDialog.setMessage(getString(R.string.progress_message_import));
|
||||
return progressDialog;
|
||||
case SUCCESS_DIALOG:
|
||||
final Builder dialogBuilder = new AlertDialog.Builder(this);
|
||||
dialogBuilder.setCancelable(true);
|
||||
dialogBuilder.setPositiveButton(android.R.string.ok, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
dialogBuilder.setNegativeButton(R.string.import_show_track, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
showImportedTrack();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
return dialogBuilder.create();
|
||||
case FAILURE_DIALOG:
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setPositiveButton(R.string.ok, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface arg0, int arg1) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
builder.setIcon(android.R.drawable.ic_dialog_alert);
|
||||
builder.setTitle(R.string.error);
|
||||
return builder.create();
|
||||
|
||||
|
||||
if (!UriUtils.isFileUri(data)) {
|
||||
Log.e(TAG, "Received an intent with unsupported data: " + intent);
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPrepareDialog(int id, Dialog dialog) {
|
||||
super.onPrepareDialog(id, dialog);
|
||||
|
||||
switch (id) {
|
||||
case SUCCESS_DIALOG:
|
||||
AlertDialog successDialog = (AlertDialog) dialog;
|
||||
successDialog.setMessage(getString(R.string.import_success, importedTrackIds.length));
|
||||
break;
|
||||
case FAILURE_DIALOG:
|
||||
AlertDialog failureDialog = (AlertDialog) dialog;
|
||||
failureDialog.setMessage(getString(resultMessage));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void showImportedTrack() {
|
||||
long lastTrackId = importedTrackIds[importedTrackIds.length - 1];
|
||||
Uri trackUri = ContentUris.withAppendedId(TracksColumns.CONTENT_URI, lastTrackId);
|
||||
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setDataAndType(trackUri, TracksColumns.CONTENT_ITEMTYPE);
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
private void startTrackImport(final String fileName) {
|
||||
showDialog(PROGRESS_DIALOG);
|
||||
|
||||
Thread t = new Thread() {
|
||||
@Override
|
||||
public void run() {
|
||||
resultMessage = R.string.success;
|
||||
|
||||
importedTrackIds = null;
|
||||
|
||||
try {
|
||||
try {
|
||||
InputStream is = new FileInputStream(fileName);
|
||||
importedTrackIds = GpxImporter.importGPXFile(is, providerUtils);
|
||||
} catch (SAXException e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_generic;
|
||||
} catch (ParserConfigurationException e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_generic;
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_import_unable_to_read_file;
|
||||
} catch (NullPointerException e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_import_invalid_gpx_format;
|
||||
} catch (OutOfMemoryError e) {
|
||||
Log.e(TAG, "Caught an unexpected exception.", e);
|
||||
resultMessage = R.string.error_import_out_of_memory;
|
||||
}
|
||||
|
||||
boolean success = (importedTrackIds != null && importedTrackIds.length > 0);
|
||||
showImportResult(success);
|
||||
} finally {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
dismissDialog(PROGRESS_DIALOG);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
t.start();
|
||||
}
|
||||
|
||||
private void showImportResult(boolean success) {
|
||||
final int dialogToShow = success ? SUCCESS_DIALOG : FAILURE_DIALOG;
|
||||
|
||||
// Show a dialog telling the user about the import, and asking if he wishes
|
||||
// to open the track right away.
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
showDialog(dialogToShow);
|
||||
}
|
||||
});
|
||||
|
||||
String path = data.getPath();
|
||||
Log.i(TAG, "Importing GPX file at " + path);
|
||||
new ImportAllTracks(this, path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.google.android.apps.mytracks.io.mymaps;
|
||||
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.io.AuthManager;
|
||||
import com.google.android.apps.mytracks.util.StringUtils;
|
||||
import com.google.android.maps.GeoPoint;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.wireless.gdata.client.HttpException;
|
||||
@@ -119,7 +120,7 @@ public class MapsFacade {
|
||||
MyMapsMapMetadata metaData = new MyMapsMapMetadata();
|
||||
metaData.setTitle(title);
|
||||
metaData.setDescription(description + " - "
|
||||
+ category + " - " + context.getString(R.string.send_to_google_by_mytracks));
|
||||
+ category + " - " + StringUtils.getCreatedByMyTracks(context, false));
|
||||
metaData.setSearchable(isPublic);
|
||||
Entry entry = MyMapsGDataConverter.getMapEntryForMetadata(metaData);
|
||||
Log.d(MyMapsConstants.TAG, "Title: " + entry.getTitle());
|
||||
|
||||
@@ -429,9 +429,9 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
|
||||
SendToMyMaps.OnSendCompletedListener onCompletion = new SendToMyMaps.OnSendCompletedListener() {
|
||||
@Override
|
||||
public void onSendCompleted(String mapId, boolean success, int statusMessage) {
|
||||
public void onSendCompleted(String mapId, boolean success, String statusMessage) {
|
||||
// TODO: Use this message
|
||||
sendToMyMapsMessage = getString(statusMessage);
|
||||
sendToMyMapsMessage = statusMessage;
|
||||
sendToMyMapsSuccess = success;
|
||||
if (sendToMyMapsSuccess) {
|
||||
sendToMyMapsMapId = mapId;
|
||||
@@ -491,10 +491,9 @@ public class SendActivity extends Activity implements ProgressIndicator {
|
||||
|
||||
OnSendCompletedListener onCompletion = new OnSendCompletedListener() {
|
||||
@Override
|
||||
public void onSendCompleted(String tableId, boolean success,
|
||||
int statusMessage) {
|
||||
public void onSendCompleted(String tableId, boolean success, String statusMessage) {
|
||||
// TODO: Use this message
|
||||
sendToFusionTablesMessage = getString(statusMessage);
|
||||
sendToFusionTablesMessage = statusMessage;
|
||||
sendToFusionTablesSuccess = success;
|
||||
if (sendToFusionTablesSuccess) {
|
||||
sendToFusionTablesTableId = tableId;
|
||||
|
||||
@@ -24,11 +24,11 @@ import com.google.android.maps.mytracks.R;
|
||||
*/
|
||||
public enum SendType {
|
||||
MYMAPS(R.string.sendtogoogle_google_mymaps,
|
||||
R.string.sendtogoogle_google_mymaps_url),
|
||||
R.string.send_google_my_maps_url),
|
||||
FUSION_TABLES(R.string.sendtogoogle_google_fusiontables,
|
||||
R.string.sendtogoogle_google_fusiontables_url),
|
||||
R.string.send_google_fusion_tables_url),
|
||||
DOCS(R.string.sendtogoogle_google_docs,
|
||||
R.string.sendtogoogle_google_docs_url);
|
||||
R.string.send_google_docs_url);
|
||||
|
||||
private int serviceName;
|
||||
private int serviceUrl;
|
||||
|
||||
@@ -559,6 +559,11 @@ public class TrackRecordingService extends Service {
|
||||
Log.d(TAG,
|
||||
"Location listener now unregistered w/ TrackRecordingService.");
|
||||
}
|
||||
|
||||
private String getDefaultActivityType(Context context) {
|
||||
SharedPreferences prefs = context.getSharedPreferences(Constants.SETTINGS_NAME, 0);
|
||||
return prefs.getString(context.getString(R.string.default_category_key), "");
|
||||
}
|
||||
|
||||
/*
|
||||
* Recording lifecycle.
|
||||
@@ -582,6 +587,7 @@ public class TrackRecordingService extends Service {
|
||||
track.setId(recordingTrackId);
|
||||
track.setName(new DefaultTrackNameFactory(this).newTrackName(
|
||||
recordingTrackId, startTime));
|
||||
track.setCategory(getDefaultActivityType(this));
|
||||
isRecording = true;
|
||||
isMoving = true;
|
||||
|
||||
|
||||
+5
-1
@@ -24,6 +24,7 @@ import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||
import com.google.android.apps.mytracks.util.StringUtils;
|
||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -327,7 +328,8 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
*
|
||||
* @param time the time
|
||||
*/
|
||||
private String getAnnounceTime(long time) {
|
||||
@VisibleForTesting
|
||||
String getAnnounceTime(long time) {
|
||||
int[] parts = StringUtils.getTimeParts(time);
|
||||
String secLabel =
|
||||
context.getString(parts[0] == 1 ? R.string.voice_second : R.string.voice_seconds);
|
||||
@@ -343,6 +345,7 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
sb.append(hourLabel);
|
||||
sb.append(" ");
|
||||
sb.append(parts[1]);
|
||||
sb.append(" ");
|
||||
sb.append(minLabel);
|
||||
} else {
|
||||
sb.append(parts[1]);
|
||||
@@ -350,6 +353,7 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
sb.append(minLabel);
|
||||
sb.append(" ");
|
||||
sb.append(parts[0]);
|
||||
sb.append(" ");
|
||||
sb.append(secLabel);
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
@@ -303,7 +303,7 @@ public class StringUtils implements DescriptionGenerator {
|
||||
+ "<img border=\"0\" src=\"%s\"/>",
|
||||
|
||||
// Line 1
|
||||
context.getString(R.string.send_to_google_by_mytracks),
|
||||
getCreatedByMyTracks(context, true),
|
||||
|
||||
// Line 2
|
||||
context.getString(R.string.total_distance_label),
|
||||
@@ -353,6 +353,22 @@ public class StringUtils implements DescriptionGenerator {
|
||||
ChartURLGenerator.getChartUrl(distances, elevations, track, context));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the 'Created by My Tracks on Android' string.
|
||||
*
|
||||
* @param context the context
|
||||
* @param addLink true to add a link to the My Tracks web site
|
||||
*/
|
||||
public static String getCreatedByMyTracks(Context context, boolean addLink) {
|
||||
String format = context.getString(R.string.send_google_by_my_tracks);
|
||||
if (addLink) {
|
||||
String url = context.getString(R.string.my_tracks_web_url);
|
||||
return String.format(format, "<a href='http://" + url + "'>", "</a>");
|
||||
} else {
|
||||
return String.format(format, "", "");
|
||||
}
|
||||
}
|
||||
|
||||
private String getSpeedString(double speed, int speedLabel, int paceLabel,
|
||||
boolean displaySpeed) {
|
||||
double speedInKph = speed * 3.6;
|
||||
|
||||
+2
@@ -382,6 +382,8 @@ public class TrackRecordingServiceTest
|
||||
Track track = providerUtils.getTrack(id);
|
||||
assertNotNull(track);
|
||||
assertEquals(id, track.getId());
|
||||
assertEquals(sharedPreferences.getString(context.getString(R.string.default_category_key), ""),
|
||||
track.getCategory());
|
||||
assertEquals(id, sharedPreferences.getLong(
|
||||
context.getString(R.string.recording_track_key), -1));
|
||||
assertEquals(id, service.getRecordingTrackId());
|
||||
|
||||
+52
@@ -478,7 +478,59 @@ public class StatusAnnouncerTaskTest extends AndroidTestCase {
|
||||
task.runWithStatistics(null);
|
||||
AndroidMock.verify(mockTask, tts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link StatusAnnouncerTask#getAnnounceTime(long)} with time zero.
|
||||
*/
|
||||
public void testGetAnnounceTime_time_zero() {
|
||||
long time = 0; // 0 seconds
|
||||
assertEquals("0 minutes 0 seconds", task.getAnnounceTime(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link StatusAnnouncerTask#getAnnounceTime(long)} with time one.
|
||||
*/
|
||||
public void testGetAnnounceTime_time_one() {
|
||||
long time = 1 * 1000; // 1 second
|
||||
assertEquals("0 minutes 1 second", task.getAnnounceTime(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link StatusAnnouncerTask#getAnnounceTime(long)} with singular
|
||||
* numbers with the hour unit.
|
||||
*/
|
||||
public void testGetAnnounceTime_singular_has_hour() {
|
||||
long time = (1 * 60 * 60 * 1000) + (1 * 60 * 1000) + (1 * 1000); // 1 hour 1 minute 1 second
|
||||
assertEquals("1 hour 1 minute", task.getAnnounceTime(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link StatusAnnouncerTask#getAnnounceTime(long)} with plural numbers
|
||||
* with the hour unit.
|
||||
*/
|
||||
public void testGetAnnounceTime_plural_has_hour() {
|
||||
long time = (2 * 60 * 60 * 1000) + (2 * 60 * 1000) + (2 * 1000); // 2 hours 2 minutes 2 seconds
|
||||
assertEquals("2 hours 2 minutes", task.getAnnounceTime(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link StatusAnnouncerTask#getAnnounceTime(long)} with singular
|
||||
* numbers without the hour unit.
|
||||
*/
|
||||
public void testGetAnnounceTime_singular_no_hour() {
|
||||
long time = (1 * 60 * 1000) + (1 * 1000); // 1 minute 1 second
|
||||
assertEquals("1 minute 1 second", task.getAnnounceTime(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests {@link StatusAnnouncerTask#getAnnounceTime(long)} with plural numbers
|
||||
* without the hour unit.
|
||||
*/
|
||||
public void testGetAnnounceTime_plural_no_hour() {
|
||||
long time = (2 * 60 * 1000) + (2 * 1000); // 2 minutes 2 seconds
|
||||
assertEquals("2 minutes 2 seconds", task.getAnnounceTime(time));
|
||||
}
|
||||
|
||||
private void startTask(int state) {
|
||||
AndroidMock.resetToNice(tts);
|
||||
AndroidMock.replay(tts);
|
||||
|
||||
Reference in New Issue
Block a user