Rename to Google Spreadsheets.

This commit is contained in:
Jimmy Shih
2013-02-12 17:38:26 -08:00
parent c93b487483
commit 4f8e8adc23
30 changed files with 277 additions and 272 deletions
@@ -43,7 +43,7 @@ public class HelpActivity extends AbstractMyTracksActivity {
TextView sendTrack = (TextView) findViewById(R.id.help_send_track_answer);
sendTrack.setText(StringUtils.getHtml(
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() {
public void onClick(View v) {
@@ -50,7 +50,8 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
private static final String KEY_SEND_REQUEST = "sendRequest";
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.putParcelable(KEY_SEND_REQUEST, sendRequest);
bundle.putBoolean(KEY_HIDE_DRIVE, hideDrive);
@@ -63,11 +64,11 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
private FragmentActivity activity;
private SendRequest sendRequest;
private boolean hideDrive;
private CheckBox driveCheckBox;
private CheckBox mapsCheckBox;
private CheckBox fusionTablesCheckBox;
private CheckBox docsCheckBox;
private CheckBox spreadsheetsCheckBox;
private TableRow mapsOptionTableRow;
private RadioButton existingMapRadioButton;
@@ -77,7 +78,7 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
activity = getActivity();
sendRequest = getArguments().getParcelable(KEY_SEND_REQUEST);
hideDrive = getArguments().getBoolean(KEY_HIDE_DRIVE);
View view = activity.getLayoutInflater().inflate(R.layout.choose_upload_service, null);
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);
mapsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_maps);
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(
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));
fusionTablesCheckBox.setChecked(PreferencesUtils.getBoolean(
activity, R.string.send_to_fusion_tables_key,
PreferencesUtils.SEND_TO_FUSION_TABLES_DEFAULT));
docsCheckBox.setChecked(PreferencesUtils.getBoolean(
activity, R.string.send_to_docs_key, PreferencesUtils.SEND_TO_DOCS_DEFAULT));
PreferencesUtils.SEND_TO_FUSION_TABLES_DEFAULT));
spreadsheetsCheckBox.setChecked(PreferencesUtils.getBoolean(
activity, R.string.send_to_spreadsheets_key,
PreferencesUtils.SEND_TO_SPREADSHEETS_DEFAULT));
mapsCheckBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton button, boolean checked) {
@@ -124,16 +126,15 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
} else {
newMapRadioButton.setChecked(true);
}
// Update fusion table
boolean defaultTablePublic = PreferencesUtils.getBoolean(activity,
R.string.default_table_public_key,
PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
boolean defaultTablePublic = PreferencesUtils.getBoolean(
activity, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
String text = getString(R.string.send_google_fusion_tables) + "\n"
+ getString(defaultTablePublic ? R.string.send_google_fusion_tables_public
: R.string.send_google_fusion_tables_private);
fusionTablesCheckBox.setText(text);
return new AlertDialog.Builder(activity).setNegativeButton(R.string.generic_cancel, null)
.setPositiveButton(R.string.send_google_send_now, new DialogInterface.OnClickListener() {
@Override
@@ -147,9 +148,9 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
PreferencesUtils.setBoolean(
activity, R.string.send_to_fusion_tables_key, fusionTablesCheckBox.isChecked());
PreferencesUtils.setBoolean(
activity, R.string.send_to_docs_key, docsCheckBox.isChecked());
if (sendDrive() || mapsCheckBox.isChecked()
|| fusionTablesCheckBox.isChecked() || docsCheckBox.isChecked()) {
activity, R.string.send_to_spreadsheets_key, spreadsheetsCheckBox.isChecked());
if (sendDrive() || mapsCheckBox.isChecked() || fusionTablesCheckBox.isChecked()
|| spreadsheetsCheckBox.isChecked()) {
startNextActivity();
} else {
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.setSendMaps(mapsCheckBox.isChecked());
sendRequest.setSendFusionTables(fusionTablesCheckBox.isChecked());
sendRequest.setSendDocs(docsCheckBox.isChecked());
sendRequest.setSendSpreadsheets(spreadsheetsCheckBox.isChecked());
sendRequest.setNewMap(!existingMapRadioButton.isChecked());
sendStats();
Intent intent = IntentUtils.newIntent(activity, AccountChooserActivity.class)
@@ -194,11 +195,11 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
if (sendRequest.isSendFusionTables()) {
AnalyticsUtils.sendPageViews(activity, "/send/fusion_tables");
}
if (sendRequest.isSendDocs()) {
AnalyticsUtils.sendPageViews(activity, "/send/docs");
if (sendRequest.isSendSpreadsheets()) {
AnalyticsUtils.sendPageViews(activity, "/send/spreadsheets");
}
}
/**
* True to send to Google Drive.
*/
@@ -16,7 +16,6 @@
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.maps.ChooseMapActivity;
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.SendRequest;
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.maps.mytracks.R;
@@ -65,8 +65,8 @@ public class SendDriveActivity extends AbstractSendActivity {
return sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
} else if (sendRequest.isSendFusionTables()) {
return SendFusionTablesActivity.class;
} else if (sendRequest.isSendDocs()) {
return SendDocsActivity.class;
} else if (sendRequest.isSendSpreadsheets()) {
return SendSpreadsheetsActivity.class;
} else {
return UploadResultActivity.class;
}
@@ -16,11 +16,11 @@
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.AbstractSendAsyncTask;
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.spreadsheets.SendSpreadsheetsActivity;
import com.google.android.apps.mytracks.util.IntentUtils;
import com.google.android.maps.mytracks.R;
import com.google.common.annotations.VisibleForTesting;
@@ -59,8 +59,8 @@ public class SendFusionTablesActivity extends AbstractSendActivity {
if (isCancel) {
return UploadResultActivity.class;
} else {
if (request.isSendDocs()) {
return SendDocsActivity.class;
if (request.isSendSpreadsheets()) {
return SendSpreadsheetsActivity.class;
} else {
return UploadResultActivity.class;
}
@@ -15,12 +15,12 @@
*/
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.sendtogoogle.AbstractSendActivity;
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.UploadResultActivity;
import com.google.android.apps.mytracks.io.spreadsheets.SendSpreadsheetsActivity;
import com.google.android.apps.mytracks.util.IntentUtils;
import com.google.android.maps.mytracks.R;
import com.google.common.annotations.VisibleForTesting;
@@ -62,8 +62,8 @@ public class SendMapsActivity extends AbstractSendActivity {
} else {
if (request.isSendFusionTables()) {
return SendFusionTablesActivity.class;
} else if (request.isSendDocs()) {
return SendDocsActivity.class;
} else if (request.isSendSpreadsheets()) {
return SendSpreadsheetsActivity.class;
} else {
return UploadResultActivity.class;
}
@@ -17,12 +17,12 @@
package com.google.android.apps.mytracks.io.sendtogoogle;
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.fusiontables.SendFusionTablesActivity;
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.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.PreferencesUtils;
import com.google.android.maps.mytracks.R;
@@ -185,7 +185,7 @@ public class AccountChooserActivity extends Activity {
needDrivePermission = defaultTablePublic && sendRequest.isSendFusionTables();
}
if (!needDrivePermission) {
needDrivePermission = sendRequest.isSendDocs();
needDrivePermission = sendRequest.isSendSpreadsheets();
}
if (needDrivePermission) {
@@ -214,7 +214,7 @@ public class AccountChooserActivity extends Activity {
* Checks the Spreadsheet permission.
*/
private void checkSpreadsheetPermission() {
if (sendRequest.isSendDocs()) {
if (sendRequest.isSendSpreadsheets()) {
SendToGoogleUtils.checkPermissionByActivity(this, sendRequest.getAccount().name,
SendToGoogleUtils.SPREADSHEET_SCOPE,
SendToGoogleUtils.SPREADSHEET_PERMISSION_REQUEST_CODE, spreadsheetsCallback);
@@ -312,15 +312,17 @@ public class AccountChooserActivity extends Activity {
/**
* Starts the next activity. If
* <p>
* sendDrive -> {@link SendDriveActivity}
* <p>
* sendMaps and newMap -> {@link SendMapsActivity}
* <p>
* sendMaps and !newMap -> {@link ChooseMapActivity}
* <p>
* !sendMaps && sendFusionTables -> {@link SendFusionTablesActivity}
* <p>
* !sendMaps && !sendFusionTables && sendDocs -> {@link SendDocsActivity}
* !sendMaps && !sendFusionTables && sendSpreadsheets -> {@link SendSpreadsheetsActivity}
* <p>
* !sendMaps && !sendFusionTables && !sendDocs -> {@link UploadResultActivity}
* !sendMaps && !sendFusionTables && !sendSpreadsheets -> {@link UploadResultActivity}
*/
private void startNextActivity() {
Class<?> next;
@@ -330,8 +332,8 @@ public class AccountChooserActivity extends Activity {
next = sendRequest.isNewMap() ? SendMapsActivity.class : ChooseMapActivity.class;
} else if (sendRequest.isSendFusionTables()) {
next = SendFusionTablesActivity.class;
} else if (sendRequest.isSendDocs()) {
next = SendDocsActivity.class;
} else if (sendRequest.isSendSpreadsheets()) {
next = SendSpreadsheetsActivity.class;
} else {
next = UploadResultActivity.class;
}
@@ -22,7 +22,7 @@ import android.os.Parcelable;
/**
* Send request states for sending a track to Google Maps, Google Fusion Tables,
* and Google Docs.
* and Google Spreadsheets.
*
* @author Jimmy Shih
*/
@@ -37,13 +37,13 @@ public class SendRequest implements Parcelable {
private boolean sendDrive = false;
private boolean sendMaps = false;
private boolean sendFusionTables = false;
private boolean sendDocs = false;
private boolean sendSpreadsheets = false;
private boolean newMap = false;
private Account account = null;
private String mapId = null;
private boolean driveSuccess = false;
private boolean mapsSuccess = false;
private boolean docsSuccess = false;
private boolean spreadsheetsSuccess = 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() {
return sendDocs;
public boolean isSendSpreadsheets() {
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
* option
* @param sendSpreadsheets true if the user has selected the send to Google
* Spreadsheets option
*/
public void setSendDocs(boolean sendDocs) {
this.sendDocs = sendDocs;
public void setSendSpreadsheets(boolean sendSpreadsheets) {
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() {
return docsSuccess;
public boolean isSpreadsheetsSuccess() {
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) {
this.docsSuccess = docsSuccess;
public void setSpreadsheetSuccess(boolean spreadsheetsSuccess) {
this.spreadsheetsSuccess = spreadsheetsSuccess;
}
private SendRequest(Parcel in) {
@@ -300,14 +301,14 @@ public class SendRequest implements Parcelable {
sendDrive = in.readByte() == 1;
sendMaps = in.readByte() == 1;
sendFusionTables = in.readByte() == 1;
sendDocs = in.readByte() == 1;
sendSpreadsheets = in.readByte() == 1;
newMap = in.readByte() == 1;
account = in.readParcelable(null);
mapId = in.readString();
driveSuccess = in.readByte() == 1;
mapsSuccess = in.readByte() == 1;
fusionTablesSuccess = in.readByte() == 1;
docsSuccess = in.readByte() == 1;
spreadsheetsSuccess = in.readByte() == 1;
}
@Override
@@ -324,14 +325,14 @@ public class SendRequest implements Parcelable {
out.writeByte((byte) (sendDrive ? 1 : 0));
out.writeByte((byte) (sendMaps ? 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.writeParcelable(account, 0);
out.writeString(mapId);
out.writeByte((byte) (driveSuccess ? 1 : 0));
out.writeByte((byte) (mapsSuccess ? 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>
@@ -67,7 +67,7 @@ public class UploadResultActivity extends FragmentActivity {
finish();
return;
}
if (sendRequest.isSendMaps() && sendRequest.isMapsSuccess()) {
shareUrl = SendMapsUtils.getMapUrl(track);
if (sendRequest.getSharingAppPackageName() != null) {
@@ -80,9 +80,8 @@ public class UploadResultActivity extends FragmentActivity {
}
if (shareUrl == null && sendRequest.isSendFusionTables()
&& sendRequest.isFusionTablesSuccess()) {
boolean defaultTablePublic = PreferencesUtils.getBoolean(this,
R.string.default_table_public_key,
PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
boolean defaultTablePublic = PreferencesUtils.getBoolean(
this, R.string.default_table_public_key, PreferencesUtils.DEFAULT_TABLE_PUBLIC_DEFAULT);
if (defaultTablePublic) {
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 fusionTablesResult = (LinearLayout) view.findViewById(
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 mapsResultIcon = (ImageView) view.findViewById(R.id.upload_result_maps_result_icon);
ImageView fusionTablesResultIcon = (ImageView) view.findViewById(
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 errorFooter = (TextView) view.findViewById(R.id.upload_result_error_footer);
@@ -122,7 +123,7 @@ public class UploadResultActivity extends FragmentActivity {
hasError = true;
}
}
if (!sendRequest.isSendMaps()) {
mapsResult.setVisibility(View.GONE);
} else {
@@ -143,12 +144,12 @@ public class UploadResultActivity extends FragmentActivity {
}
}
if (!sendRequest.isSendDocs()) {
docsResult.setVisibility(View.GONE);
if (!sendRequest.isSendSpreadsheets()) {
spreadsheetsResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isDocsSuccess()) {
docsResultIcon.setImageResource(R.drawable.failure);
docsResultIcon.setContentDescription(getString(R.string.generic_error_title));
if (!sendRequest.isSpreadsheetsSuccess()) {
spreadsheetsResultIcon.setImageResource(R.drawable.failure);
spreadsheetsResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
@@ -159,22 +160,19 @@ public class UploadResultActivity extends FragmentActivity {
errorFooter.setVisibility(View.GONE);
}
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setCancelable(true)
AlertDialog.Builder builder = new AlertDialog.Builder(this).setCancelable(true)
.setIcon(hasError ? android.R.drawable.ic_dialog_alert : android.R.drawable.ic_dialog_info)
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
finish();
}
})
.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
}).setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
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);
// Add a Share URL button if shareUrl exists
@@ -13,7 +13,8 @@
* License for the specific language governing permissions and limitations under
* 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.AbstractSendAsyncTask;
@@ -25,25 +26,25 @@ import com.google.android.maps.mytracks.R;
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
*/
public class SendDocsActivity extends AbstractSendActivity {
public class SendSpreadsheetsActivity extends AbstractSendActivity {
@Override
protected AbstractSendAsyncTask createAsyncTask() {
return new SendDocsAsyncTask(this, sendRequest.getTrackId(), sendRequest.getAccount());
return new SendSpreadsheetsAsyncTask(this, sendRequest.getTrackId(), sendRequest.getAccount());
}
@Override
protected String getServiceName() {
return getString(R.string.send_google_docs);
return getString(R.string.send_google_spreadsheets);
}
@Override
protected void startNextActivity(boolean success, boolean isCancel) {
sendRequest.setDocsSuccess(success);
sendRequest.setSpreadsheetSuccess(success);
Intent intent = IntentUtils.newIntent(this, UploadResultActivity.class)
.putExtra(SendRequest.SEND_REQUEST_KEY, sendRequest);
startActivity(intent);
@@ -14,7 +14,7 @@
* 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.Track;
@@ -55,13 +55,13 @@ import java.util.List;
import java.util.Locale;
/**
* AsyncTask to send a track to Google Docs.
* AsyncTask to send a track to Google Spreadsheet.
*
* @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
GOOGLE_SPREADSHEET_MIME_TYPE = "application/vnd.google-apps.spreadsheet";
private static final String
@@ -82,7 +82,7 @@ public class SendDocsAsyncTask extends AbstractSendAsyncTask {
private final Context context;
private final MyTracksProviderUtils myTracksProviderUtils;
public SendDocsAsyncTask(SendDocsActivity activity, long trackId, Account account) {
public SendSpreadsheetsAsyncTask(SendSpreadsheetsActivity activity, long trackId, Account account) {
super(activity);
this.trackId = trackId;
this.account = account;
@@ -262,21 +262,21 @@ public class SendDocsAsyncTask extends AbstractSendAsyncTask {
row.getCustomElements().setValueLocal(
"movingtime", StringUtils.formatElapsedTimeWithHour(tripStatistics.getMovingTime()));
row.getCustomElements().setValueLocal(
"distance", SendDocsUtils.getDistance(tripStatistics.getTotalDistance(), metricUnits));
"distance", SendSpreadsheetsUtils.getDistance(tripStatistics.getTotalDistance(), metricUnits));
row.getCustomElements().setValueLocal("distanceunit", distanceUnit);
row.getCustomElements().setValueLocal(
"averagespeed", SendDocsUtils.getSpeed(tripStatistics.getAverageSpeed(), metricUnits));
"averagespeed", SendSpreadsheetsUtils.getSpeed(tripStatistics.getAverageSpeed(), metricUnits));
row.getCustomElements().setValueLocal("averagemovingspeed",
SendDocsUtils.getSpeed(tripStatistics.getAverageMovingSpeed(), metricUnits));
SendSpreadsheetsUtils.getSpeed(tripStatistics.getAverageMovingSpeed(), metricUnits));
row.getCustomElements().setValueLocal(
"maxspeed", SendDocsUtils.getSpeed(tripStatistics.getMaxSpeed(), metricUnits));
"maxspeed", SendSpreadsheetsUtils.getSpeed(tripStatistics.getMaxSpeed(), metricUnits));
row.getCustomElements().setValueLocal("speedunit", speedUnit);
row.getCustomElements().setValueLocal("elevationgain",
SendDocsUtils.getElevation(tripStatistics.getTotalElevationGain(), metricUnits));
SendSpreadsheetsUtils.getElevation(tripStatistics.getTotalElevationGain(), metricUnits));
row.getCustomElements().setValueLocal(
"minelevation", SendDocsUtils.getElevation(tripStatistics.getMinElevation(), metricUnits));
"minelevation", SendSpreadsheetsUtils.getElevation(tripStatistics.getMinElevation(), metricUnits));
row.getCustomElements().setValueLocal(
"maxelevation", SendDocsUtils.getElevation(tripStatistics.getMaxElevation(), metricUnits));
"maxelevation", SendSpreadsheetsUtils.getElevation(tripStatistics.getMaxElevation(), metricUnits));
row.getCustomElements().setValueLocal("elevationunit", elevationUnit);
String map = SendMapsUtils.getMapUrl(track);
@@ -14,7 +14,7 @@
* 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;
@@ -22,13 +22,13 @@ import java.text.NumberFormat;
import java.util.Locale;
/**
* Utilities for sending a track to Google Docs.
* Utilities for sending a track to Google Spreadsheet.
*
* @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 INTEGER_FORMAT = NumberFormat.getIntegerInstance(
Locale.ENGLISH);
@@ -38,7 +38,7 @@ public class SendDocsUtils {
NUMBER_FORMAT.setMinimumFractionDigits(2);
}
private SendDocsUtils() {}
private SendSpreadsheetsUtils() {}
/**
* 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 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_MAPS_DEFAULT = false;
public static final boolean SEND_TO_SPREADSHEETS_DEFAULT = false;
public static final String SENSOR_TYPE_DEFAULT = "NONE";
public static final int SPLIT_FREQUENCY_DEFAULT = 0;