forked from upstream-mirrors/OpenTracks
Rename to Google Spreadsheets.
This commit is contained in:
@@ -204,7 +204,6 @@ limitations under the License.
|
|||||||
<activity android:name="com.google.android.apps.mytracks.io.backup.BackupActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.backup.BackupActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.backup.RestoreActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.backup.RestoreActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.backup.RestoreChooserActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.backup.RestoreChooserActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.docs.SendDocsActivity" />
|
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.drive.SendDriveActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.drive.SendDriveActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.file.SaveActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.file.SaveActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity" />
|
||||||
@@ -214,6 +213,7 @@ limitations under the License.
|
|||||||
<activity android:name="com.google.android.apps.mytracks.io.maps.SendMapsActivity" />
|
<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.AccountChooserActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity" />
|
<activity android:name="com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity" />
|
||||||
|
<activity android:name="com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.settings.BackupResetSettingsActivity" />
|
<activity android:name="com.google.android.apps.mytracks.settings.BackupResetSettingsActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.settings.ChartSettingsActivity" />
|
<activity android:name="com.google.android.apps.mytracks.settings.ChartSettingsActivity" />
|
||||||
<activity android:name="com.google.android.apps.mytracks.settings.GoogleSettingsActivity" />
|
<activity android:name="com.google.android.apps.mytracks.settings.GoogleSettingsActivity" />
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 810 B |
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 368 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 372 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
@@ -67,12 +67,12 @@ limitations under the License.
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<ImageView
|
<ImageView
|
||||||
android:contentDescription="@string/send_google_docs"
|
android:contentDescription="@string/send_google_spreadsheets"
|
||||||
android:src="@drawable/google_docs_icon"
|
android:src="@drawable/google_spreadsheets_icon"
|
||||||
style="@style/ChooseUploadServiceImageView" />
|
style="@style/ChooseUploadServiceImageView" />
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/choose_upload_service_docs"
|
android:id="@+id/choose_upload_service_spreadsheets"
|
||||||
android:text="@string/send_google_docs"
|
android:text="@string/send_google_spreadsheets"
|
||||||
style="@style/ChooseUploadServiceCheckBox" />
|
style="@style/ChooseUploadServiceCheckBox" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
</TableLayout>
|
</TableLayout>
|
||||||
|
|||||||
@@ -105,15 +105,15 @@ limitations under the License.
|
|||||||
style="@style/TextSmall" />
|
style="@style/TextSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!-- Google Docs result -->
|
<!-- Google Spreadsheets result -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/upload_result_docs_result"
|
android:id="@+id/upload_result_spreadsheets_result"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:orientation="horizontal" >
|
android:orientation="horizontal" >
|
||||||
<ImageView
|
<ImageView
|
||||||
android:contentDescription="@string/generic_success_title"
|
android:contentDescription="@string/generic_success_title"
|
||||||
android:id="@+id/upload_result_docs_result_icon"
|
android:id="@+id/upload_result_spreadsheets_result_icon"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -126,10 +126,10 @@ limitations under the License.
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="8dp" >
|
android:paddingLeft="8dp" >
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_docs"
|
android:text="@string/send_google_spreadsheets"
|
||||||
style="@style/TextMedium" />
|
style="@style/TextMedium" />
|
||||||
<TextView
|
<TextView
|
||||||
android:text="@string/send_google_docs_url"
|
android:text="@string/send_google_spreadsheets_url"
|
||||||
style="@style/TextSmall" />
|
style="@style/TextSmall" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -79,10 +79,10 @@ Google은 이용자에 대한 위치정보의 이용∙제공사실을 위치정
|
|||||||
<string name="my_tracks_support_url">groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks</string>
|
<string name="my_tracks_support_url">groups.google.com/a/googleproductforums.com/forum/#!categories/maps/mytracks</string>
|
||||||
<string name="my_tracks_web_url">www.google.com/mobile/mytracks</string>
|
<string name="my_tracks_web_url">www.google.com/mobile/mytracks</string>
|
||||||
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
<string name="permission_notification_value">com.google.android.apps.mytracks.MYTRACKS_NOTIFICATIONS</string>
|
||||||
<string name="send_google_docs_url">docs.google.com</string>
|
|
||||||
<string name="send_google_drive_url">drive.google.com</string>
|
<string name="send_google_drive_url">drive.google.com</string>
|
||||||
<string name="send_google_fusion_tables_url">google.com/fusiontables</string>
|
<string name="send_google_fusion_tables_url">google.com/fusiontables</string>
|
||||||
<string name="send_google_maps_url">maps.google.com</string>
|
<string name="send_google_maps_url">maps.google.com</string>
|
||||||
|
<string name="send_google_spreadsheets_url">drive.google.com</string>
|
||||||
<string name="sensor_type_value_ant">ANT</string>
|
<string name="sensor_type_value_ant">ANT</string>
|
||||||
<string name="sensor_type_value_none">NONE</string>
|
<string name="sensor_type_value_none">NONE</string>
|
||||||
<string name="sensor_type_value_polar">POLAR</string>
|
<string name="sensor_type_value_polar">POLAR</string>
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ limitations under the License.
|
|||||||
<string name="min_required_accuracy_key">minRequiredAccuracy</string>
|
<string name="min_required_accuracy_key">minRequiredAccuracy</string>
|
||||||
<string name="pick_existing_map_key">pickExistingMap</string>
|
<string name="pick_existing_map_key">pickExistingMap</string>
|
||||||
<string name="report_speed_key">reportSpeed</string>
|
<string name="report_speed_key">reportSpeed</string>
|
||||||
<string name="send_to_docs_key">sendToDocs</string>
|
|
||||||
<string name="send_to_drive_key">sendToDrive</string>
|
<string name="send_to_drive_key">sendToDrive</string>
|
||||||
<string name="send_to_fusion_tables_key">sendToFusionTables</string>
|
<string name="send_to_fusion_tables_key">sendToFusionTables</string>
|
||||||
<string name="send_to_maps_key">sendToMaps</string>
|
<string name="send_to_maps_key">sendToMaps</string>
|
||||||
|
<string name="send_to_spreadsheets_key">sendToSpreadsheets</string>
|
||||||
<string name="sensor_type_key">sensorType</string>
|
<string name="sensor_type_key">sensorType</string>
|
||||||
<string name="split_frequency_key">splitFrequency</string>
|
<string name="split_frequency_key">splitFrequency</string>
|
||||||
<string name="stats_show_coordinate_key">statsShowCoordinate</string>
|
<string name="stats_show_coordinate_key">statsShowCoordinate</string>
|
||||||
|
|||||||
@@ -795,8 +795,8 @@ limitations under the License.
|
|||||||
deletes the recorded tracks from the device memory. If you have saved tracks or backups on the
|
deletes the recorded tracks from the device memory. If you have saved tracks or backups on the
|
||||||
external storage, you must delete them separately. You can access the external storage using
|
external storage, you must delete them separately. You can access the external storage using
|
||||||
any file manager app from the Play Store or using a USB cable to connect your device to your
|
any file manager app from the Play Store or using a USB cable to connect your device to your
|
||||||
computer. Tracks uploaded to Google Maps, Google Fusion Tables, and Google Docs must also be
|
computer. Tracks uploaded to Google Maps, Google Fusion Tables, and Google Spreadsheets must
|
||||||
deleted separately.
|
also be deleted separately.
|
||||||
</string>
|
</string>
|
||||||
<string name="help_delete_tracks_question"
|
<string name="help_delete_tracks_question"
|
||||||
translation_description="In the 'Help' page, the question on delete tracks.">
|
translation_description="In the 'Help' page, the question on delete tracks.">
|
||||||
@@ -875,8 +875,8 @@ limitations under the License.
|
|||||||
translation_description="In the 'Help' page, the answer on what is My Tracks.">
|
translation_description="In the 'Help' page, the answer on what is My Tracks.">
|
||||||
My Tracks allows you to record GPS tracks and visualize your walking, running, biking or any
|
My Tracks allows you to record GPS tracks and visualize your walking, running, biking or any
|
||||||
other activity while watching live performance statistics. My Tracks makes it easy to archive
|
other activity while watching live performance statistics. My Tracks makes it easy to archive
|
||||||
your training history with Google Maps, Google Fusion Tables, and Google Docs, and share your
|
your training history with Google Maps, Google Fusion Tables, and Google Spreadsheets, and share
|
||||||
activities with friends and the world.
|
your activities with friends and the world.
|
||||||
</string>
|
</string>
|
||||||
<string name="help_my_tracks_question"
|
<string name="help_my_tracks_question"
|
||||||
translation_description="In the 'Help' page, the question on what is My Tracks.">
|
translation_description="In the 'Help' page, the question on what is My Tracks.">
|
||||||
@@ -896,10 +896,10 @@ limitations under the License.
|
|||||||
|
|
||||||
%1$s url. E.g., 'maps.google.com'.
|
%1$s url. E.g., 'maps.google.com'.
|
||||||
%2$s url. E.g., 'google.com/fusiontables'.
|
%2$s url. E.g., 'google.com/fusiontables'.
|
||||||
%3$s url. E.g., 'docs.google.com'.">
|
%3$s url. E.g., 'drive.google.com'.">
|
||||||
You can send a track to Google Maps, Google Fusion Tables, and Google Docs. Tracks sent to
|
You can send a track to Google Maps, Google Fusion Tables, and Google Spreadsheets. Tracks sent
|
||||||
Google Maps are at %1$s, “My Places”. Tracks sent to Google Fusion Tables are at
|
to Google Maps are at %1$s, “My Places”. Tracks sent to Google Fusion Tables are at
|
||||||
%2$s. Tracks sent to Google Docs are at %3$s.
|
%2$s. Tracks sent to Google Spreadsheets are at %3$s.
|
||||||
</string>
|
</string>
|
||||||
<string name="help_send_track_question"
|
<string name="help_send_track_question"
|
||||||
translation_description="In the 'Help' page, the question on sending a track.">
|
translation_description="In the 'Help' page, the question on sending a track.">
|
||||||
@@ -917,13 +917,13 @@ limitations under the License.
|
|||||||
<string name="help_share_visibility_answer"
|
<string name="help_share_visibility_answer"
|
||||||
translation_description="In the 'Help' page, the answer on share visibility.">
|
translation_description="In the 'Help' page, the answer on share visibility.">
|
||||||
By default, tracks sent to Google Maps are unlisted, tracks sent to Google Fusion Tables are
|
By default, tracks sent to Google Maps are unlisted, tracks sent to Google Fusion Tables are
|
||||||
public, and tracks sent to Google Docs are private. For Google Maps, you can change the
|
private, and tracks sent to Google Spreadsheets are private. For Google Maps, you can change the
|
||||||
default between public and unlisted via Settings -> Google. After uploading tracks, you can
|
default between public and unlisted via Settings -> Google. After uploading tracks, you can
|
||||||
change their visibility in Google Maps, Google Fusion Tables, and Google Docs.
|
change their visibility in Google Maps, Google Fusion Tables, and Google Spreadsheets.
|
||||||
</string>
|
</string>
|
||||||
<string name="help_share_visibility_question"
|
<string name="help_share_visibility_question"
|
||||||
translation_description="In the 'Help' page, the question on share visibility.">
|
translation_description="In the 'Help' page, the question on share visibility.">
|
||||||
Who can see the tracks I send to Google Maps, Google Fusion Tables, and Google Docs?
|
Who can see the tracks I send to Google Maps, Google Fusion Tables, and Google Spreadsheets?
|
||||||
</string>
|
</string>
|
||||||
<string name="help_split_marker_answer"
|
<string name="help_split_marker_answer"
|
||||||
translation_description="In the 'Help' page, the answer on split markers.">
|
translation_description="In the 'Help' page, the answer on split markers.">
|
||||||
@@ -1437,11 +1437,6 @@ limitations under the License.
|
|||||||
translation_description="When sending to Google, the dialog title to choose a Google account.">
|
translation_description="When sending to Google, the dialog title to choose a Google account.">
|
||||||
Choose account
|
Choose account
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_docs"
|
|
||||||
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
|
||||||
checkbox option to send to Google Docs.">
|
|
||||||
Google Docs
|
|
||||||
</string>
|
|
||||||
<string name="send_google_drive"
|
<string name="send_google_drive"
|
||||||
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
||||||
checkbox option to send to Google Drive.">
|
checkbox option to send to Google Drive.">
|
||||||
@@ -1509,7 +1504,7 @@ limitations under the License.
|
|||||||
<string name="send_google_progress_message"
|
<string name="send_google_progress_message"
|
||||||
translation_description="When sending a track to a Google service, the progress message.
|
translation_description="When sending a track to a Google service, the progress message.
|
||||||
|
|
||||||
%1$s: service name. 'Google Maps', 'Google Fusion Tables', or 'Google Docs'.">
|
%1$s: service name. 'Google Maps', 'Google Fusion Tables', or 'Google Spreadsheets'.">
|
||||||
Sending to %1$s…
|
Sending to %1$s…
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_send_now"
|
<string name="send_google_send_now"
|
||||||
@@ -1517,6 +1512,11 @@ limitations under the License.
|
|||||||
button on the bottom to send the track to the selected Google services.">
|
button on the bottom to send the track to the selected Google services.">
|
||||||
Send now
|
Send now
|
||||||
</string>
|
</string>
|
||||||
|
<string name="send_google_spreadsheets"
|
||||||
|
translation_description="When sending a track to Google, under the 'Send to...' dialog, the
|
||||||
|
checkbox option to send to Google Spreadsheets.">
|
||||||
|
Google Spreadsheets
|
||||||
|
</string>
|
||||||
<string name="send_google_success_footer"
|
<string name="send_google_success_footer"
|
||||||
translation_description="When sending a track to Google, the additional comment on the bottom of
|
translation_description="When sending a track to Google, the additional comment on the bottom of
|
||||||
the result page.">
|
the result page.">
|
||||||
@@ -1525,7 +1525,7 @@ limitations under the License.
|
|||||||
<string name="send_google_title"
|
<string name="send_google_title"
|
||||||
translation_description="When sending a track to Google, the dialog title to choose the Google
|
translation_description="When sending a track to Google, the dialog title to choose the Google
|
||||||
services to send the track to. The user can choose Google Maps, Google Fusion Tables, and
|
services to send the track to. The user can choose Google Maps, Google Fusion Tables, and
|
||||||
Google Docs.">
|
Google Spreadsheets.">
|
||||||
Send to…
|
Send to…
|
||||||
</string>
|
</string>
|
||||||
<string name="send_google_track_part_label"
|
<string name="send_google_track_part_label"
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class HelpActivity extends AbstractMyTracksActivity {
|
|||||||
TextView sendTrack = (TextView) findViewById(R.id.help_send_track_answer);
|
TextView sendTrack = (TextView) findViewById(R.id.help_send_track_answer);
|
||||||
sendTrack.setText(StringUtils.getHtml(
|
sendTrack.setText(StringUtils.getHtml(
|
||||||
this, R.string.help_send_track_answer, R.string.send_google_maps_url,
|
this, R.string.help_send_track_answer, R.string.send_google_maps_url,
|
||||||
R.string.send_google_fusion_tables_url, R.string.send_google_docs_url));
|
R.string.send_google_fusion_tables_url, R.string.send_google_spreadsheets_url));
|
||||||
|
|
||||||
findViewById(R.id.help_ok).setOnClickListener(new OnClickListener() {
|
findViewById(R.id.help_ok).setOnClickListener(new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|||||||
+22
-21
@@ -50,7 +50,8 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
private static final String KEY_SEND_REQUEST = "sendRequest";
|
private static final String KEY_SEND_REQUEST = "sendRequest";
|
||||||
private static final String KEY_HIDE_DRIVE = "hideDrive";
|
private static final String KEY_HIDE_DRIVE = "hideDrive";
|
||||||
|
|
||||||
public static ChooseUploadServiceDialogFragment newInstance(SendRequest sendRequest, boolean hideDrive) {
|
public static ChooseUploadServiceDialogFragment newInstance(
|
||||||
|
SendRequest sendRequest, boolean hideDrive) {
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
bundle.putParcelable(KEY_SEND_REQUEST, sendRequest);
|
bundle.putParcelable(KEY_SEND_REQUEST, sendRequest);
|
||||||
bundle.putBoolean(KEY_HIDE_DRIVE, hideDrive);
|
bundle.putBoolean(KEY_HIDE_DRIVE, hideDrive);
|
||||||
@@ -63,11 +64,11 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
private FragmentActivity activity;
|
private FragmentActivity activity;
|
||||||
private SendRequest sendRequest;
|
private SendRequest sendRequest;
|
||||||
private boolean hideDrive;
|
private boolean hideDrive;
|
||||||
|
|
||||||
private CheckBox driveCheckBox;
|
private CheckBox driveCheckBox;
|
||||||
private CheckBox mapsCheckBox;
|
private CheckBox mapsCheckBox;
|
||||||
private CheckBox fusionTablesCheckBox;
|
private CheckBox fusionTablesCheckBox;
|
||||||
private CheckBox docsCheckBox;
|
private CheckBox spreadsheetsCheckBox;
|
||||||
|
|
||||||
private TableRow mapsOptionTableRow;
|
private TableRow mapsOptionTableRow;
|
||||||
private RadioButton existingMapRadioButton;
|
private RadioButton existingMapRadioButton;
|
||||||
@@ -77,7 +78,7 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
activity = getActivity();
|
activity = getActivity();
|
||||||
sendRequest = getArguments().getParcelable(KEY_SEND_REQUEST);
|
sendRequest = getArguments().getParcelable(KEY_SEND_REQUEST);
|
||||||
hideDrive = getArguments().getBoolean(KEY_HIDE_DRIVE);
|
hideDrive = getArguments().getBoolean(KEY_HIDE_DRIVE);
|
||||||
|
|
||||||
View view = activity.getLayoutInflater().inflate(R.layout.choose_upload_service, null);
|
View view = activity.getLayoutInflater().inflate(R.layout.choose_upload_service, null);
|
||||||
|
|
||||||
view.findViewById(R.id.choose_upload_service_drive_options)
|
view.findViewById(R.id.choose_upload_service_drive_options)
|
||||||
@@ -86,7 +87,7 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
driveCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_drive);
|
driveCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_drive);
|
||||||
mapsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_maps);
|
mapsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_maps);
|
||||||
fusionTablesCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_fusion_tables);
|
fusionTablesCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_fusion_tables);
|
||||||
docsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_docs);
|
spreadsheetsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_spreadsheets);
|
||||||
|
|
||||||
driveCheckBox.setChecked(PreferencesUtils.getBoolean(
|
driveCheckBox.setChecked(PreferencesUtils.getBoolean(
|
||||||
activity, R.string.send_to_drive_key, PreferencesUtils.SEND_TO_DRIVE_DEFAULT));
|
activity, R.string.send_to_drive_key, PreferencesUtils.SEND_TO_DRIVE_DEFAULT));
|
||||||
@@ -94,10 +95,11 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
activity, R.string.send_to_maps_key, PreferencesUtils.SEND_TO_MAPS_DEFAULT));
|
activity, R.string.send_to_maps_key, PreferencesUtils.SEND_TO_MAPS_DEFAULT));
|
||||||
fusionTablesCheckBox.setChecked(PreferencesUtils.getBoolean(
|
fusionTablesCheckBox.setChecked(PreferencesUtils.getBoolean(
|
||||||
activity, R.string.send_to_fusion_tables_key,
|
activity, R.string.send_to_fusion_tables_key,
|
||||||
PreferencesUtils.SEND_TO_FUSION_TABLES_DEFAULT));
|
PreferencesUtils.SEND_TO_FUSION_TABLES_DEFAULT));
|
||||||
|
|
||||||
docsCheckBox.setChecked(PreferencesUtils.getBoolean(
|
spreadsheetsCheckBox.setChecked(PreferencesUtils.getBoolean(
|
||||||
activity, R.string.send_to_docs_key, PreferencesUtils.SEND_TO_DOCS_DEFAULT));
|
activity, R.string.send_to_spreadsheets_key,
|
||||||
|
PreferencesUtils.SEND_TO_SPREADSHEETS_DEFAULT));
|
||||||
|
|
||||||
mapsCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
mapsCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
|
||||||
public void onCheckedChanged(CompoundButton button, boolean checked) {
|
public void onCheckedChanged(CompoundButton button, boolean checked) {
|
||||||
@@ -124,16 +126,15 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
} else {
|
} else {
|
||||||
newMapRadioButton.setChecked(true);
|
newMapRadioButton.setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update fusion table
|
// Update fusion table
|
||||||
boolean defaultTablePublic = PreferencesUtils.getBoolean(activity,
|
boolean defaultTablePublic = PreferencesUtils.getBoolean(
|
||||||
R.string.default_table_public_key,
|
activity, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
||||||
PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
|
||||||
String text = getString(R.string.send_google_fusion_tables) + "\n"
|
String text = getString(R.string.send_google_fusion_tables) + "\n"
|
||||||
+ getString(defaultTablePublic ? R.string.send_google_fusion_tables_public
|
+ getString(defaultTablePublic ? R.string.send_google_fusion_tables_public
|
||||||
: R.string.send_google_fusion_tables_private);
|
: R.string.send_google_fusion_tables_private);
|
||||||
fusionTablesCheckBox.setText(text);
|
fusionTablesCheckBox.setText(text);
|
||||||
|
|
||||||
return new AlertDialog.Builder(activity).setNegativeButton(R.string.generic_cancel, null)
|
return new AlertDialog.Builder(activity).setNegativeButton(R.string.generic_cancel, null)
|
||||||
.setPositiveButton(R.string.send_google_send_now, new DialogInterface.OnClickListener() {
|
.setPositiveButton(R.string.send_google_send_now, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -147,9 +148,9 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
PreferencesUtils.setBoolean(
|
PreferencesUtils.setBoolean(
|
||||||
activity, R.string.send_to_fusion_tables_key, fusionTablesCheckBox.isChecked());
|
activity, R.string.send_to_fusion_tables_key, fusionTablesCheckBox.isChecked());
|
||||||
PreferencesUtils.setBoolean(
|
PreferencesUtils.setBoolean(
|
||||||
activity, R.string.send_to_docs_key, docsCheckBox.isChecked());
|
activity, R.string.send_to_spreadsheets_key, spreadsheetsCheckBox.isChecked());
|
||||||
if (sendDrive() || mapsCheckBox.isChecked()
|
if (sendDrive() || mapsCheckBox.isChecked() || fusionTablesCheckBox.isChecked()
|
||||||
|| fusionTablesCheckBox.isChecked() || docsCheckBox.isChecked()) {
|
|| spreadsheetsCheckBox.isChecked()) {
|
||||||
startNextActivity();
|
startNextActivity();
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(activity, R.string.send_google_no_service_selected, Toast.LENGTH_LONG)
|
Toast.makeText(activity, R.string.send_google_no_service_selected, Toast.LENGTH_LONG)
|
||||||
@@ -173,7 +174,7 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
sendRequest.setSendDrive(sendDrive());
|
sendRequest.setSendDrive(sendDrive());
|
||||||
sendRequest.setSendMaps(mapsCheckBox.isChecked());
|
sendRequest.setSendMaps(mapsCheckBox.isChecked());
|
||||||
sendRequest.setSendFusionTables(fusionTablesCheckBox.isChecked());
|
sendRequest.setSendFusionTables(fusionTablesCheckBox.isChecked());
|
||||||
sendRequest.setSendDocs(docsCheckBox.isChecked());
|
sendRequest.setSendSpreadsheets(spreadsheetsCheckBox.isChecked());
|
||||||
sendRequest.setNewMap(!existingMapRadioButton.isChecked());
|
sendRequest.setNewMap(!existingMapRadioButton.isChecked());
|
||||||
sendStats();
|
sendStats();
|
||||||
Intent intent = IntentUtils.newIntent(activity, AccountChooserActivity.class)
|
Intent intent = IntentUtils.newIntent(activity, AccountChooserActivity.class)
|
||||||
@@ -194,11 +195,11 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
|||||||
if (sendRequest.isSendFusionTables()) {
|
if (sendRequest.isSendFusionTables()) {
|
||||||
AnalyticsUtils.sendPageViews(activity, "/send/fusion_tables");
|
AnalyticsUtils.sendPageViews(activity, "/send/fusion_tables");
|
||||||
}
|
}
|
||||||
if (sendRequest.isSendDocs()) {
|
if (sendRequest.isSendSpreadsheets()) {
|
||||||
AnalyticsUtils.sendPageViews(activity, "/send/docs");
|
AnalyticsUtils.sendPageViews(activity, "/send/spreadsheets");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True to send to Google Drive.
|
* True to send to Google Drive.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.google.android.apps.mytracks.io.drive;
|
package com.google.android.apps.mytracks.io.drive;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
|
|
||||||
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
||||||
import com.google.android.apps.mytracks.io.maps.ChooseMapActivity;
|
import com.google.android.apps.mytracks.io.maps.ChooseMapActivity;
|
||||||
import com.google.android.apps.mytracks.io.maps.SendMapsActivity;
|
import com.google.android.apps.mytracks.io.maps.SendMapsActivity;
|
||||||
@@ -24,6 +23,7 @@ import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
|||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
||||||
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.UploadResultActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
|
||||||
import com.google.android.apps.mytracks.util.IntentUtils;
|
import com.google.android.apps.mytracks.util.IntentUtils;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
|
|
||||||
@@ -65,8 +65,8 @@ public class SendDriveActivity extends AbstractSendActivity {
|
|||||||
return sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
|
return sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
|
||||||
} else if (sendRequest.isSendFusionTables()) {
|
} else if (sendRequest.isSendFusionTables()) {
|
||||||
return SendFusionTablesActivity.class;
|
return SendFusionTablesActivity.class;
|
||||||
} else if (sendRequest.isSendDocs()) {
|
} else if (sendRequest.isSendSpreadsheets()) {
|
||||||
return SendDocsActivity.class;
|
return SendSpreadsheetsActivity.class;
|
||||||
} else {
|
} else {
|
||||||
return UploadResultActivity.class;
|
return UploadResultActivity.class;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -16,11 +16,11 @@
|
|||||||
|
|
||||||
package com.google.android.apps.mytracks.io.fusiontables;
|
package com.google.android.apps.mytracks.io.fusiontables;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
|
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
||||||
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.UploadResultActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
|
||||||
import com.google.android.apps.mytracks.util.IntentUtils;
|
import com.google.android.apps.mytracks.util.IntentUtils;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
@@ -59,8 +59,8 @@ public class SendFusionTablesActivity extends AbstractSendActivity {
|
|||||||
if (isCancel) {
|
if (isCancel) {
|
||||||
return UploadResultActivity.class;
|
return UploadResultActivity.class;
|
||||||
} else {
|
} else {
|
||||||
if (request.isSendDocs()) {
|
if (request.isSendSpreadsheets()) {
|
||||||
return SendDocsActivity.class;
|
return SendSpreadsheetsActivity.class;
|
||||||
} else {
|
} else {
|
||||||
return UploadResultActivity.class;
|
return UploadResultActivity.class;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,12 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.io.maps;
|
package com.google.android.apps.mytracks.io.maps;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
|
|
||||||
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
||||||
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.UploadResultActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
|
||||||
import com.google.android.apps.mytracks.util.IntentUtils;
|
import com.google.android.apps.mytracks.util.IntentUtils;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
@@ -62,8 +62,8 @@ public class SendMapsActivity extends AbstractSendActivity {
|
|||||||
} else {
|
} else {
|
||||||
if (request.isSendFusionTables()) {
|
if (request.isSendFusionTables()) {
|
||||||
return SendFusionTablesActivity.class;
|
return SendFusionTablesActivity.class;
|
||||||
} else if (request.isSendDocs()) {
|
} else if (request.isSendSpreadsheets()) {
|
||||||
return SendDocsActivity.class;
|
return SendSpreadsheetsActivity.class;
|
||||||
} else {
|
} else {
|
||||||
return UploadResultActivity.class;
|
return UploadResultActivity.class;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-7
@@ -17,12 +17,12 @@
|
|||||||
package com.google.android.apps.mytracks.io.sendtogoogle;
|
package com.google.android.apps.mytracks.io.sendtogoogle;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.Constants;
|
import com.google.android.apps.mytracks.Constants;
|
||||||
import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
|
|
||||||
import com.google.android.apps.mytracks.io.drive.SendDriveActivity;
|
import com.google.android.apps.mytracks.io.drive.SendDriveActivity;
|
||||||
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
||||||
import com.google.android.apps.mytracks.io.gdata.maps.MapsConstants;
|
import com.google.android.apps.mytracks.io.gdata.maps.MapsConstants;
|
||||||
import com.google.android.apps.mytracks.io.maps.ChooseMapActivity;
|
import com.google.android.apps.mytracks.io.maps.ChooseMapActivity;
|
||||||
import com.google.android.apps.mytracks.io.maps.SendMapsActivity;
|
import com.google.android.apps.mytracks.io.maps.SendMapsActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
|
||||||
import com.google.android.apps.mytracks.util.IntentUtils;
|
import com.google.android.apps.mytracks.util.IntentUtils;
|
||||||
import com.google.android.apps.mytracks.util.PreferencesUtils;
|
import com.google.android.apps.mytracks.util.PreferencesUtils;
|
||||||
import com.google.android.maps.mytracks.R;
|
import com.google.android.maps.mytracks.R;
|
||||||
@@ -185,7 +185,7 @@ public class AccountChooserActivity extends Activity {
|
|||||||
needDrivePermission = defaultTablePublic && sendRequest.isSendFusionTables();
|
needDrivePermission = defaultTablePublic && sendRequest.isSendFusionTables();
|
||||||
}
|
}
|
||||||
if (!needDrivePermission) {
|
if (!needDrivePermission) {
|
||||||
needDrivePermission = sendRequest.isSendDocs();
|
needDrivePermission = sendRequest.isSendSpreadsheets();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needDrivePermission) {
|
if (needDrivePermission) {
|
||||||
@@ -214,7 +214,7 @@ public class AccountChooserActivity extends Activity {
|
|||||||
* Checks the Spreadsheet permission.
|
* Checks the Spreadsheet permission.
|
||||||
*/
|
*/
|
||||||
private void checkSpreadsheetPermission() {
|
private void checkSpreadsheetPermission() {
|
||||||
if (sendRequest.isSendDocs()) {
|
if (sendRequest.isSendSpreadsheets()) {
|
||||||
SendToGoogleUtils.checkPermissionByActivity(this, sendRequest.getAccount().name,
|
SendToGoogleUtils.checkPermissionByActivity(this, sendRequest.getAccount().name,
|
||||||
SendToGoogleUtils.SPREADSHEET_SCOPE,
|
SendToGoogleUtils.SPREADSHEET_SCOPE,
|
||||||
SendToGoogleUtils.SPREADSHEET_PERMISSION_REQUEST_CODE, spreadsheetsCallback);
|
SendToGoogleUtils.SPREADSHEET_PERMISSION_REQUEST_CODE, spreadsheetsCallback);
|
||||||
@@ -312,15 +312,17 @@ public class AccountChooserActivity extends Activity {
|
|||||||
/**
|
/**
|
||||||
* Starts the next activity. If
|
* Starts the next activity. If
|
||||||
* <p>
|
* <p>
|
||||||
|
* sendDrive -> {@link SendDriveActivity}
|
||||||
|
* <p>
|
||||||
* sendMaps and newMap -> {@link SendMapsActivity}
|
* sendMaps and newMap -> {@link SendMapsActivity}
|
||||||
* <p>
|
* <p>
|
||||||
* sendMaps and !newMap -> {@link ChooseMapActivity}
|
* sendMaps and !newMap -> {@link ChooseMapActivity}
|
||||||
* <p>
|
* <p>
|
||||||
* !sendMaps && sendFusionTables -> {@link SendFusionTablesActivity}
|
* !sendMaps && sendFusionTables -> {@link SendFusionTablesActivity}
|
||||||
* <p>
|
* <p>
|
||||||
* !sendMaps && !sendFusionTables && sendDocs -> {@link SendDocsActivity}
|
* !sendMaps && !sendFusionTables && sendSpreadsheets -> {@link SendSpreadsheetsActivity}
|
||||||
* <p>
|
* <p>
|
||||||
* !sendMaps && !sendFusionTables && !sendDocs -> {@link UploadResultActivity}
|
* !sendMaps && !sendFusionTables && !sendSpreadsheets -> {@link UploadResultActivity}
|
||||||
*/
|
*/
|
||||||
private void startNextActivity() {
|
private void startNextActivity() {
|
||||||
Class<?> next;
|
Class<?> next;
|
||||||
@@ -330,8 +332,8 @@ public class AccountChooserActivity extends Activity {
|
|||||||
next = sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
|
next = sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
|
||||||
} else if (sendRequest.isSendFusionTables()) {
|
} else if (sendRequest.isSendFusionTables()) {
|
||||||
next = SendFusionTablesActivity.class;
|
next = SendFusionTablesActivity.class;
|
||||||
} else if (sendRequest.isSendDocs()) {
|
} else if (sendRequest.isSendSpreadsheets()) {
|
||||||
next = SendDocsActivity.class;
|
next = SendSpreadsheetsActivity.class;
|
||||||
} else {
|
} else {
|
||||||
next = UploadResultActivity.class;
|
next = UploadResultActivity.class;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import android.os.Parcelable;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Send request states for sending a track to Google Maps, Google Fusion Tables,
|
* Send request states for sending a track to Google Maps, Google Fusion Tables,
|
||||||
* and Google Docs.
|
* and Google Spreadsheets.
|
||||||
*
|
*
|
||||||
* @author Jimmy Shih
|
* @author Jimmy Shih
|
||||||
*/
|
*/
|
||||||
@@ -37,13 +37,13 @@ public class SendRequest implements Parcelable {
|
|||||||
private boolean sendDrive = false;
|
private boolean sendDrive = false;
|
||||||
private boolean sendMaps = false;
|
private boolean sendMaps = false;
|
||||||
private boolean sendFusionTables = false;
|
private boolean sendFusionTables = false;
|
||||||
private boolean sendDocs = false;
|
private boolean sendSpreadsheets = false;
|
||||||
private boolean newMap = false;
|
private boolean newMap = false;
|
||||||
private Account account = null;
|
private Account account = null;
|
||||||
private String mapId = null;
|
private String mapId = null;
|
||||||
private boolean driveSuccess = false;
|
private boolean driveSuccess = false;
|
||||||
private boolean mapsSuccess = false;
|
private boolean mapsSuccess = false;
|
||||||
private boolean docsSuccess = false;
|
private boolean spreadsheetsSuccess = false;
|
||||||
private boolean fusionTablesSuccess = false;
|
private boolean fusionTablesSuccess = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -162,20 +162,20 @@ public class SendRequest implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the user has selected the send to Google Docs option.
|
* True if the user has selected the send to Google Spreadsheets option.
|
||||||
*/
|
*/
|
||||||
public boolean isSendDocs() {
|
public boolean isSendSpreadsheets() {
|
||||||
return sendDocs;
|
return sendSpreadsheets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the send to Google Docs option.
|
* Sets the send to Google Spreadsheets option.
|
||||||
*
|
*
|
||||||
* @param sendDocs true if the user has selected the send to Google Docs
|
* @param sendSpreadsheets true if the user has selected the send to Google
|
||||||
* option
|
* Spreadsheets option
|
||||||
*/
|
*/
|
||||||
public void setSendDocs(boolean sendDocs) {
|
public void setSendSpreadsheets(boolean sendSpreadsheets) {
|
||||||
this.sendDocs = sendDocs;
|
this.sendSpreadsheets = sendSpreadsheets;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -277,19 +277,20 @@ public class SendRequest implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if sending to Google Docs is success.
|
* True if sending to Google Spreadsheets is success.
|
||||||
*/
|
*/
|
||||||
public boolean isDocsSuccess() {
|
public boolean isSpreadsheetsSuccess() {
|
||||||
return docsSuccess;
|
return spreadsheetsSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the Google Docs result.
|
* Sets the Google Spreadsheets result.
|
||||||
*
|
*
|
||||||
* @param docsSuccess true if sending to Google Docs is success
|
* @param spreadsheetsSuccess true if sending to Google Spreadsheets is
|
||||||
|
* success
|
||||||
*/
|
*/
|
||||||
public void setDocsSuccess(boolean docsSuccess) {
|
public void setSpreadsheetSuccess(boolean spreadsheetsSuccess) {
|
||||||
this.docsSuccess = docsSuccess;
|
this.spreadsheetsSuccess = spreadsheetsSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SendRequest(Parcel in) {
|
private SendRequest(Parcel in) {
|
||||||
@@ -300,14 +301,14 @@ public class SendRequest implements Parcelable {
|
|||||||
sendDrive = in.readByte() == 1;
|
sendDrive = in.readByte() == 1;
|
||||||
sendMaps = in.readByte() == 1;
|
sendMaps = in.readByte() == 1;
|
||||||
sendFusionTables = in.readByte() == 1;
|
sendFusionTables = in.readByte() == 1;
|
||||||
sendDocs = in.readByte() == 1;
|
sendSpreadsheets = in.readByte() == 1;
|
||||||
newMap = in.readByte() == 1;
|
newMap = in.readByte() == 1;
|
||||||
account = in.readParcelable(null);
|
account = in.readParcelable(null);
|
||||||
mapId = in.readString();
|
mapId = in.readString();
|
||||||
driveSuccess = in.readByte() == 1;
|
driveSuccess = in.readByte() == 1;
|
||||||
mapsSuccess = in.readByte() == 1;
|
mapsSuccess = in.readByte() == 1;
|
||||||
fusionTablesSuccess = in.readByte() == 1;
|
fusionTablesSuccess = in.readByte() == 1;
|
||||||
docsSuccess = in.readByte() == 1;
|
spreadsheetsSuccess = in.readByte() == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -324,14 +325,14 @@ public class SendRequest implements Parcelable {
|
|||||||
out.writeByte((byte) (sendDrive ? 1 : 0));
|
out.writeByte((byte) (sendDrive ? 1 : 0));
|
||||||
out.writeByte((byte) (sendMaps ? 1 : 0));
|
out.writeByte((byte) (sendMaps ? 1 : 0));
|
||||||
out.writeByte((byte) (sendFusionTables ? 1 : 0));
|
out.writeByte((byte) (sendFusionTables ? 1 : 0));
|
||||||
out.writeByte((byte) (sendDocs ? 1 : 0));
|
out.writeByte((byte) (sendSpreadsheets ? 1 : 0));
|
||||||
out.writeByte((byte) (newMap ? 1 : 0));
|
out.writeByte((byte) (newMap ? 1 : 0));
|
||||||
out.writeParcelable(account, 0);
|
out.writeParcelable(account, 0);
|
||||||
out.writeString(mapId);
|
out.writeString(mapId);
|
||||||
out.writeByte((byte) (driveSuccess ? 1 : 0));
|
out.writeByte((byte) (driveSuccess ? 1 : 0));
|
||||||
out.writeByte((byte) (mapsSuccess ? 1 : 0));
|
out.writeByte((byte) (mapsSuccess ? 1 : 0));
|
||||||
out.writeByte((byte) (fusionTablesSuccess ? 1 : 0));
|
out.writeByte((byte) (fusionTablesSuccess ? 1 : 0));
|
||||||
out.writeByte((byte) (docsSuccess ? 1 : 0));
|
out.writeByte((byte) (spreadsheetsSuccess ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<SendRequest>
|
public static final Parcelable.Creator<SendRequest>
|
||||||
|
|||||||
+16
-18
@@ -67,7 +67,7 @@ public class UploadResultActivity extends FragmentActivity {
|
|||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sendRequest.isSendMaps() && sendRequest.isMapsSuccess()) {
|
if (sendRequest.isSendMaps() && sendRequest.isMapsSuccess()) {
|
||||||
shareUrl = SendMapsUtils.getMapUrl(track);
|
shareUrl = SendMapsUtils.getMapUrl(track);
|
||||||
if (sendRequest.getSharingAppPackageName() != null) {
|
if (sendRequest.getSharingAppPackageName() != null) {
|
||||||
@@ -80,9 +80,8 @@ public class UploadResultActivity extends FragmentActivity {
|
|||||||
}
|
}
|
||||||
if (shareUrl == null && sendRequest.isSendFusionTables()
|
if (shareUrl == null && sendRequest.isSendFusionTables()
|
||||||
&& sendRequest.isFusionTablesSuccess()) {
|
&& sendRequest.isFusionTablesSuccess()) {
|
||||||
boolean defaultTablePublic = PreferencesUtils.getBoolean(this,
|
boolean defaultTablePublic = PreferencesUtils.getBoolean(
|
||||||
R.string.default_table_public_key,
|
this, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
||||||
PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
|
|
||||||
if (defaultTablePublic) {
|
if (defaultTablePublic) {
|
||||||
shareUrl = SendFusionTablesUtils.getMapUrl(track);
|
shareUrl = SendFusionTablesUtils.getMapUrl(track);
|
||||||
}
|
}
|
||||||
@@ -101,13 +100,15 @@ public class UploadResultActivity extends FragmentActivity {
|
|||||||
LinearLayout mapsResult = (LinearLayout) view.findViewById(R.id.upload_result_maps_result);
|
LinearLayout mapsResult = (LinearLayout) view.findViewById(R.id.upload_result_maps_result);
|
||||||
LinearLayout fusionTablesResult = (LinearLayout) view.findViewById(
|
LinearLayout fusionTablesResult = (LinearLayout) view.findViewById(
|
||||||
R.id.upload_result_fusion_tables_result);
|
R.id.upload_result_fusion_tables_result);
|
||||||
LinearLayout docsResult = (LinearLayout) view.findViewById(R.id.upload_result_docs_result);
|
LinearLayout spreadsheetsResult = (LinearLayout) view.findViewById(
|
||||||
|
R.id.upload_result_spreadsheets_result);
|
||||||
|
|
||||||
ImageView driveResultIcon = (ImageView) view.findViewById(R.id.upload_result_drive_result_icon);
|
ImageView driveResultIcon = (ImageView) view.findViewById(R.id.upload_result_drive_result_icon);
|
||||||
ImageView mapsResultIcon = (ImageView) view.findViewById(R.id.upload_result_maps_result_icon);
|
ImageView mapsResultIcon = (ImageView) view.findViewById(R.id.upload_result_maps_result_icon);
|
||||||
ImageView fusionTablesResultIcon = (ImageView) view.findViewById(
|
ImageView fusionTablesResultIcon = (ImageView) view.findViewById(
|
||||||
R.id.upload_result_fusion_tables_result_icon);
|
R.id.upload_result_fusion_tables_result_icon);
|
||||||
ImageView docsResultIcon = (ImageView) view.findViewById(R.id.upload_result_docs_result_icon);
|
ImageView spreadsheetsResultIcon = (ImageView) view.findViewById(
|
||||||
|
R.id.upload_result_spreadsheets_result_icon);
|
||||||
|
|
||||||
TextView successFooter = (TextView) view.findViewById(R.id.upload_result_success_footer);
|
TextView successFooter = (TextView) view.findViewById(R.id.upload_result_success_footer);
|
||||||
TextView errorFooter = (TextView) view.findViewById(R.id.upload_result_error_footer);
|
TextView errorFooter = (TextView) view.findViewById(R.id.upload_result_error_footer);
|
||||||
@@ -122,7 +123,7 @@ public class UploadResultActivity extends FragmentActivity {
|
|||||||
hasError = true;
|
hasError = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sendRequest.isSendMaps()) {
|
if (!sendRequest.isSendMaps()) {
|
||||||
mapsResult.setVisibility(View.GONE);
|
mapsResult.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
@@ -143,12 +144,12 @@ public class UploadResultActivity extends FragmentActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sendRequest.isSendDocs()) {
|
if (!sendRequest.isSendSpreadsheets()) {
|
||||||
docsResult.setVisibility(View.GONE);
|
spreadsheetsResult.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
if (!sendRequest.isDocsSuccess()) {
|
if (!sendRequest.isSpreadsheetsSuccess()) {
|
||||||
docsResultIcon.setImageResource(R.drawable.failure);
|
spreadsheetsResultIcon.setImageResource(R.drawable.failure);
|
||||||
docsResultIcon.setContentDescription(getString(R.string.generic_error_title));
|
spreadsheetsResultIcon.setContentDescription(getString(R.string.generic_error_title));
|
||||||
hasError = true;
|
hasError = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,22 +160,19 @@ public class UploadResultActivity extends FragmentActivity {
|
|||||||
errorFooter.setVisibility(View.GONE);
|
errorFooter.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this)
|
AlertDialog.Builder builder = new AlertDialog.Builder(this).setCancelable(true)
|
||||||
.setCancelable(true)
|
|
||||||
.setIcon(hasError ? android.R.drawable.ic_dialog_alert : android.R.drawable.ic_dialog_info)
|
.setIcon(hasError ? android.R.drawable.ic_dialog_alert : android.R.drawable.ic_dialog_info)
|
||||||
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCancel(DialogInterface dialog) {
|
public void onCancel(DialogInterface dialog) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
})
|
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
||||||
.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
})
|
}).setTitle(hasError ? R.string.generic_error_title : R.string.generic_success_title)
|
||||||
.setTitle(hasError ? R.string.generic_error_title : R.string.generic_success_title)
|
|
||||||
.setView(view);
|
.setView(view);
|
||||||
|
|
||||||
// Add a Share URL button if shareUrl exists
|
// Add a Share URL button if shareUrl exists
|
||||||
|
|||||||
+7
-6
@@ -13,7 +13,8 @@
|
|||||||
* License for the specific language governing permissions and limitations under
|
* License for the specific language governing permissions and limitations under
|
||||||
* the License.
|
* the License.
|
||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.io.docs;
|
|
||||||
|
package com.google.android.apps.mytracks.io.spreadsheets;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendActivity;
|
||||||
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
import com.google.android.apps.mytracks.io.sendtogoogle.AbstractSendAsyncTask;
|
||||||
@@ -25,25 +26,25 @@ import com.google.android.maps.mytracks.R;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An activity to send a track to Google Docs.
|
* An activity to send a track to Google Spreadsheet.
|
||||||
*
|
*
|
||||||
* @author Jimmy Shih
|
* @author Jimmy Shih
|
||||||
*/
|
*/
|
||||||
public class SendDocsActivity extends AbstractSendActivity {
|
public class SendSpreadsheetsActivity extends AbstractSendActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AbstractSendAsyncTask createAsyncTask() {
|
protected AbstractSendAsyncTask createAsyncTask() {
|
||||||
return new SendDocsAsyncTask(this, sendRequest.getTrackId(), sendRequest.getAccount());
|
return new SendSpreadsheetsAsyncTask(this, sendRequest.getTrackId(), sendRequest.getAccount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getServiceName() {
|
protected String getServiceName() {
|
||||||
return getString(R.string.send_google_docs);
|
return getString(R.string.send_google_spreadsheets);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void startNextActivity(boolean success, boolean isCancel) {
|
protected void startNextActivity(boolean success, boolean isCancel) {
|
||||||
sendRequest.setDocsSuccess(success);
|
sendRequest.setSpreadsheetSuccess(success);
|
||||||
Intent intent = IntentUtils.newIntent(this, UploadResultActivity.class)
|
Intent intent = IntentUtils.newIntent(this, UploadResultActivity.class)
|
||||||
.putExtra(SendRequest.SEND_REQUEST_KEY, sendRequest);
|
.putExtra(SendRequest.SEND_REQUEST_KEY, sendRequest);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
+12
-12
@@ -14,7 +14,7 @@
|
|||||||
* the License.
|
* the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.android.apps.mytracks.io.docs;
|
package com.google.android.apps.mytracks.io.spreadsheets;
|
||||||
|
|
||||||
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;
|
||||||
@@ -55,13 +55,13 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AsyncTask to send a track to Google Docs.
|
* AsyncTask to send a track to Google Spreadsheet.
|
||||||
*
|
*
|
||||||
* @author Jimmy Shih
|
* @author Jimmy Shih
|
||||||
*/
|
*/
|
||||||
public class SendDocsAsyncTask extends AbstractSendAsyncTask {
|
public class SendSpreadsheetsAsyncTask extends AbstractSendAsyncTask {
|
||||||
|
|
||||||
private static final String TAG = SendDocsAsyncTask.class.getSimpleName();
|
private static final String TAG = SendSpreadsheetsAsyncTask.class.getSimpleName();
|
||||||
private static final String
|
private static final String
|
||||||
GOOGLE_SPREADSHEET_MIME_TYPE = "application/vnd.google-apps.spreadsheet";
|
GOOGLE_SPREADSHEET_MIME_TYPE = "application/vnd.google-apps.spreadsheet";
|
||||||
private static final String
|
private static final String
|
||||||
@@ -82,7 +82,7 @@ public class SendDocsAsyncTask extends AbstractSendAsyncTask {
|
|||||||
private final Context context;
|
private final Context context;
|
||||||
private final MyTracksProviderUtils myTracksProviderUtils;
|
private final MyTracksProviderUtils myTracksProviderUtils;
|
||||||
|
|
||||||
public SendDocsAsyncTask(SendDocsActivity activity, long trackId, Account account) {
|
public SendSpreadsheetsAsyncTask(SendSpreadsheetsActivity activity, long trackId, Account account) {
|
||||||
super(activity);
|
super(activity);
|
||||||
this.trackId = trackId;
|
this.trackId = trackId;
|
||||||
this.account = account;
|
this.account = account;
|
||||||
@@ -262,21 +262,21 @@ public class SendDocsAsyncTask extends AbstractSendAsyncTask {
|
|||||||
row.getCustomElements().setValueLocal(
|
row.getCustomElements().setValueLocal(
|
||||||
"movingtime", StringUtils.formatElapsedTimeWithHour(tripStatistics.getMovingTime()));
|
"movingtime", StringUtils.formatElapsedTimeWithHour(tripStatistics.getMovingTime()));
|
||||||
row.getCustomElements().setValueLocal(
|
row.getCustomElements().setValueLocal(
|
||||||
"distance", SendDocsUtils.getDistance(tripStatistics.getTotalDistance(), metricUnits));
|
"distance", SendSpreadsheetsUtils.getDistance(tripStatistics.getTotalDistance(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal("distanceunit", distanceUnit);
|
row.getCustomElements().setValueLocal("distanceunit", distanceUnit);
|
||||||
row.getCustomElements().setValueLocal(
|
row.getCustomElements().setValueLocal(
|
||||||
"averagespeed", SendDocsUtils.getSpeed(tripStatistics.getAverageSpeed(), metricUnits));
|
"averagespeed", SendSpreadsheetsUtils.getSpeed(tripStatistics.getAverageSpeed(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal("averagemovingspeed",
|
row.getCustomElements().setValueLocal("averagemovingspeed",
|
||||||
SendDocsUtils.getSpeed(tripStatistics.getAverageMovingSpeed(), metricUnits));
|
SendSpreadsheetsUtils.getSpeed(tripStatistics.getAverageMovingSpeed(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal(
|
row.getCustomElements().setValueLocal(
|
||||||
"maxspeed", SendDocsUtils.getSpeed(tripStatistics.getMaxSpeed(), metricUnits));
|
"maxspeed", SendSpreadsheetsUtils.getSpeed(tripStatistics.getMaxSpeed(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal("speedunit", speedUnit);
|
row.getCustomElements().setValueLocal("speedunit", speedUnit);
|
||||||
row.getCustomElements().setValueLocal("elevationgain",
|
row.getCustomElements().setValueLocal("elevationgain",
|
||||||
SendDocsUtils.getElevation(tripStatistics.getTotalElevationGain(), metricUnits));
|
SendSpreadsheetsUtils.getElevation(tripStatistics.getTotalElevationGain(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal(
|
row.getCustomElements().setValueLocal(
|
||||||
"minelevation", SendDocsUtils.getElevation(tripStatistics.getMinElevation(), metricUnits));
|
"minelevation", SendSpreadsheetsUtils.getElevation(tripStatistics.getMinElevation(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal(
|
row.getCustomElements().setValueLocal(
|
||||||
"maxelevation", SendDocsUtils.getElevation(tripStatistics.getMaxElevation(), metricUnits));
|
"maxelevation", SendSpreadsheetsUtils.getElevation(tripStatistics.getMaxElevation(), metricUnits));
|
||||||
row.getCustomElements().setValueLocal("elevationunit", elevationUnit);
|
row.getCustomElements().setValueLocal("elevationunit", elevationUnit);
|
||||||
|
|
||||||
String map = SendMapsUtils.getMapUrl(track);
|
String map = SendMapsUtils.getMapUrl(track);
|
||||||
+5
-5
@@ -14,7 +14,7 @@
|
|||||||
* the License.
|
* the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.google.android.apps.mytracks.io.docs;
|
package com.google.android.apps.mytracks.io.spreadsheets;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.util.UnitConversions;
|
import com.google.android.apps.mytracks.util.UnitConversions;
|
||||||
|
|
||||||
@@ -22,13 +22,13 @@ import java.text.NumberFormat;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utilities for sending a track to Google Docs.
|
* Utilities for sending a track to Google Spreadsheet.
|
||||||
*
|
*
|
||||||
* @author Jimmy Shih
|
* @author Jimmy Shih
|
||||||
*/
|
*/
|
||||||
public class SendDocsUtils {
|
public class SendSpreadsheetsUtils {
|
||||||
|
|
||||||
// Google Docs can only parse numbers in the English locale.
|
// Google Spreadsheet can only parse numbers in the English locale.
|
||||||
private static final NumberFormat NUMBER_FORMAT = NumberFormat.getNumberInstance(Locale.ENGLISH);
|
private static final NumberFormat NUMBER_FORMAT = NumberFormat.getNumberInstance(Locale.ENGLISH);
|
||||||
private static final NumberFormat INTEGER_FORMAT = NumberFormat.getIntegerInstance(
|
private static final NumberFormat INTEGER_FORMAT = NumberFormat.getIntegerInstance(
|
||||||
Locale.ENGLISH);
|
Locale.ENGLISH);
|
||||||
@@ -38,7 +38,7 @@ public class SendDocsUtils {
|
|||||||
NUMBER_FORMAT.setMinimumFractionDigits(2);
|
NUMBER_FORMAT.setMinimumFractionDigits(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private SendDocsUtils() {}
|
private SendSpreadsheetsUtils() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the distance. Performs unit conversion and formatting.
|
* Gets the distance. Performs unit conversion and formatting.
|
||||||
@@ -86,9 +86,9 @@ public class PreferencesUtils {
|
|||||||
public static final long SELECTED_TRACK_ID_DEFAULT = -1L;
|
public static final long SELECTED_TRACK_ID_DEFAULT = -1L;
|
||||||
|
|
||||||
public static final boolean SEND_TO_DRIVE_DEFAULT = false;
|
public static final boolean SEND_TO_DRIVE_DEFAULT = false;
|
||||||
public static final boolean SEND_TO_DOCS_DEFAULT = false;
|
|
||||||
public static final boolean SEND_TO_FUSION_TABLES_DEFAULT = false;
|
public static final boolean SEND_TO_FUSION_TABLES_DEFAULT = false;
|
||||||
public static final boolean SEND_TO_MAPS_DEFAULT = false;
|
public static final boolean SEND_TO_MAPS_DEFAULT = false;
|
||||||
|
public static final boolean SEND_TO_SPREADSHEETS_DEFAULT = false;
|
||||||
|
|
||||||
public static final String SENSOR_TYPE_DEFAULT = "NONE";
|
public static final String SENSOR_TYPE_DEFAULT = "NONE";
|
||||||
public static final int SPLIT_FREQUENCY_DEFAULT = 0;
|
public static final int SPLIT_FREQUENCY_DEFAULT = 0;
|
||||||
|
|||||||
@@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.io.docs;
|
|
||||||
|
|
||||||
import android.test.AndroidTestCase;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils}.
|
|
||||||
*
|
|
||||||
* @author Jimmy Shih
|
|
||||||
*/
|
|
||||||
public class SendDocsUtilsTest extends AndroidTestCase {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils#getDistance(double, boolean)} with metric units.
|
|
||||||
*/
|
|
||||||
public void testGetDistance_metric() {
|
|
||||||
assertEquals("1.22", SendDocsUtils.getDistance(1222.3, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils#getDistance(double, boolean)} with imperial
|
|
||||||
* units.
|
|
||||||
*/
|
|
||||||
public void testGetDistance_imperial() {
|
|
||||||
assertEquals("0.76", SendDocsUtils.getDistance(1222.3, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils#getSpeed(double, boolean)} with metric units.
|
|
||||||
*/
|
|
||||||
public void testGetSpeed_metric() {
|
|
||||||
assertEquals("15.55", SendDocsUtils.getSpeed(4.32, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils#getSpeed(double, boolean)} with imperial units.
|
|
||||||
*/
|
|
||||||
public void testGetSpeed_imperial() {
|
|
||||||
assertEquals("9.66", SendDocsUtils.getSpeed(4.32, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils#getElevation(double, boolean)} with metric
|
|
||||||
* units.
|
|
||||||
*/
|
|
||||||
public void testGetElevation_metric() {
|
|
||||||
assertEquals("3", SendDocsUtils.getElevation(3.456, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests {@link SendDocsUtils#getElevation(double, boolean)} with imperial
|
|
||||||
* units.
|
|
||||||
*/
|
|
||||||
public void testGetElevation_imperial() {
|
|
||||||
assertEquals("11", SendDocsUtils.getElevation(3.456, false));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+14
-14
@@ -15,9 +15,9 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.io.fusiontables;
|
package com.google.android.apps.mytracks.io.fusiontables;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
|
|
||||||
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.UploadResultActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
|
||||||
|
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
|
|
||||||
@@ -41,10 +41,10 @@ public class SendFusionTablesActivityTest extends AndroidTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendFusionTablesActivity#getNextClass(SendRequest, boolean)}. Sets
|
* {@link SendFusionTablesActivity#getNextClass(SendRequest, boolean)}. Sets
|
||||||
* the flags of "sendDocs" and "cancel" to false and false.
|
* the flags of "sendSpreadsheets" and "cancel" to false and false.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_notCancelNotSendDocs() {
|
public void testGetNextClass_notCancelNotSendSpreadsheets() {
|
||||||
sendRequest.setSendDocs(false);
|
sendRequest.setSendSpreadsheets(false);
|
||||||
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, false);
|
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, false);
|
||||||
assertEquals(UploadResultActivity.class, next);
|
assertEquals(UploadResultActivity.class, next);
|
||||||
}
|
}
|
||||||
@@ -52,21 +52,21 @@ public class SendFusionTablesActivityTest extends AndroidTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendFusionTablesActivity#getNextClass(SendRequest, boolean)}. Sets
|
* {@link SendFusionTablesActivity#getNextClass(SendRequest, boolean)}. Sets
|
||||||
* the flags of "sendDocs" and "cancel" to true and false.
|
* the flags of "sendSpreadsheets" and "cancel" to true and false.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_notCancelSendDocs() {
|
public void testGetNextClass_notCancelSendSpreadsheets() {
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, false);
|
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, false);
|
||||||
assertEquals(SendDocsActivity.class, next);
|
assertEquals(SendSpreadsheetsActivity.class, next);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendFusionTablesActivity#getNextClass(SendRequest,boolean)}. Sets
|
* {@link SendFusionTablesActivity#getNextClass(SendRequest,boolean)}. Sets
|
||||||
* the flags of "sendDocs" and "cancel" to true and true.
|
* the flags of "sendSpreadsheets" and "cancel" to true and true.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_cancelSendDocs() {
|
public void testGetNextClass_cancelSendSpreadsheets() {
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, true);
|
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, true);
|
||||||
assertEquals(UploadResultActivity.class, next);
|
assertEquals(UploadResultActivity.class, next);
|
||||||
}
|
}
|
||||||
@@ -74,10 +74,10 @@ public class SendFusionTablesActivityTest extends AndroidTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendFusionTablesActivity#getNextClass(SendRequest,boolean)}. Sets
|
* {@link SendFusionTablesActivity#getNextClass(SendRequest,boolean)}. Sets
|
||||||
* the flags of "sendDocs" and "cancel" to false and true.
|
* the flags of "sendSpreadsheets" and "cancel" to false and true.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_cancelNotSendDocs() {
|
public void testGetNextClass_cancelNotSendSpreadsheets() {
|
||||||
sendRequest.setSendDocs(false);
|
sendRequest.setSendSpreadsheets(false);
|
||||||
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, true);
|
Class<?> next = sendFusionTablesActivity.getNextClass(sendRequest, true);
|
||||||
assertEquals(UploadResultActivity.class, next);
|
assertEquals(UploadResultActivity.class, next);
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-12
@@ -15,10 +15,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.apps.mytracks.io.maps;
|
package com.google.android.apps.mytracks.io.maps;
|
||||||
|
|
||||||
import com.google.android.apps.mytracks.io.docs.SendDocsActivity;
|
|
||||||
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
import com.google.android.apps.mytracks.io.fusiontables.SendFusionTablesActivity;
|
||||||
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.UploadResultActivity;
|
import com.google.android.apps.mytracks.io.sendtogoogle.UploadResultActivity;
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
|
||||||
|
|
||||||
import android.test.AndroidTestCase;
|
import android.test.AndroidTestCase;
|
||||||
|
|
||||||
@@ -42,11 +42,11 @@ public class SendMapsActivityTest extends AndroidTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
||||||
* of "sendFusionTables","sendDocs" and "cancel" to true, true and false.
|
* of "sendFusionTables","sendSpreadsheets" and "cancel" to true, true and false.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_notCancelSendFusionTables() {
|
public void testGetNextClass_notCancelSendFusionTables() {
|
||||||
sendRequest.setSendFusionTables(true);
|
sendRequest.setSendFusionTables(true);
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
Class<?> next = sendMapsActivity.getNextClass(sendRequest, false);
|
Class<?> next = sendMapsActivity.getNextClass(sendRequest, false);
|
||||||
assertEquals(SendFusionTablesActivity.class, next);
|
assertEquals(SendFusionTablesActivity.class, next);
|
||||||
}
|
}
|
||||||
@@ -54,23 +54,23 @@ public class SendMapsActivityTest extends AndroidTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
||||||
* of "sendFusionTables","sendDocs" and "cancel" to false, true and false.
|
* of "sendFusionTables","sendSpreadsheets" and "cancel" to false, true and false.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_notCancelSendDocs() {
|
public void testGetNextClass_notCancelSendSpreadsheets() {
|
||||||
sendRequest.setSendFusionTables(false);
|
sendRequest.setSendFusionTables(false);
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
Class<?> next = sendMapsActivity.getNextClass(sendRequest, false);
|
Class<?> next = sendMapsActivity.getNextClass(sendRequest, false);
|
||||||
assertEquals(SendDocsActivity.class, next);
|
assertEquals(SendSpreadsheetsActivity.class, next);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
||||||
* of "sendFusionTables","sendDocs" and "cancel" to false, false and false.
|
* of "sendFusionTables","sendSpreadsheets" and "cancel" to false, false and false.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_notCancelNotSend() {
|
public void testGetNextClass_notCancelNotSend() {
|
||||||
sendRequest.setSendFusionTables(false);
|
sendRequest.setSendFusionTables(false);
|
||||||
sendRequest.setSendDocs(false);
|
sendRequest.setSendSpreadsheets(false);
|
||||||
Class<?> next = sendMapsActivity.getNextClass(sendRequest, false);
|
Class<?> next = sendMapsActivity.getNextClass(sendRequest, false);
|
||||||
assertEquals(UploadResultActivity.class, next);
|
assertEquals(UploadResultActivity.class, next);
|
||||||
}
|
}
|
||||||
@@ -78,11 +78,11 @@ public class SendMapsActivityTest extends AndroidTestCase {
|
|||||||
/**
|
/**
|
||||||
* Tests the method
|
* Tests the method
|
||||||
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
* {@link SendMapsActivity#getNextClass(SendRequest, boolean)}. Sets the flags
|
||||||
* of "sendFusionTables","sendDocs" and "cancel" to true, true and true.
|
* of "sendFusionTables","sendSpreadsheets" and "cancel" to true, true and true.
|
||||||
*/
|
*/
|
||||||
public void testGetNextClass_cancelSendDocs() {
|
public void testGetNextClass_cancelSendSpreadsheets() {
|
||||||
sendRequest.setSendFusionTables(true);
|
sendRequest.setSendFusionTables(true);
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
Class<?> next = sendMapsActivity.getNextClass(sendRequest, true);
|
Class<?> next = sendMapsActivity.getNextClass(sendRequest, true);
|
||||||
assertEquals(UploadResultActivity.class, next);
|
assertEquals(UploadResultActivity.class, next);
|
||||||
}
|
}
|
||||||
|
|||||||
+24
-24
@@ -59,13 +59,13 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the method {@link SendRequest#isSendDocs()}. The value should be set
|
* Tests the method {@link SendRequest#isSendSpreadsheets()}. The value should be set
|
||||||
* to false which is its default value when it is initialed in setup method.
|
* to false which is its default value when it is initialed in setup method.
|
||||||
*/
|
*/
|
||||||
public void testIsSendDocs() {
|
public void testIsSendSpreadsheets() {
|
||||||
assertEquals(false, sendRequest.isSendDocs());
|
assertEquals(false, sendRequest.isSendSpreadsheets());
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
assertEquals(true, sendRequest.isSendDocs());
|
assertEquals(true, sendRequest.isSendSpreadsheets());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -122,14 +122,14 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests the method {@link SendRequest#isDocsSuccess()}. The value should be
|
* Tests the method {@link SendRequest#isSpreadsheetsSuccess()}. The value should be
|
||||||
* set to false which is its default value when it is initialed in setup
|
* set to false which is its default value when it is initialed in setup
|
||||||
* method.
|
* method.
|
||||||
*/
|
*/
|
||||||
public void testIsDocsSuccess() {
|
public void testIsSpreadsheetsSuccess() {
|
||||||
assertEquals(false, sendRequest.isDocsSuccess());
|
assertEquals(false, sendRequest.isSpreadsheetsSuccess());
|
||||||
sendRequest.setDocsSuccess(true);
|
sendRequest.setSpreadsheetSuccess(true);
|
||||||
assertEquals(true, sendRequest.isDocsSuccess());
|
assertEquals(true, sendRequest.isSpreadsheetsSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -163,14 +163,14 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
assertTrue(sendRequest.isSendDrive());
|
assertTrue(sendRequest.isSendDrive());
|
||||||
assertTrue(sendRequest.isSendMaps());
|
assertTrue(sendRequest.isSendMaps());
|
||||||
assertTrue(sendRequest.isSendFusionTables());
|
assertTrue(sendRequest.isSendFusionTables());
|
||||||
assertTrue(sendRequest.isSendDocs());
|
assertTrue(sendRequest.isSendSpreadsheets());
|
||||||
assertTrue(sendRequest.isNewMap());
|
assertTrue(sendRequest.isNewMap());
|
||||||
assertEquals(account, sendRequest.getAccount());
|
assertEquals(account, sendRequest.getAccount());
|
||||||
assertEquals(MAPID, sendRequest.getMapId());
|
assertEquals(MAPID, sendRequest.getMapId());
|
||||||
assertTrue(sendRequest.isDriveSuccess());
|
assertTrue(sendRequest.isDriveSuccess());
|
||||||
assertTrue(sendRequest.isMapsSuccess());
|
assertTrue(sendRequest.isMapsSuccess());
|
||||||
assertTrue(sendRequest.isFusionTablesSuccess());
|
assertTrue(sendRequest.isFusionTablesSuccess());
|
||||||
assertTrue(sendRequest.isDocsSuccess());
|
assertTrue(sendRequest.isSpreadsheetsSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,14 +204,14 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
assertFalse(sendRequest.isSendDrive());
|
assertFalse(sendRequest.isSendDrive());
|
||||||
assertFalse(sendRequest.isSendMaps());
|
assertFalse(sendRequest.isSendMaps());
|
||||||
assertFalse(sendRequest.isSendFusionTables());
|
assertFalse(sendRequest.isSendFusionTables());
|
||||||
assertFalse(sendRequest.isSendDocs());
|
assertFalse(sendRequest.isSendSpreadsheets());
|
||||||
assertFalse(sendRequest.isNewMap());
|
assertFalse(sendRequest.isNewMap());
|
||||||
assertEquals(account, sendRequest.getAccount());
|
assertEquals(account, sendRequest.getAccount());
|
||||||
assertEquals(MAPID, sendRequest.getMapId());
|
assertEquals(MAPID, sendRequest.getMapId());
|
||||||
assertFalse(sendRequest.isDriveSuccess());
|
assertFalse(sendRequest.isDriveSuccess());
|
||||||
assertFalse(sendRequest.isMapsSuccess());
|
assertFalse(sendRequest.isMapsSuccess());
|
||||||
assertFalse(sendRequest.isFusionTablesSuccess());
|
assertFalse(sendRequest.isFusionTablesSuccess());
|
||||||
assertFalse(sendRequest.isDocsSuccess());
|
assertFalse(sendRequest.isSpreadsheetsSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -230,14 +230,14 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
boolean sendDrive = parcel.readByte() == 1;
|
boolean sendDrive = parcel.readByte() == 1;
|
||||||
boolean sendMaps = parcel.readByte() == 1;
|
boolean sendMaps = parcel.readByte() == 1;
|
||||||
boolean sendFusionTables = parcel.readByte() == 1;
|
boolean sendFusionTables = parcel.readByte() == 1;
|
||||||
boolean sendDocs = parcel.readByte() == 1;
|
boolean sendSpreadsheets = parcel.readByte() == 1;
|
||||||
boolean newMap = parcel.readByte() == 1;
|
boolean newMap = parcel.readByte() == 1;
|
||||||
Parcelable account = parcel.readParcelable(null);
|
Parcelable account = parcel.readParcelable(null);
|
||||||
String mapId = parcel.readString();
|
String mapId = parcel.readString();
|
||||||
boolean driveSuccess = parcel.readByte() == 1;
|
boolean driveSuccess = parcel.readByte() == 1;
|
||||||
boolean mapsSuccess = parcel.readByte() == 1;
|
boolean mapsSuccess = parcel.readByte() == 1;
|
||||||
boolean fusionTablesSuccess = parcel.readByte() == 1;
|
boolean fusionTablesSuccess = parcel.readByte() == 1;
|
||||||
boolean docsSuccess = parcel.readByte() == 1;
|
boolean spreadsheetsSuccess = parcel.readByte() == 1;
|
||||||
assertEquals(1, trackId);
|
assertEquals(1, trackId);
|
||||||
assertNull(sharingAppPackageName);
|
assertNull(sharingAppPackageName);
|
||||||
assertNull(sharingAppClassName);
|
assertNull(sharingAppClassName);
|
||||||
@@ -245,14 +245,14 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
assertFalse(sendDrive);
|
assertFalse(sendDrive);
|
||||||
assertFalse(sendMaps);
|
assertFalse(sendMaps);
|
||||||
assertFalse(sendFusionTables);
|
assertFalse(sendFusionTables);
|
||||||
assertFalse(sendDocs);
|
assertFalse(sendSpreadsheets);
|
||||||
assertFalse(newMap);
|
assertFalse(newMap);
|
||||||
assertNull(account);
|
assertNull(account);
|
||||||
assertNull(mapId);
|
assertNull(mapId);
|
||||||
assertFalse(driveSuccess);
|
assertFalse(driveSuccess);
|
||||||
assertFalse(mapsSuccess);
|
assertFalse(mapsSuccess);
|
||||||
assertFalse(fusionTablesSuccess);
|
assertFalse(fusionTablesSuccess);
|
||||||
assertFalse(docsSuccess);
|
assertFalse(spreadsheetsSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -266,7 +266,7 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
sendRequest.setSendDrive(true);
|
sendRequest.setSendDrive(true);
|
||||||
sendRequest.setSendMaps(true);
|
sendRequest.setSendMaps(true);
|
||||||
sendRequest.setSendFusionTables(true);
|
sendRequest.setSendFusionTables(true);
|
||||||
sendRequest.setSendDocs(true);
|
sendRequest.setSendSpreadsheets(true);
|
||||||
sendRequest.setNewMap(true);
|
sendRequest.setNewMap(true);
|
||||||
Account accountNew = new Account(ACCOUNTNAME + "2", ACCOUNTYPE + "2");
|
Account accountNew = new Account(ACCOUNTNAME + "2", ACCOUNTYPE + "2");
|
||||||
sendRequest.setAccount(accountNew);
|
sendRequest.setAccount(accountNew);
|
||||||
@@ -274,7 +274,7 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
sendRequest.setMapsSuccess(true);
|
sendRequest.setMapsSuccess(true);
|
||||||
sendRequest.setDriveSuccess(true);
|
sendRequest.setDriveSuccess(true);
|
||||||
sendRequest.setFusionTablesSuccess(true);
|
sendRequest.setFusionTablesSuccess(true);
|
||||||
sendRequest.setDocsSuccess(true);
|
sendRequest.setSpreadsheetSuccess(true);
|
||||||
Parcel parcel = Parcel.obtain();
|
Parcel parcel = Parcel.obtain();
|
||||||
parcel.setDataPosition(0);
|
parcel.setDataPosition(0);
|
||||||
sendRequest.writeToParcel(parcel, 1);
|
sendRequest.writeToParcel(parcel, 1);
|
||||||
@@ -286,14 +286,14 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
boolean sendDrive = parcel.readByte() == 1;
|
boolean sendDrive = parcel.readByte() == 1;
|
||||||
boolean sendMaps = parcel.readByte() == 1;
|
boolean sendMaps = parcel.readByte() == 1;
|
||||||
boolean sendFusionTables = parcel.readByte() == 1;
|
boolean sendFusionTables = parcel.readByte() == 1;
|
||||||
boolean sendDocs = parcel.readByte() == 1;
|
boolean sendSpreadsheets = parcel.readByte() == 1;
|
||||||
boolean newMap = parcel.readByte() == 1;
|
boolean newMap = parcel.readByte() == 1;
|
||||||
Parcelable account = parcel.readParcelable(null);
|
Parcelable account = parcel.readParcelable(null);
|
||||||
String mapId = parcel.readString();
|
String mapId = parcel.readString();
|
||||||
boolean driveSuccess = parcel.readByte() == 1;
|
boolean driveSuccess = parcel.readByte() == 1;
|
||||||
boolean mapsSuccess = parcel.readByte() == 1;
|
boolean mapsSuccess = parcel.readByte() == 1;
|
||||||
boolean fusionTablesSuccess = parcel.readByte() == 1;
|
boolean fusionTablesSuccess = parcel.readByte() == 1;
|
||||||
boolean docsSuccess = parcel.readByte() == 1;
|
boolean spreadsheetsSuccess = parcel.readByte() == 1;
|
||||||
assertEquals(4, trackId);
|
assertEquals(4, trackId);
|
||||||
assertEquals("package", sharingAppPackageName);
|
assertEquals("package", sharingAppPackageName);
|
||||||
assertEquals("class", sharingAppClassName);
|
assertEquals("class", sharingAppClassName);
|
||||||
@@ -301,13 +301,13 @@ public class SendRequestTest extends AndroidTestCase {
|
|||||||
assertTrue(sendDrive);
|
assertTrue(sendDrive);
|
||||||
assertTrue(sendMaps);
|
assertTrue(sendMaps);
|
||||||
assertTrue(sendFusionTables);
|
assertTrue(sendFusionTables);
|
||||||
assertTrue(sendDocs);
|
assertTrue(sendSpreadsheets);
|
||||||
assertTrue(newMap);
|
assertTrue(newMap);
|
||||||
assertEquals(accountNew, account);
|
assertEquals(accountNew, account);
|
||||||
assertEquals(MAPID, mapId);
|
assertEquals(MAPID, mapId);
|
||||||
assertTrue(driveSuccess);
|
assertTrue(driveSuccess);
|
||||||
assertTrue(mapsSuccess);
|
assertTrue(mapsSuccess);
|
||||||
assertTrue(fusionTablesSuccess);
|
assertTrue(fusionTablesSuccess);
|
||||||
assertTrue(docsSuccess);
|
assertTrue(spreadsheetsSuccess);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-18
@@ -38,10 +38,10 @@ public class UploadResultActivityTest extends
|
|||||||
private TextView successFooter;
|
private TextView successFooter;
|
||||||
private LinearLayout mapsResult;
|
private LinearLayout mapsResult;
|
||||||
private LinearLayout fusionTablesResult;
|
private LinearLayout fusionTablesResult;
|
||||||
private LinearLayout docsResult;
|
private LinearLayout spreadsheetsResult;
|
||||||
private ImageView mapsResultIcon;
|
private ImageView mapsResultIcon;
|
||||||
private ImageView fusionTablesResultIcon;
|
private ImageView fusionTablesResultIcon;
|
||||||
private ImageView docsResultIcon;
|
private ImageView spreadsheetsResultIcon;
|
||||||
|
|
||||||
private String successTitle;
|
private String successTitle;
|
||||||
private String errorTitle;
|
private String errorTitle;
|
||||||
@@ -64,11 +64,11 @@ public class UploadResultActivityTest extends
|
|||||||
|
|
||||||
assertEquals(View.VISIBLE, mapsResult.getVisibility());
|
assertEquals(View.VISIBLE, mapsResult.getVisibility());
|
||||||
assertEquals(View.VISIBLE, fusionTablesResult.getVisibility());
|
assertEquals(View.VISIBLE, fusionTablesResult.getVisibility());
|
||||||
assertEquals(View.VISIBLE, docsResult.getVisibility());
|
assertEquals(View.VISIBLE, spreadsheetsResult.getVisibility());
|
||||||
|
|
||||||
assertEquals(successTitle, mapsResultIcon.getContentDescription());
|
assertEquals(successTitle, mapsResultIcon.getContentDescription());
|
||||||
assertEquals(successTitle, fusionTablesResultIcon.getContentDescription());
|
assertEquals(successTitle, fusionTablesResultIcon.getContentDescription());
|
||||||
assertEquals(successTitle, docsResultIcon.getContentDescription());
|
assertEquals(successTitle, spreadsheetsResultIcon.getContentDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,19 +83,19 @@ public class UploadResultActivityTest extends
|
|||||||
|
|
||||||
assertEquals(View.VISIBLE, mapsResult.getVisibility());
|
assertEquals(View.VISIBLE, mapsResult.getVisibility());
|
||||||
assertEquals(View.VISIBLE, fusionTablesResult.getVisibility());
|
assertEquals(View.VISIBLE, fusionTablesResult.getVisibility());
|
||||||
assertEquals(View.VISIBLE, docsResult.getVisibility());
|
assertEquals(View.VISIBLE, spreadsheetsResult.getVisibility());
|
||||||
|
|
||||||
assertEquals(errorTitle, mapsResultIcon.getContentDescription());
|
assertEquals(errorTitle, mapsResultIcon.getContentDescription());
|
||||||
assertEquals(errorTitle, fusionTablesResultIcon.getContentDescription());
|
assertEquals(errorTitle, fusionTablesResultIcon.getContentDescription());
|
||||||
assertEquals(errorTitle, docsResultIcon.getContentDescription());
|
assertEquals(errorTitle, spreadsheetsResultIcon.getContentDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks the display of dialog when match following items:
|
* Checks the display of dialog when match following items:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Only send to Maps and Docs.</li>
|
* <li>Only send to Maps and Spreadsheets.</li>
|
||||||
* <li>Send to Maps successful.</li>
|
* <li>Send to Maps successful.</li>
|
||||||
* <li>Send to Docs failed.</li>
|
* <li>Send to Spreadsheets failed.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public void testPartialSuccess() {
|
public void testPartialSuccess() {
|
||||||
@@ -105,10 +105,10 @@ public class UploadResultActivityTest extends
|
|||||||
|
|
||||||
assertEquals(View.VISIBLE, mapsResult.getVisibility());
|
assertEquals(View.VISIBLE, mapsResult.getVisibility());
|
||||||
assertEquals(View.GONE, fusionTablesResult.getVisibility());
|
assertEquals(View.GONE, fusionTablesResult.getVisibility());
|
||||||
assertEquals(View.VISIBLE, docsResult.getVisibility());
|
assertEquals(View.VISIBLE, spreadsheetsResult.getVisibility());
|
||||||
|
|
||||||
assertEquals(successTitle, mapsResultIcon.getContentDescription());
|
assertEquals(successTitle, mapsResultIcon.getContentDescription());
|
||||||
assertEquals(errorTitle, docsResultIcon.getContentDescription());
|
assertEquals(errorTitle, spreadsheetsResultIcon.getContentDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -116,21 +116,21 @@ public class UploadResultActivityTest extends
|
|||||||
*
|
*
|
||||||
* @param isSendMaps
|
* @param isSendMaps
|
||||||
* @param isSendFusionTables
|
* @param isSendFusionTables
|
||||||
* @param isSendDocs
|
* @param isSendSpreadsheets
|
||||||
* @param isMapsSuccess
|
* @param isMapsSuccess
|
||||||
* @param isFusionTablesSuccess
|
* @param isFusionTablesSuccess
|
||||||
* @param isDocsSuccess
|
* @param isSpreadsheetSuccess
|
||||||
*/
|
*/
|
||||||
private void initialActivity(boolean isSendMaps, boolean isSendFusionTables, boolean isSendDocs,
|
private void initialActivity(boolean isSendMaps, boolean isSendFusionTables, boolean isSendSpreadsheets,
|
||||||
boolean isMapsSuccess, boolean isFusionTablesSuccess, boolean isDocsSuccess) {
|
boolean isMapsSuccess, boolean isFusionTablesSuccess, boolean isSpreadsheetSuccess) {
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
SendRequest sendRequest = new SendRequest(1L);
|
SendRequest sendRequest = new SendRequest(1L);
|
||||||
sendRequest.setSendMaps(isSendMaps);
|
sendRequest.setSendMaps(isSendMaps);
|
||||||
sendRequest.setSendFusionTables(isSendFusionTables);
|
sendRequest.setSendFusionTables(isSendFusionTables);
|
||||||
sendRequest.setSendDocs(isSendDocs);
|
sendRequest.setSendSpreadsheets(isSendSpreadsheets);
|
||||||
sendRequest.setMapsSuccess(isMapsSuccess);
|
sendRequest.setMapsSuccess(isMapsSuccess);
|
||||||
sendRequest.setFusionTablesSuccess(isFusionTablesSuccess);
|
sendRequest.setFusionTablesSuccess(isFusionTablesSuccess);
|
||||||
sendRequest.setDocsSuccess(isDocsSuccess);
|
sendRequest.setSpreadsheetSuccess(isSpreadsheetSuccess);
|
||||||
intent.putExtra(SendRequest.SEND_REQUEST_KEY, sendRequest);
|
intent.putExtra(SendRequest.SEND_REQUEST_KEY, sendRequest);
|
||||||
setActivityIntent(intent);
|
setActivityIntent(intent);
|
||||||
uploadResultActivity = this.getActivity();
|
uploadResultActivity = this.getActivity();
|
||||||
@@ -149,11 +149,11 @@ public class UploadResultActivityTest extends
|
|||||||
|
|
||||||
mapsResult = (LinearLayout) view.findViewById(R.id.upload_result_maps_result);
|
mapsResult = (LinearLayout) view.findViewById(R.id.upload_result_maps_result);
|
||||||
fusionTablesResult = (LinearLayout) view.findViewById(R.id.upload_result_fusion_tables_result);
|
fusionTablesResult = (LinearLayout) view.findViewById(R.id.upload_result_fusion_tables_result);
|
||||||
docsResult = (LinearLayout) view.findViewById(R.id.upload_result_docs_result);
|
spreadsheetsResult = (LinearLayout) view.findViewById(R.id.upload_result_spreadsheets_result);
|
||||||
|
|
||||||
mapsResultIcon = (ImageView) view.findViewById(R.id.upload_result_maps_result_icon);
|
mapsResultIcon = (ImageView) view.findViewById(R.id.upload_result_maps_result_icon);
|
||||||
fusionTablesResultIcon = (ImageView) view
|
fusionTablesResultIcon = (ImageView) view
|
||||||
.findViewById(R.id.upload_result_fusion_tables_result_icon);
|
.findViewById(R.id.upload_result_fusion_tables_result_icon);
|
||||||
docsResultIcon = (ImageView) view.findViewById(R.id.upload_result_docs_result_icon);
|
spreadsheetsResultIcon = (ImageView) view.findViewById(R.id.upload_result_spreadsheets_result_icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+74
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* 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.io.spreadsheets;
|
||||||
|
|
||||||
|
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsUtils;
|
||||||
|
|
||||||
|
import android.test.AndroidTestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils}.
|
||||||
|
*
|
||||||
|
* @author Jimmy Shih
|
||||||
|
*/
|
||||||
|
public class SendSpreadsheetsUtilsTest extends AndroidTestCase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils#getDistance(double, boolean)} with metric units.
|
||||||
|
*/
|
||||||
|
public void testGetDistance_metric() {
|
||||||
|
assertEquals("1.22", SendSpreadsheetsUtils.getDistance(1222.3, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils#getDistance(double, boolean)} with imperial
|
||||||
|
* units.
|
||||||
|
*/
|
||||||
|
public void testGetDistance_imperial() {
|
||||||
|
assertEquals("0.76", SendSpreadsheetsUtils.getDistance(1222.3, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils#getSpeed(double, boolean)} with metric units.
|
||||||
|
*/
|
||||||
|
public void testGetSpeed_metric() {
|
||||||
|
assertEquals("15.55", SendSpreadsheetsUtils.getSpeed(4.32, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils#getSpeed(double, boolean)} with imperial units.
|
||||||
|
*/
|
||||||
|
public void testGetSpeed_imperial() {
|
||||||
|
assertEquals("9.66", SendSpreadsheetsUtils.getSpeed(4.32, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils#getElevation(double, boolean)} with metric
|
||||||
|
* units.
|
||||||
|
*/
|
||||||
|
public void testGetElevation_metric() {
|
||||||
|
assertEquals("3", SendSpreadsheetsUtils.getElevation(3.456, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests {@link SendSpreadsheetsUtils#getElevation(double, boolean)} with imperial
|
||||||
|
* units.
|
||||||
|
*/
|
||||||
|
public void testGetElevation_imperial() {
|
||||||
|
assertEquals("11", SendSpreadsheetsUtils.getElevation(3.456, false));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user