Remove confirmation dialog when sharing via Google Drive.

This commit is contained in:
Jimmy Shih
2013-06-21 17:58:15 -07:00
parent abd8f59a07
commit 85eba36d4c
10 changed files with 22 additions and 47 deletions
@@ -335,34 +335,26 @@ public abstract class AbstractSendToGoogleActivity extends AbstractMyTracksActiv
*
* @param trackId the track id
*/
protected void confirmShare(long trackId) {
ConfirmDialogFragment.newInstance(R.string.confirm_share_drive_key,
PreferencesUtils.CONFIRM_SHARE_DRIVE_DEFAULT,
getString(R.string.share_track_confirm_message), new long[] { trackId })
.show(getSupportFragmentManager(), ConfirmDialogFragment.CONFIRM_DIALOG_TAG);
protected void shareTrack(long trackId) {
AnalyticsUtils.sendPageViews(this, "/action/share_drive");
SendRequest newRequest;
newRequest = new SendRequest(trackId);
newRequest.setSendDrive(true);
newRequest.setDriveShare(true);
sendToGoogle(newRequest);
}
@Override
public void onConfirmDone(int confirmId, long[] trackIds) {
Intent intent;
SendRequest newRequest;
switch (confirmId) {
case R.string.confirm_play_earth_key:
AnalyticsUtils.sendPageViews(this, "/action/play");
intent = IntentUtils.newIntent(this, SaveActivity.class)
Intent intent = IntentUtils.newIntent(this, SaveActivity.class)
.putExtra(SaveActivity.EXTRA_TRACK_IDS, trackIds)
.putExtra(SaveActivity.EXTRA_TRACK_FILE_FORMAT, (Parcelable) TrackFileFormat.KML)
.putExtra(SaveActivity.EXTRA_PLAY_TRACK, true);
startActivity(intent);
break;
case R.string.confirm_share_drive_key:
AnalyticsUtils.sendPageViews(this, "/action/share_drive");
newRequest = new SendRequest(trackIds[0]);
newRequest.setSendDrive(true);
newRequest.setDriveShare(true);
sendToGoogle(newRequest);
break;
default:
}
}