forked from upstream-mirrors/OpenTracks
Remove Google Drive item from Send to Google dialog.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -21,16 +21,6 @@ limitations under the License.
|
||||
android:layout_width="match_parent"
|
||||
android:padding="8dp"
|
||||
android:stretchColumns="1" >
|
||||
<TableRow android:id="@+id/choose_upload_service_drive_options">
|
||||
<ImageView
|
||||
android:contentDescription="@string/send_google_drive"
|
||||
android:src="@drawable/google_drive_icon"
|
||||
style="@style/ChooseUploadServiceImageView" />
|
||||
<CheckBox
|
||||
android:id="@+id/choose_upload_service_drive"
|
||||
android:text="@string/send_google_drive"
|
||||
style="@style/ChooseUploadServiceCheckBox" />
|
||||
</TableRow>
|
||||
<TableRow>
|
||||
<ImageView
|
||||
android:contentDescription="@string/send_google_maps"
|
||||
|
||||
@@ -35,7 +35,6 @@ limitations under the License.
|
||||
<string name="min_required_accuracy_key">minRequiredAccuracy</string>
|
||||
<string name="pick_existing_map_key">pickExistingMap</string>
|
||||
<string name="report_speed_key">reportSpeed</string>
|
||||
<string name="send_to_drive_key">sendToDrive</string>
|
||||
<string name="send_to_fusion_tables_key">sendToFusionTables</string>
|
||||
<string name="send_to_maps_key">sendToMaps</string>
|
||||
<string name="send_to_spreadsheets_key">sendToSpreadsheets</string>
|
||||
|
||||
@@ -362,10 +362,7 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
return true;
|
||||
case R.id.track_detail_send_google:
|
||||
AnalyticsUtils.sendPageViews(this, "/action/send_google");
|
||||
Track track = myTracksProviderUtils.getTrack(trackId);
|
||||
boolean sharedWithMe = track != null ? track.isSharedWithMe() : true;
|
||||
ChooseUploadServiceDialogFragment.newInstance(sharedWithMe).show(
|
||||
getSupportFragmentManager(),
|
||||
new ChooseUploadServiceDialogFragment().show(getSupportFragmentManager(),
|
||||
ChooseUploadServiceDialogFragment.CHOOSE_UPLOAD_SERVICE_DIALOG_TAG);
|
||||
return true;
|
||||
case R.id.track_detail_save:
|
||||
@@ -415,17 +412,13 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChooseUploadServiceDone(boolean sendDrive, boolean sendMaps,
|
||||
boolean sendFusionTables, boolean sendSpreadsheets, boolean mapsExistingMap) {
|
||||
public void onChooseUploadServiceDone(boolean sendMaps, boolean sendFusionTables,
|
||||
boolean sendSpreadsheets, boolean mapsExistingMap) {
|
||||
SendRequest sendRequest = new SendRequest(trackId);
|
||||
sendRequest.setSendDrive(sendDrive);
|
||||
sendRequest.setSendMaps(sendMaps);
|
||||
sendRequest.setSendFusionTables(sendFusionTables);
|
||||
sendRequest.setSendSpreadsheets(sendSpreadsheets);
|
||||
sendRequest.setMapsExistingMap(mapsExistingMap);
|
||||
if (sendDrive) {
|
||||
AnalyticsUtils.sendPageViews(this, "/send/drive");
|
||||
}
|
||||
if (sendMaps) {
|
||||
AnalyticsUtils.sendPageViews(this, "/send/maps");
|
||||
}
|
||||
|
||||
+4
-33
@@ -51,28 +51,15 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
||||
/**
|
||||
* Called when choose upload service is done.
|
||||
*/
|
||||
public void onChooseUploadServiceDone(boolean sendDrive, boolean sendMaps,
|
||||
boolean sendFusionTables, boolean sendSpreadsheets, boolean mapsExistingMap);
|
||||
public void onChooseUploadServiceDone(boolean sendMaps, boolean sendFusionTables,
|
||||
boolean sendSpreadsheets, boolean mapsExistingMap);
|
||||
}
|
||||
|
||||
public static final String CHOOSE_UPLOAD_SERVICE_DIALOG_TAG = "chooseUploadService";
|
||||
|
||||
private static final String KEY_HIDE_DRIVE = "hideDrive";
|
||||
|
||||
public static ChooseUploadServiceDialogFragment newInstance(boolean hideDrive) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(KEY_HIDE_DRIVE, hideDrive);
|
||||
|
||||
ChooseUploadServiceDialogFragment chooseUploadServiceDialogFragment = new ChooseUploadServiceDialogFragment();
|
||||
chooseUploadServiceDialogFragment.setArguments(bundle);
|
||||
return chooseUploadServiceDialogFragment;
|
||||
}
|
||||
|
||||
private ChooseUploadServiceCaller caller;
|
||||
private FragmentActivity fragmentActivity;
|
||||
private boolean hideDrive;
|
||||
|
||||
private CheckBox driveCheckBox;
|
||||
private CheckBox mapsCheckBox;
|
||||
private CheckBox fusionTablesCheckBox;
|
||||
private CheckBox spreadsheetsCheckBox;
|
||||
@@ -94,20 +81,13 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
fragmentActivity = getActivity();
|
||||
hideDrive = getArguments().getBoolean(KEY_HIDE_DRIVE);
|
||||
|
||||
View view = fragmentActivity.getLayoutInflater().inflate(R.layout.choose_upload_service, null);
|
||||
|
||||
view.findViewById(R.id.choose_upload_service_drive_options)
|
||||
.setVisibility(hideDrive ? View.GONE : View.VISIBLE);
|
||||
|
||||
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);
|
||||
spreadsheetsCheckBox = (CheckBox) view.findViewById(R.id.choose_upload_service_spreadsheets);
|
||||
|
||||
driveCheckBox.setChecked(PreferencesUtils.getBoolean(
|
||||
fragmentActivity, R.string.send_to_drive_key, PreferencesUtils.SEND_TO_DRIVE_DEFAULT));
|
||||
mapsCheckBox.setChecked(PreferencesUtils.getBoolean(
|
||||
fragmentActivity, R.string.send_to_maps_key, PreferencesUtils.SEND_TO_MAPS_DEFAULT));
|
||||
fusionTablesCheckBox.setChecked(PreferencesUtils.getBoolean(
|
||||
@@ -156,8 +136,6 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
||||
.setPositiveButton(R.string.send_google_send_now, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
PreferencesUtils.setBoolean(
|
||||
fragmentActivity, R.string.send_to_drive_key, driveCheckBox.isChecked());
|
||||
PreferencesUtils.setBoolean(
|
||||
fragmentActivity, R.string.pick_existing_map_key, existingMapRadioButton.isChecked());
|
||||
PreferencesUtils.setBoolean(
|
||||
@@ -166,9 +144,9 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
||||
fragmentActivity, R.string.send_to_fusion_tables_key, fusionTablesCheckBox.isChecked());
|
||||
PreferencesUtils.setBoolean(
|
||||
fragmentActivity, R.string.send_to_spreadsheets_key, spreadsheetsCheckBox.isChecked());
|
||||
if (sendDrive() || mapsCheckBox.isChecked() || fusionTablesCheckBox.isChecked()
|
||||
if (mapsCheckBox.isChecked() || fusionTablesCheckBox.isChecked()
|
||||
|| spreadsheetsCheckBox.isChecked()) {
|
||||
caller.onChooseUploadServiceDone(sendDrive(), mapsCheckBox.isChecked(),
|
||||
caller.onChooseUploadServiceDone(mapsCheckBox.isChecked(),
|
||||
fusionTablesCheckBox.isChecked(), spreadsheetsCheckBox.isChecked(),
|
||||
existingMapRadioButton.isChecked());
|
||||
} else {
|
||||
@@ -185,11 +163,4 @@ public class ChooseUploadServiceDialogFragment extends DialogFragment {
|
||||
private void updateMapsOption() {
|
||||
mapsOptionTableRow.setVisibility(mapsCheckBox.isChecked() ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* True to send to Google Drive.
|
||||
*/
|
||||
private boolean sendDrive() {
|
||||
return !hideDrive && driveCheckBox.isChecked();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ public class PreferencesUtils {
|
||||
public static final boolean REPORT_SPEED_DEFAULT = true;
|
||||
public static final long SELECTED_TRACK_ID_DEFAULT = -1L;
|
||||
|
||||
public static final boolean SEND_TO_DRIVE_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;
|
||||
|
||||
Reference in New Issue
Block a user