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:
}
}
@@ -347,7 +347,7 @@ public class SearchListActivity extends AbstractSendToGoogleActivity
confirmPlay(new long[] {trackId});
return true;
case R.id.list_context_menu_share:
confirmShare(trackId);
shareTrack(trackId);
return true;
case R.id.list_context_menu_show_on_map:
intent = IntentUtils.newIntent(this, TrackDetailActivity.class)
@@ -340,7 +340,7 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
confirmPlay(new long[] {trackId});
return true;
case R.id.track_detail_share:
confirmShare(trackId);
shareTrack(trackId);
return true;
case R.id.track_detail_markers:
intent = IntentUtils.newIntent(this, MarkerListActivity.class)
@@ -770,7 +770,7 @@ public class TrackListActivity extends AbstractSendToGoogleActivity
confirmPlay(trackIds);
return true;
case R.id.list_context_menu_share:
confirmShare(trackIds[0]);
shareTrack(trackIds[0]);
return true;
case R.id.list_context_menu_edit:
Intent intent = IntentUtils.newIntent(this, TrackEditActivity.class)
@@ -52,7 +52,6 @@ public class PreferenceBackupHelper {
doNotBackup.add(context.getString(R.string.auto_resume_track_current_retry_key));
doNotBackup.add(context.getString(R.string.bluetooth_sensor_key));
doNotBackup.add(context.getString(R.string.confirm_play_earth_key));
doNotBackup.add(context.getString(R.string.confirm_share_drive_key));
doNotBackup.add(context.getString(R.string.drive_deleted_list_key));
doNotBackup.add(context.getString(R.string.drive_largest_change_id_key));
doNotBackup.add(context.getString(R.string.drive_sync_key));
@@ -58,7 +58,6 @@ public class PreferencesUtils {
public static final boolean CHART_SHOW_SPEED_DEFAULT = true;
public static final boolean CONFIRM_PLAY_EARTH_DEFAULT = true;
public static final boolean CONFIRM_SHARE_DRIVE_DEFAULT = true;
public static final String DEFAULT_ACTIVITY_DEFAULT = "";