forked from upstream-mirrors/OpenTracks
merge heads
This commit is contained in:
+255
-208
@@ -15,28 +15,29 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.google.android.maps.mytracks"
|
android:installLocation="auto"
|
||||||
android:installLocation="auto"
|
android:versionCode="39"
|
||||||
android:versionCode="39"
|
android:versionName="1.1.16"
|
||||||
android:versionName="1.1.16">
|
package="com.google.android.maps.mytracks" >
|
||||||
|
|
||||||
<!-- Permissions to initialize service -->
|
<!-- Permission to initialize services -->
|
||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
|
||||||
<!-- Permissions for recording tracks and showing maps -->
|
<!-- Permissions to record locations -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
|
||||||
|
<!-- Permissions to access sensors -->
|
||||||
|
<uses-permission android:name="com.dsi.ant.permission.ANT" />
|
||||||
|
<uses-permission android:name="com.dsi.ant.permission.ANT_ADMIN" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
|
|
||||||
<uses-permission android:name="com.dsi.ant.permission.ANT" />
|
<!-- Permissions to upload tracks -->
|
||||||
<uses-permission android:name="com.dsi.ant.permission.ANT_ADMIN" />
|
|
||||||
|
|
||||||
<!-- Permissions for uploading tracks -->
|
|
||||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||||
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
|
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
|
||||||
@@ -46,269 +47,315 @@ limitations under the License.
|
|||||||
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.writely" />
|
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.writely" />
|
||||||
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
|
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
|
||||||
|
|
||||||
<!-- Permissions for misc services -->
|
<!-- Permission to read phone state so voice announcement will not interrupt ongoing calls -->
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
||||||
|
|
||||||
<!-- Exported permissions (for other apps to use our features) -->
|
<!-- Permission to write to SD card -->
|
||||||
<!-- Permission to get track start/end broadcasts -->
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
<permission android:name="com.google.android.apps.mytracks.TRACK_NOTIFICATIONS"
|
|
||||||
android:permissionGroup="android.permission-group.LOCATION"
|
|
||||||
android:label="@string/permission_notification_label"
|
|
||||||
android:description="@string/permission_notification_description"
|
|
||||||
android:protectionLevel="dangerous" />
|
|
||||||
<!-- Permission to read raw track data (points, etc.) -->
|
|
||||||
<permission android:name="com.google.android.apps.mytracks.READ_TRACK_DATA"
|
|
||||||
android:permissionGroup="android.permission-group.LOCATION"
|
|
||||||
android:label="@string/permission_read_label"
|
|
||||||
android:description="@string/permission_read_description"
|
|
||||||
android:protectionLevel="dangerous" />
|
|
||||||
<!-- Permission to write track data, either raw or by making service calls -->
|
|
||||||
<permission android:name="com.google.android.apps.mytracks.WRITE_TRACK_DATA"
|
|
||||||
android:permissionGroup="android.permission-group.LOCATION"
|
|
||||||
android:label="@string/permission_write_label"
|
|
||||||
android:description="@string/permission_write_description"
|
|
||||||
android:protectionLevel="dangerous" />
|
|
||||||
|
|
||||||
<!-- Permission to get MyTracks broadcasts. For internal MyTracks communication. -->
|
<!-- Permissions to access My Tracks data -->
|
||||||
<permission android:name="com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS"
|
<uses-permission android:name="com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS" />
|
||||||
android:permissionGroup="android.permission-group.LOCATION"
|
|
||||||
android:label="@string/permission_notification_label"
|
|
||||||
android:description="@string/permission_notification_label"
|
|
||||||
android:protectionLevel="signature" />
|
|
||||||
|
|
||||||
<!-- We read and write raw track data, obviously. -->
|
|
||||||
<uses-permission android:name="com.google.android.apps.mytracks.READ_TRACK_DATA" />
|
<uses-permission android:name="com.google.android.apps.mytracks.READ_TRACK_DATA" />
|
||||||
<uses-permission android:name="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
|
<uses-permission android:name="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
|
||||||
<uses-permission android:name="com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS" />
|
|
||||||
|
|
||||||
<!-- Features required -->
|
<!-- Permission to receive My Tracks internal broadcasts -->
|
||||||
<uses-feature android:name="android.hardware.location" android:required="true"/>
|
<permission
|
||||||
<uses-feature android:name="android.hardware.location.gps" android:required="true"/>
|
android:description="@string/permission_notification_label"
|
||||||
|
android:label="@string/permission_notification_label"
|
||||||
|
android:name="com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS"
|
||||||
|
android:permissionGroup="android.permission-group.LOCATION"
|
||||||
|
android:protectionLevel="signature" />
|
||||||
|
<!-- Permission to read track data -->
|
||||||
|
<permission
|
||||||
|
android:description="@string/permission_read_description"
|
||||||
|
android:label="@string/permission_read_label"
|
||||||
|
android:name="com.google.android.apps.mytracks.READ_TRACK_DATA"
|
||||||
|
android:permissionGroup="android.permission-group.LOCATION"
|
||||||
|
android:protectionLevel="dangerous" />
|
||||||
|
<!-- Permission to receive track start/end broadcasts -->
|
||||||
|
<permission
|
||||||
|
android:description="@string/permission_notification_description"
|
||||||
|
android:label="@string/permission_notification_label"
|
||||||
|
android:name="com.google.android.apps.mytracks.TRACK_NOTIFICATIONS"
|
||||||
|
android:permissionGroup="android.permission-group.LOCATION"
|
||||||
|
android:protectionLevel="dangerous" />
|
||||||
|
<!-- Permission to write track data, either directly or through service calls -->
|
||||||
|
<permission
|
||||||
|
android:description="@string/permission_write_description"
|
||||||
|
android:label="@string/permission_write_label"
|
||||||
|
android:name="com.google.android.apps.mytracks.WRITE_TRACK_DATA"
|
||||||
|
android:permissionGroup="android.permission-group.LOCATION"
|
||||||
|
android:protectionLevel="dangerous" />
|
||||||
|
|
||||||
<!-- Features optional -->
|
<uses-sdk
|
||||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
|
android:minSdkVersion="7"
|
||||||
<uses-feature android:name="android.hardware.faketouch" android:required="false"/>
|
android:targetSdkVersion="15" />
|
||||||
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
|
|
||||||
<uses-feature android:name="android.hardware.sensor.compass" android:required="false"/>
|
<!-- Required features -->
|
||||||
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
|
<uses-feature
|
||||||
<uses-feature android:name="android.hardware.telephony.gsm" android:required="false"/>
|
android:name="android.hardware.location"
|
||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
android:required="true" />
|
||||||
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false"/>
|
<uses-feature
|
||||||
|
android:name="android.hardware.location.gps"
|
||||||
|
android:required="true" />
|
||||||
|
|
||||||
|
<!-- Optional features -->
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.bluetooth"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.faketouch"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.location.network"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.compass"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.telephony"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.telephony.gsm"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.touchscreen"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.touchscreen.multitouch"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="7"/>
|
|
||||||
<supports-screens
|
<supports-screens
|
||||||
android:xlargeScreens="true"
|
android:anyDensity="true"
|
||||||
android:largeScreens="true"
|
android:largeScreens="true"
|
||||||
android:normalScreens="true"
|
android:normalScreens="true"
|
||||||
android:smallScreens="true"
|
android:smallScreens="true"
|
||||||
android:anyDensity="true" />
|
android:xlargeScreens="true" />
|
||||||
|
|
||||||
<application android:icon="@drawable/arrow_icon"
|
<application
|
||||||
android:label="@string/my_tracks_app_name"
|
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent"
|
||||||
android:name="com.google.android.apps.mytracks.MyTracksApplication"
|
android:icon="@drawable/arrow_icon"
|
||||||
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgent">
|
android:label="@string/my_tracks_app_name"
|
||||||
<uses-library android:name="com.google.android.maps" />
|
android:name="com.google.android.apps.mytracks.MyTracksApplication"
|
||||||
|
android:theme="@style/ThemeSelector"
|
||||||
|
android:uiOptions="splitActionBarWhenNarrow" >
|
||||||
|
|
||||||
<meta-data android:name="com.google.android.backup.api_key"
|
<!-- For data backup -->
|
||||||
android:value="AEdPqrEAAAAIi-_QiwoRSc9_bAC9cmuNXTQyU8ajJmGtKdhskQ" />
|
<meta-data
|
||||||
|
android:name="com.google.android.backup.api_key"
|
||||||
|
android:value="AEdPqrEAAAAIi-_QiwoRSc9_bAC9cmuNXTQyU8ajJmGtKdhskQ" />
|
||||||
|
|
||||||
<!-- Main track data provider -->
|
<activity
|
||||||
<provider android:name="com.google.android.apps.mytracks.content.MyTracksProvider"
|
android:label="@string/menu_aggregated_statistics"
|
||||||
android:authorities="com.google.android.maps.mytracks"
|
android:name="com.google.android.apps.mytracks.AggregatedStatsActivity" />
|
||||||
android:exported="true"
|
<activity
|
||||||
android:readPermission="com.google.android.apps.mytracks.READ_TRACK_DATA"
|
android:exported="false"
|
||||||
android:writePermission="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
|
android:name="com.google.android.apps.mytracks.ChartActivity" >
|
||||||
|
<intent-filter>
|
||||||
|
<category android:name="android.intent.category.TAB" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
<!-- Provider for search suggestions -->
|
<meta-data
|
||||||
<provider android:name="com.google.android.apps.mytracks.content.SearchEngineProvider"
|
android:name="android.app.default_searchable"
|
||||||
android:authorities="com.google.android.maps.mytracks.search"
|
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
||||||
android:exported="false" />
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name="com.google.android.apps.mytracks.DeleteTrack"
|
||||||
|
android:noHistory="true"
|
||||||
|
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.DELETE" />
|
||||||
|
|
||||||
<!-- Main activity -->
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.MyTracks"
|
|
||||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale">
|
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:exported="false"
|
||||||
|
android:name="com.google.android.apps.mytracks.MapActivity" >
|
||||||
|
<intent-filter>
|
||||||
|
<category android:name="android.intent.category.TAB" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.default_searchable"
|
||||||
|
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|fontScale"
|
||||||
|
android:name="com.google.android.apps.mytracks.MyTracks" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
||||||
<data android:mimeType="vnd.android.cursor.item/vnd.google.waypoint" />
|
<data android:mimeType="vnd.android.cursor.item/vnd.google.waypoint" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<!-- Enable searches via SearchActivity. -->
|
<meta-data
|
||||||
<meta-data android:name="android.app.default_searchable"
|
android:name="android.app.default_searchable"
|
||||||
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
<activity android:name="com.google.android.apps.mytracks.MapActivity"
|
android:launchMode="singleTop"
|
||||||
android:exported="false">
|
android:name="com.google.android.apps.mytracks.SearchActivity" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.TAB" />
|
<action android:name="android.intent.action.SEARCH" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<!-- Enable searches via SearchActivity. -->
|
<meta-data
|
||||||
<meta-data android:name="android.app.default_searchable"
|
android:name="android.app.searchable"
|
||||||
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
android:resource="@xml/search" />
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:label="@string/menu_sensor_state"
|
||||||
<!-- TODO: Merge TrackList, WaypointsLIst and SearchActivity, then implement VIEW and PICK for track and waypoint cursor dir -->
|
android:name="com.google.android.apps.mytracks.SensorStateActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.TrackList">
|
<activity
|
||||||
<!-- Enable searches via SearchActivity. -->
|
android:label="@string/settings_title"
|
||||||
<meta-data android:name="android.app.default_searchable"
|
android:name="com.google.android.apps.mytracks.SettingsActivity" >
|
||||||
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<!-- TODO: VIEW and PICK for waypoint cursor dir -->
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.WaypointsList">
|
|
||||||
<!-- Enable searches via SearchActivity. -->
|
|
||||||
<meta-data android:name="android.app.default_searchable"
|
|
||||||
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.TrackDetail"
|
|
||||||
android:label="@string/track_detail_title">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.EDIT" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.DeleteTrack"
|
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
||||||
android:noHistory="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.DELETE" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.WaypointDetails"
|
|
||||||
android:label="@string/marker_detail_title">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.EDIT" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/vnd.google.waypoint" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.SettingsActivity"
|
|
||||||
android:label="@string/settings_title" >
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.PREFERENCE" />
|
<category android:name="android.intent.category.PREFERENCE" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
<activity android:name="com.google.android.apps.mytracks.AggregatedStatsActivity"
|
android:exported="false"
|
||||||
android:label="@string/menu_aggregated_statistics" />
|
android:name="com.google.android.apps.mytracks.StatsActivity" >
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.StatsActivity"
|
|
||||||
android:exported="false">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.TAB" />
|
<category android:name="android.intent.category.TAB" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<!-- Enable searches via SearchActivity. -->
|
<meta-data
|
||||||
<meta-data android:name="android.app.default_searchable"
|
android:name="android.app.default_searchable"
|
||||||
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
<activity android:name="com.google.android.apps.mytracks.SensorStateActivity"
|
android:label="@string/track_detail_title"
|
||||||
android:label="@string/menu_sensor_state" />
|
android:name="com.google.android.apps.mytracks.TrackDetail" >
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.ChartActivity"
|
|
||||||
android:exported="false">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.TAB" />
|
<action android:name="android.intent.action.EDIT" />
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<!-- Enable searches via SearchActivity. -->
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<meta-data android:name="android.app.default_searchable"
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.file.SaveActivity"
|
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
|
||||||
android:noHistory="true">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.SAVE" />
|
|
||||||
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.TrackList" >
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.file.ImportActivity"
|
<meta-data
|
||||||
android:label="@string/my_tracks_importer"
|
android:name="android.app.default_searchable"
|
||||||
android:theme="@android:style/Theme.Translucent.NoTitleBar"
|
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
||||||
android:noHistory="true">
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:label="@string/marker_detail_title"
|
||||||
|
android:name="com.google.android.apps.mytracks.WaypointDetails" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.EDIT" />
|
||||||
<action android:name="android.intent.action.ATTACH_DATA" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="file" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="application/gpx+xml" />
|
|
||||||
|
<data android:mimeType="vnd.android.cursor.item/vnd.google.waypoint" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.WaypointsList" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.default_searchable"
|
||||||
|
android:value="com.google.android.apps.mytracks.SearchActivity" />
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:exported="false"
|
||||||
|
android:label="@string/welcome_title"
|
||||||
|
android:name="com.google.android.apps.mytracks.WelcomeActivity" />
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.docs.SendDocsActivity" />
|
||||||
|
<activity
|
||||||
|
android:label="@string/my_tracks_importer"
|
||||||
|
android:name="com.google.android.apps.mytracks.io.file.ImportActivity"
|
||||||
|
android:noHistory="true"
|
||||||
|
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.ATTACH_DATA" />
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<data android:mimeType="application/gpx" />
|
<data android:mimeType="application/gpx" />
|
||||||
|
<data android:mimeType="application/gpx+xml" />
|
||||||
<data android:mimeType="application/vnd.google-earth.gpx" />
|
<data android:mimeType="application/vnd.google-earth.gpx" />
|
||||||
<data android:mimeType="application/vnd.google-earth.gpx+xml" />
|
<data android:mimeType="application/vnd.google-earth.gpx+xml" />
|
||||||
|
<data android:scheme="file" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
<activity android:name="com.google.android.apps.mytracks.WelcomeActivity"
|
android:name="com.google.android.apps.mytracks.io.file.SaveActivity"
|
||||||
android:label="@string/welcome_title"
|
android:noHistory="true"
|
||||||
android:exported="false" />
|
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.SearchActivity"
|
|
||||||
android:launchMode="singleTop">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.SEARCH" />
|
<action android:name="android.intent.action.SAVE" />
|
||||||
|
|
||||||
|
<data android:mimeType="vnd.android.cursor.item/vnd.google.track" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="android.app.searchable"
|
|
||||||
android:resource="@xml/search"/>
|
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity" />
|
||||||
|
<activity
|
||||||
|
android:label="@string/maps_list_title"
|
||||||
|
android:name="com.google.android.apps.mytracks.io.maps.ChooseMapActivity" />
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.maps.SendMapsActivity" />
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.AccountChooserActivity" />
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity" />
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.UploadServiceChooserActivity" />
|
||||||
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.docs.SendDocsActivity"/>
|
<service
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity"/>
|
android:exported="false"
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.maps.ChooseMapActivity"
|
android:name="com.google.android.apps.mytracks.services.ControlRecordingService" />
|
||||||
android:label="@string/maps_list_title"/>
|
<service android:name="com.google.android.apps.mytracks.services.RemoveTempFilesService" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.maps.SendMapsActivity"/>
|
<service
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.AccountChooserActivity"/>
|
android:enabled="true"
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity"/>
|
android:exported="true"
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.UploadServiceChooserActivity"/>
|
android:icon="@drawable/arrow_320"
|
||||||
|
android:label="@string/my_tracks_recording_service"
|
||||||
|
android:name="com.google.android.apps.mytracks.services.TrackRecordingService"
|
||||||
|
android:permission="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
|
||||||
|
|
||||||
<service android:name="com.google.android.apps.mytracks.services.TrackRecordingService"
|
<receiver android:name="com.google.android.apps.mytracks.BootReceiver" >
|
||||||
android:label="@string/my_tracks_recording_service"
|
|
||||||
android:icon="@drawable/arrow_320"
|
|
||||||
android:enabled="true"
|
|
||||||
android:exported="true"
|
|
||||||
android:permission="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
|
|
||||||
|
|
||||||
<service android:name="com.google.android.apps.mytracks.services.ControlRecordingService"
|
|
||||||
android:exported="false" />
|
|
||||||
<service android:name="com.google.android.apps.mytracks.services.RemoveTempFilesService"/>
|
|
||||||
|
|
||||||
<receiver android:name="com.google.android.apps.mytracks.BootReceiver">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
<receiver android:name="com.google.android.apps.mytracks.widgets.TrackWidgetProvider" >
|
||||||
<receiver android:name="com.google.android.apps.mytracks.widgets.TrackWidgetProvider">
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
|
||||||
<action android:name="com.google.android.apps.mytracks.TRACK_STARTED" />
|
<action android:name="com.google.android.apps.mytracks.TRACK_STARTED" />
|
||||||
<action android:name="com.google.android.apps.mytracks.TRACK_STOPPED" />
|
<action android:name="com.google.android.apps.mytracks.TRACK_STOPPED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="android.appwidget.provider"
|
|
||||||
android:resource="@xml/track_widget_info" />
|
<meta-data
|
||||||
|
android:name="android.appwidget.provider"
|
||||||
|
android:resource="@xml/track_widget_info" />
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
|
<!-- My Tracks data provider -->
|
||||||
|
<provider
|
||||||
|
android:authorities="com.google.android.maps.mytracks"
|
||||||
|
android:exported="true"
|
||||||
|
android:name="com.google.android.apps.mytracks.content.MyTracksProvider"
|
||||||
|
android:readPermission="com.google.android.apps.mytracks.READ_TRACK_DATA"
|
||||||
|
android:writePermission="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
|
||||||
|
<!-- Search suggestion provider -->
|
||||||
|
<provider
|
||||||
|
android:authorities="com.google.android.maps.mytracks.search"
|
||||||
|
android:exported="false"
|
||||||
|
android:name="com.google.android.apps.mytracks.content.SearchEngineProvider" />
|
||||||
|
|
||||||
|
<uses-library android:name="com.google.android.maps" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -57,7 +57,6 @@ limitations under the License.
|
|||||||
android:text="@string/send_google_maps"
|
android:text="@string/send_google_maps"
|
||||||
style="?android:attr/textAppearanceMedium"/>
|
style="?android:attr/textAppearanceMedium"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/upload_result_list_item_url"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:text="@string/send_google_maps_url"
|
android:text="@string/send_google_maps_url"
|
||||||
@@ -87,7 +86,6 @@ limitations under the License.
|
|||||||
android:text="@string/send_google_fusion_tables"
|
android:text="@string/send_google_fusion_tables"
|
||||||
style="?android:attr/textAppearanceMedium"/>
|
style="?android:attr/textAppearanceMedium"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/upload_result_list_item_url"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:text="@string/send_google_fusion_tables_url"
|
android:text="@string/send_google_fusion_tables_url"
|
||||||
@@ -117,7 +115,6 @@ limitations under the License.
|
|||||||
android:text="@string/send_google_docs"
|
android:text="@string/send_google_docs"
|
||||||
style="?android:attr/textAppearanceMedium"/>
|
style="?android:attr/textAppearanceMedium"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/upload_result_list_item_url"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:text="@string/send_google_docs_url"
|
android:text="@string/send_google_docs_url"
|
||||||
|
|||||||
+46
-10
@@ -14,43 +14,79 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
<item android:id="@+id/menu_record_track"
|
|
||||||
|
<item
|
||||||
android:icon="@drawable/ic_menu_recordtrack"
|
android:icon="@drawable/ic_menu_recordtrack"
|
||||||
|
android:id="@+id/menu_record_track"
|
||||||
|
android:showAsAction="always"
|
||||||
android:title="@string/menu_record_track"/>
|
android:title="@string/menu_record_track"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_stop_recording"
|
<item
|
||||||
android:icon="@drawable/ic_menu_stoprecording"
|
android:icon="@drawable/ic_menu_stoprecording"
|
||||||
|
android:id="@+id/menu_stop_recording"
|
||||||
|
android:showAsAction="always"
|
||||||
android:title="@string/menu_stop_recording"/>
|
android:title="@string/menu_stop_recording"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_tracks"
|
<item
|
||||||
android:icon="@drawable/ic_menu_tracklist"
|
android:icon="@drawable/ic_menu_tracklist"
|
||||||
|
android:id="@+id/menu_tracks"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
android:title="@string/menu_tracks"/>
|
android:title="@string/menu_tracks"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_markers"
|
<item
|
||||||
android:icon="@drawable/ic_menu_waypoints"
|
android:icon="@drawable/ic_menu_waypoints"
|
||||||
|
android:id="@+id/menu_markers"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
android:title="@string/menu_markers"/>
|
android:title="@string/menu_markers"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_search"
|
<item
|
||||||
|
android:icon="@drawable/chart_settings"
|
||||||
|
android:id="@+id/menu_chart_settings"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/menu_chart_view_chart_settings"
|
||||||
|
android:visible="false"/>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:icon="@android:drawable/ic_menu_mylocation"
|
||||||
|
android:id="@+id/menu_my_location"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/menu_map_view_my_location"
|
||||||
|
android:visible="false"/>
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:icon="@android:drawable/ic_menu_mapmode"
|
||||||
|
android:id="@+id/menu_satellite_mode"
|
||||||
|
android:showAsAction="ifRoom"
|
||||||
|
android:title="@string/menu_map_view_satellite_mode"
|
||||||
|
android:visible="false"/>
|
||||||
|
|
||||||
|
<item
|
||||||
android:icon="@android:drawable/ic_menu_search"
|
android:icon="@android:drawable/ic_menu_search"
|
||||||
|
android:id="@+id/menu_search"
|
||||||
android:title="@string/menu_search"/>
|
android:title="@string/menu_search"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_sensor_state"
|
<item
|
||||||
android:icon="@drawable/ic_menu_sensorstatus"
|
android:icon="@drawable/ic_menu_sensorstatus"
|
||||||
|
android:id="@+id/menu_sensor_state"
|
||||||
android:orderInCategory="1000"
|
android:orderInCategory="1000"
|
||||||
android:title="@string/menu_sensor_state"/>
|
android:title="@string/menu_sensor_state"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_settings"
|
<item
|
||||||
android:icon="@android:drawable/ic_menu_preferences"
|
android:icon="@android:drawable/ic_menu_preferences"
|
||||||
|
android:id="@+id/menu_settings"
|
||||||
android:orderInCategory="1001"
|
android:orderInCategory="1001"
|
||||||
android:title="@string/menu_settings"/>
|
android:title="@string/menu_settings"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_aggregated_statistics"
|
<item
|
||||||
|
android:id="@+id/menu_aggregated_statistics"
|
||||||
android:orderInCategory="1002"
|
android:orderInCategory="1002"
|
||||||
android:title="@string/menu_aggregated_statistics"/>
|
android:title="@string/menu_aggregated_statistics"/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_help"
|
<item
|
||||||
android:icon="@android:drawable/ic_menu_info_details"
|
android:icon="@android:drawable/ic_menu_info_details"
|
||||||
|
android:id="@+id/menu_help"
|
||||||
android:orderInCategory="1003"
|
android:orderInCategory="1003"
|
||||||
android:title="@string/menu_help"/>
|
android:title="@string/menu_help"/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
@@ -15,9 +15,12 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
<item android:id="@+id/menu_search"
|
|
||||||
|
<item
|
||||||
android:icon="@android:drawable/ic_menu_search"
|
android:icon="@android:drawable/ic_menu_search"
|
||||||
android:title="@string/menu_search"
|
android:id="@+id/menu_search"
|
||||||
android:onClick="onSearch"
|
android:onClick="onSearch"
|
||||||
android:showAsAction="always" />
|
android:showAsAction="always"
|
||||||
|
android:title="@string/menu_search"/>
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2012 Google Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<resources>
|
||||||
|
<style name="ThemeSelector" parent="android:Theme.Holo" />
|
||||||
|
</resources>
|
||||||
@@ -35,7 +35,7 @@ limitations under the License.
|
|||||||
http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png
|
http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png
|
||||||
</string>
|
</string>
|
||||||
<string name="my_tracks_analytics_id">UA-7222692-2</string>
|
<string name="my_tracks_analytics_id">UA-7222692-2</string>
|
||||||
<string name="my_tracks_privacy_url">m.google.com/privacy</string>
|
<string name="my_tracks_privacy_url">www.google.com/policies/privacy/</string>
|
||||||
<string name="my_tracks_recording_service_name">My Tracks Recording Service</string>
|
<string name="my_tracks_recording_service_name">My Tracks Recording Service</string>
|
||||||
<string name="my_tracks_support_url">
|
<string name="my_tracks_support_url">
|
||||||
groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks
|
groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
|
<style name="ThemeSelector" parent="android:Theme" />
|
||||||
|
|
||||||
<!-- About page label -->
|
<!-- About page label -->
|
||||||
<style name="AboutLabel">
|
<style name="AboutLabel">
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.google.android.apps.mytracks;
|
|||||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||||
import com.google.android.apps.mytracks.content.Track;
|
import com.google.android.apps.mytracks.content.Track;
|
||||||
import com.google.android.apps.mytracks.stats.TripStatistics;
|
import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||||
|
import com.google.android.apps.mytracks.util.ApiAdapterFactory;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@@ -12,7 +13,6 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -60,8 +60,9 @@ public class AggregatedStatsActivity extends Activity implements
|
|||||||
|
|
||||||
this.tracksProvider = MyTracksProviderUtils.Factory.get(this);
|
this.tracksProvider = MyTracksProviderUtils.Factory.get(this);
|
||||||
|
|
||||||
// We don't need a window title bar:
|
// Show the action bar (or nothing at all).
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
ApiAdapterFactory.getApiAdapter().showActionBar(this);
|
||||||
|
|
||||||
setContentView(R.layout.stats);
|
setContentView(R.layout.stats);
|
||||||
|
|
||||||
ScrollView sv = ((ScrollView) findViewById(R.id.scrolly));
|
ScrollView sv = ((ScrollView) findViewById(R.id.scrolly));
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.google.android.apps.mytracks.content.TrackDataListener;
|
|||||||
import com.google.android.apps.mytracks.content.Waypoint;
|
import com.google.android.apps.mytracks.content.Waypoint;
|
||||||
import com.google.android.apps.mytracks.stats.DoubleBuffer;
|
import com.google.android.apps.mytracks.stats.DoubleBuffer;
|
||||||
import com.google.android.apps.mytracks.stats.TripStatisticsBuilder;
|
import com.google.android.apps.mytracks.stats.TripStatisticsBuilder;
|
||||||
|
import com.google.android.apps.mytracks.util.ApiAdapterFactory;
|
||||||
import com.google.android.apps.mytracks.util.LocationUtils;
|
import com.google.android.apps.mytracks.util.LocationUtils;
|
||||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
@@ -41,12 +42,9 @@ import android.location.Location;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.speech.tts.TextToSpeech;
|
import android.speech.tts.TextToSpeech;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.view.ViewGroup.LayoutParams;
|
import android.view.ViewGroup.LayoutParams;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ZoomControls;
|
import android.widget.ZoomControls;
|
||||||
|
|
||||||
@@ -61,7 +59,8 @@ import java.util.EnumSet;
|
|||||||
*/
|
*/
|
||||||
public class ChartActivity extends Activity implements TrackDataListener {
|
public class ChartActivity extends Activity implements TrackDataListener {
|
||||||
|
|
||||||
private static final int CHART_SETTINGS_DIALOG = 1;
|
public static final int CHART_SETTINGS_DIALOG = 1;
|
||||||
|
|
||||||
private final DoubleBuffer elevationBuffer =
|
private final DoubleBuffer elevationBuffer =
|
||||||
new DoubleBuffer(Constants.ELEVATION_SMOOTHING_FACTOR);
|
new DoubleBuffer(Constants.ELEVATION_SMOOTHING_FACTOR);
|
||||||
private final DoubleBuffer speedBuffer =
|
private final DoubleBuffer speedBuffer =
|
||||||
@@ -84,7 +83,6 @@ public class ChartActivity extends Activity implements TrackDataListener {
|
|||||||
* UI elements:
|
* UI elements:
|
||||||
*/
|
*/
|
||||||
private ChartView chartView;
|
private ChartView chartView;
|
||||||
private MenuItem chartSettingsMenuItem;
|
|
||||||
private LinearLayout busyPane;
|
private LinearLayout busyPane;
|
||||||
private ZoomControls zoomControls;
|
private ZoomControls zoomControls;
|
||||||
|
|
||||||
@@ -118,7 +116,9 @@ public class ChartActivity extends Activity implements TrackDataListener {
|
|||||||
// The volume we want to control is the Text-To-Speech volume
|
// The volume we want to control is the Text-To-Speech volume
|
||||||
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
||||||
|
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
// Show the action bar (or nothing at all).
|
||||||
|
ApiAdapterFactory.getApiAdapter().showActionBar(this);
|
||||||
|
|
||||||
setContentView(R.layout.mytracks_charts);
|
setContentView(R.layout.mytracks_charts);
|
||||||
ViewGroup layout = (ViewGroup) findViewById(R.id.elevation_chart);
|
ViewGroup layout = (ViewGroup) findViewById(R.id.elevation_chart);
|
||||||
chartView = new ChartView(this);
|
chartView = new ChartView(this);
|
||||||
@@ -183,25 +183,6 @@ public class ChartActivity extends Activity implements TrackDataListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
super.onCreateOptionsMenu(menu);
|
|
||||||
chartSettingsMenuItem = menu.add(Menu.NONE, Constants.MENU_CHART_SETTINGS, Menu.NONE,
|
|
||||||
R.string.menu_chart_view_chart_settings);
|
|
||||||
chartSettingsMenuItem.setIcon(R.drawable.chart_settings);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case Constants.MENU_CHART_SETTINGS:
|
|
||||||
showDialog(CHART_SETTINGS_DIALOG);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog(int id) {
|
protected Dialog onCreateDialog(int id) {
|
||||||
if (id == CHART_SETTINGS_DIALOG) {
|
if (id == CHART_SETTINGS_DIALOG) {
|
||||||
@@ -486,11 +467,6 @@ public class ChartActivity extends Activity implements TrackDataListener {
|
|||||||
return chartView;
|
return chartView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
|
||||||
MenuItem getChartSettingsMenuItem() {
|
|
||||||
return chartSettingsMenuItem;
|
|
||||||
}
|
|
||||||
|
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
void setTrackMaxSpeed(double maxSpeed) {
|
void setTrackMaxSpeed(double maxSpeed) {
|
||||||
trackMaxSpeed = maxSpeed;
|
trackMaxSpeed = maxSpeed;
|
||||||
|
|||||||
@@ -40,14 +40,6 @@ public abstract class Constants {
|
|||||||
public static final int SHOW_WAYPOINT = 1;
|
public static final int SHOW_WAYPOINT = 1;
|
||||||
public static final int WELCOME = 2;
|
public static final int WELCOME = 2;
|
||||||
|
|
||||||
/*
|
|
||||||
* Menu ids:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public static final int MENU_MY_LOCATION = 1;
|
|
||||||
public static final int MENU_TOGGLE_LAYERS = 2;
|
|
||||||
public static final int MENU_CHART_SETTINGS = 3;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Context menu ids. Sorted alphabetically.
|
* Context menu ids. Sorted alphabetically.
|
||||||
*/
|
*/
|
||||||
@@ -69,6 +61,13 @@ public abstract class Constants {
|
|||||||
public static final int MENU_SHARE_TCX_FILE = 115;
|
public static final int MENU_SHARE_TCX_FILE = 115;
|
||||||
public static final int MENU_SHOW = 116;
|
public static final int MENU_SHOW = 116;
|
||||||
public static final int MENU_WRITE_TO_SD_CARD = 117;
|
public static final int MENU_WRITE_TO_SD_CARD = 117;
|
||||||
|
/*
|
||||||
|
* Main screen tab tags:
|
||||||
|
*/
|
||||||
|
|
||||||
|
public static final String MAP_TAB_TAG = "map";
|
||||||
|
public static final String STATS_TAB_TAG = "stats";
|
||||||
|
public static final String CHART_TAB_TAG = "chart";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of distance readings to smooth to get a stable signal.
|
* The number of distance readings to smooth to get a stable signal.
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileForm
|
|||||||
import com.google.android.apps.mytracks.io.sendtogoogle.SendRequest;
|
import com.google.android.apps.mytracks.io.sendtogoogle.SendRequest;
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.UploadServiceChooserActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.UploadServiceChooserActivity;
|
||||||
import com.google.android.apps.mytracks.stats.TripStatistics;
|
import com.google.android.apps.mytracks.stats.TripStatistics;
|
||||||
|
import com.google.android.apps.mytracks.util.ApiAdapterFactory;
|
||||||
import com.google.android.apps.mytracks.util.GeoRect;
|
import com.google.android.apps.mytracks.util.GeoRect;
|
||||||
import com.google.android.apps.mytracks.util.LocationUtils;
|
import com.google.android.apps.mytracks.util.LocationUtils;
|
||||||
import com.google.android.apps.mytracks.util.PlayTrackUtils;
|
import com.google.android.apps.mytracks.util.PlayTrackUtils;
|
||||||
@@ -55,7 +56,6 @@ import android.view.MotionEvent;
|
|||||||
import android.view.SubMenu;
|
import android.view.SubMenu;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnCreateContextMenuListener;
|
import android.view.View.OnCreateContextMenuListener;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
@@ -90,6 +90,12 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
*/
|
*/
|
||||||
private boolean keepMyLocationVisible;
|
private boolean keepMyLocationVisible;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* True if we've already zoomed into the current location.
|
||||||
|
* Only relevant when {@link #keepMyLocationVisible} is true.
|
||||||
|
*/
|
||||||
|
private boolean myLocationWasZoomedIn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The ID of a track on which we want to show a waypoint.
|
* The ID of a track on which we want to show a waypoint.
|
||||||
* The waypoint will be shown as soon as the track is loaded.
|
* The waypoint will be shown as soon as the track is loaded.
|
||||||
@@ -126,9 +132,6 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
private LinearLayout busyPane;
|
private LinearLayout busyPane;
|
||||||
private ImageButton optionsBtn;
|
private ImageButton optionsBtn;
|
||||||
|
|
||||||
private MenuItem myLocation;
|
|
||||||
private MenuItem toggleLayers;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* We are not displaying driving directions. Just an arbitrary track that is
|
* We are not displaying driving directions. Just an arbitrary track that is
|
||||||
* not associated to any licensed mapping data. Therefore it should be okay to
|
* not associated to any licensed mapping data. Therefore it should be okay to
|
||||||
@@ -159,8 +162,8 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
// The volume we want to control is the Text-To-Speech volume
|
// The volume we want to control is the Text-To-Speech volume
|
||||||
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
||||||
|
|
||||||
// We don't need a window title bar:
|
// Show the action bar (or nothing at all).
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
ApiAdapterFactory.getApiAdapter().showActionBar(this);
|
||||||
|
|
||||||
// Inflate the layout:
|
// Inflate the layout:
|
||||||
setContentView(R.layout.mytracks_layout);
|
setContentView(R.layout.mytracks_layout);
|
||||||
@@ -288,6 +291,18 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
return r.contains(geoPoint);
|
return r.contains(geoPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Centers (and keeps centered) the map on the current location.
|
||||||
|
*/
|
||||||
|
public void showMyLocation() {
|
||||||
|
dataHub.forceUpdateLocation();
|
||||||
|
keepMyLocationVisible = true;
|
||||||
|
myLocationWasZoomedIn = false;
|
||||||
|
if (currentLocation != null) {
|
||||||
|
showCurrentLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the location pointer to the current location and center the map if
|
* Moves the location pointer to the current location and center the map if
|
||||||
* the current location is outside the visible area.
|
* the current location is outside the visible area.
|
||||||
@@ -304,6 +319,11 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
GeoPoint geoPoint = LocationUtils.getGeoPoint(currentLocation);
|
GeoPoint geoPoint = LocationUtils.getGeoPoint(currentLocation);
|
||||||
MapController controller = mapView.getController();
|
MapController controller = mapView.getController();
|
||||||
controller.animateTo(geoPoint);
|
controller.animateTo(geoPoint);
|
||||||
|
if (!myLocationWasZoomedIn && mapView.getZoomLevel() < 18) {
|
||||||
|
// Only zoom in the first time we show the location.
|
||||||
|
myLocationWasZoomedIn = true;
|
||||||
|
controller.setZoom(18);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -561,45 +581,18 @@ public class MapActivity extends com.google.android.maps.MapActivity
|
|||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
* Returns whether the map is currently in satellite view mode.
|
||||||
super.onCreateOptionsMenu(menu);
|
*/
|
||||||
myLocation = menu.add(
|
public boolean isSatelliteView() {
|
||||||
Menu.NONE, Constants.MENU_MY_LOCATION, Menu.NONE, R.string.menu_map_view_my_location);
|
return mapView.isSatellite();
|
||||||
myLocation.setIcon(android.R.drawable.ic_menu_mylocation);
|
|
||||||
toggleLayers = menu.add(
|
|
||||||
Menu.NONE, Constants.MENU_TOGGLE_LAYERS, Menu.NONE, R.string.menu_map_view_satellite_mode);
|
|
||||||
toggleLayers.setIcon(android.R.drawable.ic_menu_mapmode);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
* Changes whether the map should be in satellite view mode.
|
||||||
toggleLayers.setTitle(mapView.isSatellite() ?
|
*/
|
||||||
R.string.menu_map_view_map_mode : R.string.menu_map_view_satellite_mode);
|
public void setSatelliteView(boolean sat) {
|
||||||
return super.onPrepareOptionsMenu(menu);
|
mapView.setSatellite(sat);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
switch (item.getItemId()) {
|
|
||||||
case Constants.MENU_MY_LOCATION: {
|
|
||||||
dataHub.forceUpdateLocation();
|
|
||||||
keepMyLocationVisible = true;
|
|
||||||
if (mapView.getZoomLevel() < 18) {
|
|
||||||
mapView.getController().setZoom(18);
|
|
||||||
}
|
|
||||||
if (currentLocation != null) {
|
|
||||||
showCurrentLocation();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
case Constants.MENU_TOGGLE_LAYERS: {
|
|
||||||
mapView.setSatellite(!mapView.isSatellite());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return super.onOptionsItemSelected(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks;
|
package com.google.android.apps.mytracks;
|
||||||
|
|
||||||
|
import static com.google.android.apps.mytracks.Constants.CHART_TAB_TAG;
|
||||||
|
import static com.google.android.apps.mytracks.Constants.MAP_TAB_TAG;
|
||||||
|
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
@@ -30,11 +33,19 @@ import android.view.MenuItem;
|
|||||||
class MenuManager {
|
class MenuManager {
|
||||||
|
|
||||||
private final MyTracks activity;
|
private final MyTracks activity;
|
||||||
|
private MenuItem recordTrack;
|
||||||
|
private MenuItem stopRecording;
|
||||||
|
|
||||||
public MenuManager(MyTracks activity) {
|
public MenuManager(MyTracks activity) {
|
||||||
this.activity = activity;
|
this.activity = activity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fills the menu with its initial options.
|
||||||
|
*
|
||||||
|
* @param menu the menu to fill
|
||||||
|
* @return true on success, false otherwise
|
||||||
|
*/
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
activity.getMenuInflater().inflate(R.menu.main, menu);
|
activity.getMenuInflater().inflate(R.menu.main, menu);
|
||||||
|
|
||||||
@@ -42,26 +53,70 @@ class MenuManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares the menu for display.
|
||||||
|
*
|
||||||
|
* @param menu the menu to update for display
|
||||||
|
* @param hasRecorded whether any track has been recorded
|
||||||
|
* @param isRecording whether we're recording a track now
|
||||||
|
* @param hasSelectedTrack whether there's a track currently selected for display
|
||||||
|
* @param isSatelliteMode whether the map is currently in satellite mode
|
||||||
|
* @param currentTabTag the tag for the currently-displayed tab
|
||||||
|
*/
|
||||||
public void onPrepareOptionsMenu(Menu menu, boolean hasRecorded,
|
public void onPrepareOptionsMenu(Menu menu, boolean hasRecorded,
|
||||||
boolean isRecording, boolean hasSelectedTrack) {
|
boolean isRecording, boolean hasSelectedTrack,
|
||||||
|
boolean isSatelliteMode, String currentTabTag) {
|
||||||
menu.findItem(R.id.menu_markers)
|
menu.findItem(R.id.menu_markers)
|
||||||
.setEnabled(hasRecorded && hasSelectedTrack);
|
.setEnabled(hasRecorded && hasSelectedTrack);
|
||||||
menu.findItem(R.id.menu_record_track)
|
|
||||||
.setEnabled(!isRecording)
|
recordTrack = menu.findItem(R.id.menu_record_track);
|
||||||
.setVisible(!isRecording);
|
stopRecording = menu.findItem(R.id.menu_stop_recording);
|
||||||
menu.findItem(R.id.menu_stop_recording)
|
updateActionItems(isRecording);
|
||||||
.setEnabled(isRecording)
|
|
||||||
.setVisible(isRecording);
|
menu.findItem(R.id.menu_chart_settings)
|
||||||
|
.setVisible(CHART_TAB_TAG.equals(currentTabTag));
|
||||||
|
|
||||||
|
boolean isMapTab = MAP_TAB_TAG.equals(currentTabTag);
|
||||||
|
menu.findItem(R.id.menu_my_location)
|
||||||
|
.setVisible(isMapTab);
|
||||||
|
menu.findItem(R.id.menu_satellite_mode)
|
||||||
|
.setVisible(isMapTab)
|
||||||
|
.setTitle(isSatelliteMode
|
||||||
|
? R.string.menu_map_view_map_mode
|
||||||
|
: R.string.menu_map_view_satellite_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the action items.<br>
|
||||||
|
* TODO: also update the action items when
|
||||||
|
* <ul>
|
||||||
|
* <li>start/stop a recording from the home screen widget.<il>
|
||||||
|
* <li>receive a direct service call to start/stop a recording.<il>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param isRecording true if recording a track
|
||||||
|
*/
|
||||||
|
private void updateActionItems(boolean isRecording) {
|
||||||
|
recordTrack.setEnabled(!isRecording).setVisible(!isRecording);
|
||||||
|
stopRecording.setEnabled(isRecording).setVisible(isRecording);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when an option from the menu is selected.
|
||||||
|
*
|
||||||
|
* @param item the selected item
|
||||||
|
* @return true if the action was handled, false otherwise
|
||||||
|
*/
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case R.id.menu_record_track: {
|
case R.id.menu_record_track: {
|
||||||
activity.startRecording();
|
activity.startRecording();
|
||||||
|
updateActionItems(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case R.id.menu_stop_recording: {
|
case R.id.menu_stop_recording: {
|
||||||
activity.stopRecording();
|
activity.stopRecording();
|
||||||
|
updateActionItems(false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case R.id.menu_tracks: {
|
case R.id.menu_tracks: {
|
||||||
@@ -90,11 +145,28 @@ class MenuManager {
|
|||||||
case R.id.menu_search: {
|
case R.id.menu_search: {
|
||||||
// TODO: Pass the current track ID and current location to do some fancier ranking.
|
// TODO: Pass the current track ID and current location to do some fancier ranking.
|
||||||
activity.onSearchRequested();
|
activity.onSearchRequested();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case R.id.menu_chart_settings: {
|
||||||
|
activity.showChartSettings();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case R.id.menu_my_location: {
|
||||||
|
activity.showMyLocation();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
case R.id.menu_satellite_mode: {
|
||||||
|
activity.toggleSatelliteView();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts an activity with the given class.
|
||||||
|
*/
|
||||||
private boolean startActivity(Class<? extends Activity> activityClass) {
|
private boolean startActivity(Class<? extends Activity> activityClass) {
|
||||||
activity.startActivity(new Intent(activity, activityClass));
|
activity.startActivity(new Intent(activity, activityClass));
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -15,6 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks;
|
package com.google.android.apps.mytracks;
|
||||||
|
|
||||||
|
import static com.google.android.apps.mytracks.Constants.CHART_TAB_TAG;
|
||||||
|
import static com.google.android.apps.mytracks.Constants.MAP_TAB_TAG;
|
||||||
|
import static com.google.android.apps.mytracks.Constants.STATS_TAB_TAG;
|
||||||
import static com.google.android.apps.mytracks.Constants.TAG;
|
import static com.google.android.apps.mytracks.Constants.TAG;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||||
@@ -54,7 +57,6 @@ import android.view.MotionEvent;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnTouchListener;
|
import android.view.View.OnTouchListener;
|
||||||
import android.view.ViewGroup.LayoutParams;
|
import android.view.ViewGroup.LayoutParams;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TabHost;
|
import android.widget.TabHost;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@@ -149,22 +151,22 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
|||||||
|
|
||||||
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
||||||
|
|
||||||
// We don't need a window title bar:
|
// Show the action bar (or nothing at all).
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
ApiAdapterFactory.getApiAdapter().showActionBar(this);
|
||||||
|
|
||||||
// If the user just starts typing (on a device with a keyboard), we start a search.
|
// If the user just starts typing (on a device with a keyboard), we start a search.
|
||||||
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
|
setDefaultKeyMode(DEFAULT_KEYS_SEARCH_LOCAL);
|
||||||
|
|
||||||
final Resources res = getResources();
|
final Resources res = getResources();
|
||||||
final TabHost tabHost = getTabHost();
|
final TabHost tabHost = getTabHost();
|
||||||
tabHost.addTab(tabHost.newTabSpec("tab1")
|
tabHost.addTab(tabHost.newTabSpec(MAP_TAB_TAG)
|
||||||
.setIndicator("Map", res.getDrawable(
|
.setIndicator("Map", res.getDrawable(
|
||||||
android.R.drawable.ic_menu_mapmode))
|
android.R.drawable.ic_menu_mapmode))
|
||||||
.setContent(new Intent(this, MapActivity.class)));
|
.setContent(new Intent(this, MapActivity.class)));
|
||||||
tabHost.addTab(tabHost.newTabSpec("tab2")
|
tabHost.addTab(tabHost.newTabSpec(STATS_TAB_TAG)
|
||||||
.setIndicator("Stats", res.getDrawable(R.drawable.menu_stats))
|
.setIndicator("Stats", res.getDrawable(R.drawable.menu_stats))
|
||||||
.setContent(new Intent(this, StatsActivity.class)));
|
.setContent(new Intent(this, StatsActivity.class)));
|
||||||
tabHost.addTab(tabHost.newTabSpec("tab3")
|
tabHost.addTab(tabHost.newTabSpec(CHART_TAB_TAG)
|
||||||
.setIndicator("Chart", res.getDrawable(R.drawable.menu_elevation))
|
.setIndicator("Chart", res.getDrawable(R.drawable.menu_elevation))
|
||||||
.setContent(new Intent(this, ChartActivity.class)));
|
.setContent(new Intent(this, ChartActivity.class)));
|
||||||
|
|
||||||
@@ -298,9 +300,15 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||||
|
MapActivity map = getMapTab();
|
||||||
|
boolean isSatelliteView = map != null ? map.isSatelliteView() : false;
|
||||||
|
|
||||||
menuManager.onPrepareOptionsMenu(menu, providerUtils.getLastTrack() != null,
|
menuManager.onPrepareOptionsMenu(menu, providerUtils.getLastTrack() != null,
|
||||||
ServiceUtils.isRecording(this, serviceConnection.getServiceIfBound(), preferences),
|
ServiceUtils.isRecording(this, serviceConnection.getServiceIfBound(), preferences),
|
||||||
dataHub.isATrackSelected());
|
dataHub.isATrackSelected(),
|
||||||
|
isSatelliteView,
|
||||||
|
getTabHost().getCurrentTabTag());
|
||||||
|
|
||||||
return super.onPrepareOptionsMenu(menu);
|
return super.onPrepareOptionsMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,7 +370,11 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
|||||||
if (results != null) {
|
if (results != null) {
|
||||||
final long waypointId = results.getLongExtra(WaypointDetails.WAYPOINT_ID_EXTRA, -1);
|
final long waypointId = results.getLongExtra(WaypointDetails.WAYPOINT_ID_EXTRA, -1);
|
||||||
if (waypointId >= 0) {
|
if (waypointId >= 0) {
|
||||||
showWaypoint(trackId, waypointId);
|
MapActivity map = getMapTab();
|
||||||
|
if (map != null) {
|
||||||
|
getTabHost().setCurrentTab(0);
|
||||||
|
map.showWaypoint(waypointId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -486,4 +498,48 @@ public class MyTracks extends TabActivity implements OnTouchListener {
|
|||||||
long getSelectedTrackId() {
|
long getSelectedTrackId() {
|
||||||
return dataHub.getSelectedTrackId();
|
return dataHub.getSelectedTrackId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the chart tab to show its settings.
|
||||||
|
*/
|
||||||
|
public void showChartSettings() {
|
||||||
|
ChartActivity chart = getChartTab();
|
||||||
|
if (chart != null) {
|
||||||
|
chart.showDialog(ChartActivity.CHART_SETTINGS_DIALOG);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the map tab to show the map in satellite mode.
|
||||||
|
*/
|
||||||
|
public void toggleSatelliteView() {
|
||||||
|
MapActivity mapTab = getMapTab();
|
||||||
|
if (mapTab != null) {
|
||||||
|
mapTab.setSatelliteView(!mapTab.isSatelliteView());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the map tab to jump to the current location.
|
||||||
|
*/
|
||||||
|
public void showMyLocation() {
|
||||||
|
MapActivity mapTab = getMapTab();
|
||||||
|
if (mapTab != null) {
|
||||||
|
mapTab.showMyLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the map tab instance if available, or null otherwise.
|
||||||
|
*/
|
||||||
|
private MapActivity getMapTab() {
|
||||||
|
return (MapActivity) getLocalActivityManager().getActivity(MAP_TAB_TAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the chart tab instance if available, or null otherwise.
|
||||||
|
*/
|
||||||
|
private ChartActivity getChartTab() {
|
||||||
|
return (ChartActivity) getLocalActivityManager().getActivity(CHART_TAB_TAG);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.google.android.apps.mytracks.content.TrackDataHub.ListenerDataType;
|
|||||||
import com.google.android.apps.mytracks.content.TrackDataListener;
|
import com.google.android.apps.mytracks.content.TrackDataListener;
|
||||||
import com.google.android.apps.mytracks.content.Waypoint;
|
import com.google.android.apps.mytracks.content.Waypoint;
|
||||||
import com.google.android.apps.mytracks.services.ServiceUtils;
|
import com.google.android.apps.mytracks.services.ServiceUtils;
|
||||||
|
import com.google.android.apps.mytracks.util.ApiAdapterFactory;
|
||||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
@@ -34,7 +35,6 @@ import android.os.Bundle;
|
|||||||
import android.speech.tts.TextToSpeech;
|
import android.speech.tts.TextToSpeech;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Window;
|
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -107,8 +107,8 @@ public class StatsActivity extends Activity implements TrackDataListener {
|
|||||||
// The volume we want to control is the Text-To-Speech volume
|
// The volume we want to control is the Text-To-Speech volume
|
||||||
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
setVolumeControlStream(TextToSpeech.Engine.DEFAULT_STREAM);
|
||||||
|
|
||||||
// We don't need a window title bar:
|
// Show the action bar (or nothing at all).
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
ApiAdapterFactory.getApiAdapter().showActionBar(this);
|
||||||
|
|
||||||
setContentView(R.layout.stats);
|
setContentView(R.layout.stats);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2012 Google Inc.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
* License for the specific language governing permissions and limitations under
|
||||||
|
* the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.google.android.apps.mytracks.util;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.view.Window;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API level 11 specific implementation of the {@link ApiAdapter}.
|
||||||
|
*
|
||||||
|
* @author Jimmy Shih
|
||||||
|
*/
|
||||||
|
public class Api11Adapter extends Api9Adapter {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showActionBar(Activity activity) {
|
||||||
|
activity.requestWindowFeature(Window.FEATURE_ACTION_BAR);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,12 +23,14 @@ import com.google.android.apps.mytracks.services.tasks.StatusAnnouncerTask;
|
|||||||
import com.google.api.client.http.HttpTransport;
|
import com.google.api.client.http.HttpTransport;
|
||||||
import com.google.api.client.http.apache.ApacheHttpTransport;
|
import com.google.api.client.http.apache.ApacheHttpTransport;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.bluetooth.BluetoothSocket;
|
import android.bluetooth.BluetoothSocket;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.SharedPreferences.Editor;
|
import android.content.SharedPreferences.Editor;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.Window;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -99,4 +101,11 @@ public class Api7Adapter implements ApiAdapter {
|
|||||||
}
|
}
|
||||||
return bluetoothDevice.createRfcommSocketToServiceRecord(BluetoothConnectionManager.SPP_UUID);
|
return bluetoothDevice.createRfcommSocketToServiceRecord(BluetoothConnectionManager.SPP_UUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void showActionBar(Activity activity) {
|
||||||
|
// Action bar not available, just hide the title and let actions be shown
|
||||||
|
// via the regular menu.
|
||||||
|
activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import com.google.android.apps.mytracks.io.backup.BackupPreferencesListener;
|
|||||||
import com.google.android.apps.mytracks.services.tasks.PeriodicTask;
|
import com.google.android.apps.mytracks.services.tasks.PeriodicTask;
|
||||||
import com.google.api.client.http.HttpTransport;
|
import com.google.api.client.http.HttpTransport;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.bluetooth.BluetoothDevice;
|
import android.bluetooth.BluetoothDevice;
|
||||||
import android.bluetooth.BluetoothSocket;
|
import android.bluetooth.BluetoothSocket;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -98,4 +99,15 @@ public interface ApiAdapter {
|
|||||||
* @param bluetoothDevice
|
* @param bluetoothDevice
|
||||||
*/
|
*/
|
||||||
public BluetoothSocket getBluetoothSocket(BluetoothDevice bluetoothDevice) throws IOException;
|
public BluetoothSocket getBluetoothSocket(BluetoothDevice bluetoothDevice) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows the action bar, if the current system supports it.
|
||||||
|
* If it's not supported, the title bar will be kept hidden.
|
||||||
|
*
|
||||||
|
* Due to changes in API level 11.
|
||||||
|
*
|
||||||
|
* @param activity the current activity
|
||||||
|
*/
|
||||||
|
public void showActionBar(Activity activity);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,10 @@ public class ApiAdapterFactory {
|
|||||||
*/
|
*/
|
||||||
public static ApiAdapter getApiAdapter() {
|
public static ApiAdapter getApiAdapter() {
|
||||||
if (apiAdapter == null) {
|
if (apiAdapter == null) {
|
||||||
if (Build.VERSION.SDK_INT >= 10) {
|
if (Build.VERSION.SDK_INT >= 11) {
|
||||||
|
apiAdapter = new Api11Adapter();
|
||||||
|
return apiAdapter;
|
||||||
|
} else if (Build.VERSION.SDK_INT >= 10) {
|
||||||
apiAdapter = new Api10Adapter();
|
apiAdapter = new Api10Adapter();
|
||||||
return apiAdapter;
|
return apiAdapter;
|
||||||
} else if (Build.VERSION.SDK_INT >= 9) {
|
} else if (Build.VERSION.SDK_INT >= 9) {
|
||||||
|
|||||||
@@ -15,16 +15,22 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.google.android.apps.mytracks.lib"
|
android:versionCode="1"
|
||||||
android:versionCode="1"
|
android:versionName="1.0"
|
||||||
android:versionName="1.0">
|
package="com.google.android.apps.mytracks.lib" >
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
THIS IS A LIBRARY PROJECT.
|
THIS IS A LIBRARY PROJECT.
|
||||||
See http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject
|
See http://developer.android.com/guide/developing/eclipse-adt.html#libraryProject
|
||||||
for details on what should go here vs in the application project.
|
for details on what should go here vs in the application project.
|
||||||
-->
|
-->
|
||||||
<uses-sdk android:minSdkVersion="7" />
|
<application
|
||||||
<application android:icon="@drawable/arrow_icon"
|
android:icon="@drawable/arrow_icon"
|
||||||
android:label="@string/lib_name">
|
android:label="@string/lib_name" >
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
<uses-sdk
|
||||||
|
android:minSdkVersion="7"
|
||||||
|
android:targetSdkVersion="15" />
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -1,14 +1,37 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2012 Google Inc.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.google.android.maps.mytracks.test"
|
android:debuggable="true"
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0"
|
android:versionName="1.0"
|
||||||
android:debuggable="true">
|
package="com.google.android.maps.mytracks.test" >
|
||||||
<uses-sdk android:minSdkVersion="7" />
|
|
||||||
<application android:icon="@android:drawable/sym_def_app_icon"
|
<application
|
||||||
android:label="My Tracks Tests">
|
android:icon="@android:drawable/sym_def_app_icon"
|
||||||
<uses-library android:name="android.test.runner" />
|
android:label="My Tracks Tests" >
|
||||||
</application>
|
<uses-library android:name="android.test.runner" />
|
||||||
<instrumentation android:targetPackage="com.google.android.maps.mytracks"
|
</application>
|
||||||
android:name="android.test.InstrumentationTestRunner" />
|
|
||||||
|
<instrumentation
|
||||||
|
android:name="android.test.InstrumentationTestRunner"
|
||||||
|
android:targetPackage="com.google.android.maps.mytracks" />
|
||||||
|
|
||||||
|
<uses-sdk
|
||||||
|
android:minSdkVersion="7"
|
||||||
|
android:targetSdkVersion="15" />
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -20,12 +20,10 @@ import com.google.android.apps.mytracks.content.Sensor;
|
|||||||
import com.google.android.apps.mytracks.content.Sensor.SensorDataSet;
|
import com.google.android.apps.mytracks.content.Sensor.SensorDataSet;
|
||||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
import com.jayway.android.robotium.solo.Solo;
|
|
||||||
|
|
||||||
import android.app.Instrumentation;
|
import android.app.Instrumentation;
|
||||||
import android.location.Location;
|
import android.location.Location;
|
||||||
import android.test.ActivityInstrumentationTestCase2;
|
import android.test.ActivityInstrumentationTestCase2;
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ZoomControls;
|
import android.widget.ZoomControls;
|
||||||
|
|
||||||
@@ -38,7 +36,6 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
|
|
||||||
private Instrumentation instrumentation;
|
private Instrumentation instrumentation;
|
||||||
private ChartActivity chartActivity;
|
private ChartActivity chartActivity;
|
||||||
private Solo solo;
|
|
||||||
private View zoomIn;
|
private View zoomIn;
|
||||||
private View zoomOut;
|
private View zoomOut;
|
||||||
private int currentZoomLevel;
|
private int currentZoomLevel;
|
||||||
@@ -104,27 +101,6 @@ public class ChartActivityTest extends ActivityInstrumentationTestCase2<ChartAct
|
|||||||
assertEquals(false, zoomOut.isEnabled());
|
assertEquals(false, zoomOut.isEnabled());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* There are two parts in this test. Tests
|
|
||||||
* {@link ChartActivity#onCreateDialog(int)} which includes the logic to create
|
|
||||||
* {@link ChartSettingsDialog}.
|
|
||||||
*/
|
|
||||||
public void testCreateSettingDialog() {
|
|
||||||
solo = new Solo(instrumentation, chartActivity);
|
|
||||||
// Part1, tests {@link ChartActivity#onCreateOptionsMenu()}. Check if
|
|
||||||
// optional menu is created.
|
|
||||||
assertNull(chartActivity.getChartSettingsMenuItem());
|
|
||||||
sendKeys(KeyEvent.KEYCODE_MENU);
|
|
||||||
assertNotNull(chartActivity.getChartSettingsMenuItem());
|
|
||||||
|
|
||||||
// Part2, tests {@link ChartActivity#onOptionsItemSelected()}. Clicks on the
|
|
||||||
// "Chart settings", and then verify that the dialog contains the
|
|
||||||
// "By distance" text.
|
|
||||||
solo.clickOnText(chartActivity.getString(R.string.menu_chart_view_chart_settings));
|
|
||||||
instrumentation.waitForIdleSync();
|
|
||||||
assertTrue(solo.searchText(chartActivity.getString(R.string.chart_settings_by_distance)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the logic to get the incorrect values of sensor in {@link
|
* Tests the logic to get the incorrect values of sensor in {@link
|
||||||
* ChartActivity#fillDataPoint(Location, double[])}.
|
* ChartActivity#fillDataPoint(Location, double[])}.
|
||||||
|
|||||||
Reference in New Issue
Block a user