forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -34,19 +34,10 @@ limitations under the License.
|
||||
<uses-permission android:name="com.dsi.ant.permission.ANT_ADMIN" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<!-- Permissions to upload tracks -->
|
||||
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
|
||||
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
|
||||
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH" />
|
||||
<uses-permission android:name="com.google.android.googleapps.permission.GOOGLE_AUTH.local" />
|
||||
<!-- Permission for Android sync provider -->
|
||||
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
|
||||
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
|
||||
<!-- Permission to access Google services to communicate with the map servers. -->
|
||||
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
|
||||
<!-- Permission to read phone state so voice announcement will not interrupt ongoing calls -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<!-- Permission to read/write external storage -->
|
||||
|
||||
+3
-6
@@ -91,15 +91,13 @@ public abstract class AbstractSendToGoogleActivity extends AbstractMyTracksActiv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemCheckedStateChanged(
|
||||
ActionMode mode, int position, long id, boolean checked) {
|
||||
public void onItemCheckedStateChanged(ActionMode mode, int position, long id, boolean checked) {
|
||||
mode.invalidate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
||||
if (contextualActionModeCallback.onClick(
|
||||
item.getItemId(), getCheckedPositions(listView), listView.getCheckedItemIds())) {
|
||||
if (contextualActionModeCallback.onClick(item.getItemId(), getCheckedPositions(listView), listView.getCheckedItemIds())) {
|
||||
mode.finish();
|
||||
}
|
||||
return true;
|
||||
@@ -128,8 +126,7 @@ public abstract class AbstractSendToGoogleActivity extends AbstractMyTracksActiv
|
||||
});
|
||||
}
|
||||
|
||||
public static void configureSearchWidget(
|
||||
Activity activity, final MenuItem menuItem, final TrackController trackController) {
|
||||
public static void configureSearchWidget(Activity activity, final MenuItem menuItem, final TrackController trackController) {
|
||||
SearchManager searchManager = (SearchManager) activity.getSystemService(Context.SEARCH_SERVICE);
|
||||
SearchView searchView = (SearchView) menuItem.getActionView();
|
||||
searchView.setSearchableInfo(searchManager.getSearchableInfo(activity.getComponentName()));
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* Copyright 2011 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;
|
||||
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Path;
|
||||
|
||||
/**
|
||||
* Represents a colored {@code Path} to save its relative color for drawing.
|
||||
* @author Vangelis S.
|
||||
*/
|
||||
public class ColoredPath {
|
||||
private final Path path;
|
||||
private final Paint pathPaint;
|
||||
|
||||
/**
|
||||
* Constructor for a ColoredPath by color.
|
||||
*/
|
||||
public ColoredPath(int color) {
|
||||
path = new Path();
|
||||
pathPaint = new Paint();
|
||||
pathPaint.setColor(color);
|
||||
pathPaint.setStrokeWidth(3);
|
||||
pathPaint.setStyle(Paint.Style.STROKE);
|
||||
pathPaint.setAntiAlias(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for a ColoredPath by Paint.
|
||||
*/
|
||||
public ColoredPath(Paint paint) {
|
||||
path = new Path();
|
||||
pathPaint = paint;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the path
|
||||
*/
|
||||
public Path getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the pathPaint
|
||||
*/
|
||||
public Paint getPathPaint() {
|
||||
return pathPaint;
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,6 @@ public class Constants {
|
||||
|
||||
private Constants() {}
|
||||
|
||||
/**
|
||||
* The google account type.
|
||||
*/
|
||||
public static final String ACCOUNT_TYPE = "com.google";
|
||||
|
||||
/**
|
||||
* Maximum number of waypoints that will be loaded at one time.
|
||||
*/
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.google.android.apps.mytracks.content.SearchEngineProvider;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.Waypoint;
|
||||
import com.google.android.apps.mytracks.content.Waypoint.WaypointType;
|
||||
import com.google.android.apps.mytracks.fragments.ConfirmDeleteDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.DeleteMarkerDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.DeleteMarkerDialogFragment.DeleteMarkerCaller;
|
||||
import com.google.android.apps.mytracks.services.MyTracksLocationManager;
|
||||
@@ -72,7 +73,7 @@ import java.util.SortedSet;
|
||||
*
|
||||
* @author Rodrigo Damazio
|
||||
*/
|
||||
public class SearchListActivity extends AbstractSendToGoogleActivity implements DeleteMarkerCaller {
|
||||
public class SearchListActivity extends AbstractSendToGoogleActivity implements DeleteMarkerCaller, ConfirmDeleteDialogFragment.ConfirmDeleteCaller {
|
||||
|
||||
private static final String TAG = SearchListActivity.class.getSimpleName();
|
||||
|
||||
|
||||
@@ -25,13 +25,9 @@ import com.google.android.apps.mytracks.content.WaypointCreationRequest;
|
||||
import com.google.android.apps.mytracks.fragments.ChartFragment;
|
||||
import com.google.android.apps.mytracks.fragments.ChooseActivityTypeDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.ChooseActivityTypeDialogFragment.ChooseActivityTypeCaller;
|
||||
import com.google.android.apps.mytracks.fragments.ExportDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.ExportDialogFragment.ExportCaller;
|
||||
import com.google.android.apps.mytracks.fragments.ExportDialogFragment.ExportType;
|
||||
import com.google.android.apps.mytracks.fragments.ConfirmDeleteDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.FrequencyDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.StatsFragment;
|
||||
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||
import com.google.android.apps.mytracks.io.file.exporter.SaveActivity;
|
||||
import com.google.android.apps.mytracks.services.TrackRecordingServiceConnection;
|
||||
import com.google.android.apps.mytracks.settings.SettingsActivity;
|
||||
import com.google.android.apps.mytracks.util.CalorieUtils;
|
||||
@@ -44,7 +40,6 @@ import com.google.android.apps.mytracks.util.TrackRecordingServiceConnectionUtil
|
||||
import com.google.android.apps.mytracks.util.TrackUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -52,7 +47,6 @@ import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.v4.app.TaskStackBuilder;
|
||||
import android.support.v4.view.ViewPager;
|
||||
@@ -76,7 +70,7 @@ import java.util.Date;
|
||||
* @author Rodrigo Damazio
|
||||
*/
|
||||
public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
implements ChooseActivityTypeCaller, ExportCaller {
|
||||
implements ChooseActivityTypeCaller, ConfirmDeleteDialogFragment.ConfirmDeleteCaller {
|
||||
|
||||
public static final String EXTRA_TRACK_ID = "track_id";
|
||||
public static final String EXTRA_MARKER_ID = "marker_id";
|
||||
@@ -111,7 +105,6 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
private MenuItem insertMarkerMenuItem;
|
||||
private MenuItem insertPhotoMenuItem;
|
||||
private MenuItem shareMenuItem;
|
||||
private MenuItem exportMenuItem;
|
||||
private MenuItem voiceFrequencyMenuItem;
|
||||
private MenuItem splitFrequencyMenuItem;
|
||||
private MenuItem sensorStateMenuItem;
|
||||
@@ -351,7 +344,6 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
shareMenuItem.setEnabled(!isSharedWithMe);
|
||||
shareMenuItem.setVisible(!isSharedWithMe);
|
||||
|
||||
exportMenuItem = menu.findItem(R.id.track_detail_export);
|
||||
voiceFrequencyMenuItem = menu.findItem(R.id.track_detail_voice_frequency);
|
||||
splitFrequencyMenuItem = menu.findItem(R.id.track_detail_split_frequency);
|
||||
sensorStateMenuItem = menu.findItem(R.id.track_detail_sensor_state);
|
||||
@@ -405,11 +397,6 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
PreferencesUtils.SPLIT_FREQUENCY_DEFAULT, R.string.menu_split_frequency)
|
||||
.show(getSupportFragmentManager(), FrequencyDialogFragment.FREQUENCY_DIALOG_TAG);
|
||||
return true;
|
||||
case R.id.track_detail_export:
|
||||
Track track = myTracksProviderUtils.getTrack(trackId);
|
||||
boolean hideDrive = track != null ? track.isSharedWithMe() : true;
|
||||
new ExportDialogFragment().show(getSupportFragmentManager(), ExportDialogFragment.EXPORT_DIALOG_TAG);
|
||||
return true;
|
||||
case R.id.track_detail_edit:
|
||||
intent = IntentUtils.newIntent(this, TrackEditActivity.class)
|
||||
.putExtra(TrackEditActivity.EXTRA_TRACK_ID, trackId);
|
||||
@@ -443,16 +430,6 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
return super.onTrackballEvent(event);
|
||||
}
|
||||
|
||||
public void onExportDone(
|
||||
ExportType exportType, TrackFileFormat trackFileFormat, Account account) {
|
||||
if (exportType == ExportType.EXTERNAL_STORAGE) {
|
||||
Intent intent = IntentUtils.newIntent(this, SaveActivity.class)
|
||||
.putExtra(SaveActivity.EXTRA_TRACK_IDS, new long[] { trackId })
|
||||
.putExtra(SaveActivity.EXTRA_TRACK_FILE_FORMAT, (Parcelable) trackFileFormat);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TrackRecordingServiceConnection getTrackRecordingServiceConnection() {
|
||||
return trackRecordingServiceConnection;
|
||||
@@ -538,9 +515,6 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
if (shareMenuItem != null && shareMenuItem.isEnabled()) {
|
||||
shareMenuItem.setVisible(!isRecording);
|
||||
}
|
||||
if (exportMenuItem != null) {
|
||||
exportMenuItem.setVisible(!isRecording);
|
||||
}
|
||||
if (voiceFrequencyMenuItem != null) {
|
||||
voiceFrequencyMenuItem.setVisible(isRecording);
|
||||
}
|
||||
@@ -579,9 +553,4 @@ public class TrackDetailActivity extends AbstractSendToGoogleActivity
|
||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExportDone(ExportType exportType, TrackFileFormat trackFileFormat) {
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ import android.widget.Toast;
|
||||
import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
|
||||
import com.google.android.apps.mytracks.content.Track;
|
||||
import com.google.android.apps.mytracks.content.TracksColumns;
|
||||
import com.google.android.apps.mytracks.fragments.ConfirmDeleteDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.FileTypeDialogFragment;
|
||||
import com.google.android.apps.mytracks.fragments.FileTypeDialogFragment.FileTypeCaller;
|
||||
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||
@@ -79,7 +80,7 @@ import java.util.Locale;
|
||||
*
|
||||
* @author Leif Hendrik Wilden
|
||||
*/
|
||||
public class TrackListActivity extends AbstractSendToGoogleActivity implements FileTypeCaller {
|
||||
public class TrackListActivity extends AbstractSendToGoogleActivity implements FileTypeCaller, ConfirmDeleteDialogFragment.ConfirmDeleteCaller {
|
||||
|
||||
private static final String TAG = TrackListActivity.class.getSimpleName();
|
||||
private static final String[] PROJECTION = new String[] { TracksColumns._ID, TracksColumns.NAME,
|
||||
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 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.fragments;
|
||||
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.DialogInterface.OnClickListener;
|
||||
|
||||
/**
|
||||
* A DialogFrament to prompt user to sync to Google Drive after saving first track.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public class EnableSyncDialogFragment extends AbstractMyTracksDialogFragment {
|
||||
|
||||
/**
|
||||
* Interface for caller of this dialog fragment.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public interface EnableSyncCaller {
|
||||
|
||||
/**
|
||||
* Called when enable sync is done.
|
||||
*/
|
||||
public void onEnableSyncDone(boolean enable);
|
||||
}
|
||||
|
||||
public static final String ENABLE_SYNC_DIALOG_TAG = "enableSyncDialog";
|
||||
|
||||
private EnableSyncCaller caller;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
try {
|
||||
caller = (EnableSyncCaller) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(
|
||||
activity.toString() + " must implement " + EnableSyncCaller.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog createDialog() {
|
||||
return new AlertDialog.Builder(getActivity()).setMessage(R.string.sync_drive_enable_message)
|
||||
.setNegativeButton(R.string.generic_no, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onEnableSyncDone(false);
|
||||
}
|
||||
}).setPositiveButton(R.string.generic_yes, new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
caller.onEnableSyncDone(true);
|
||||
}
|
||||
}).setTitle(R.string.sync_drive_enable_title).create();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel(DialogInterface arg0) {
|
||||
caller.onEnableSyncDone(false);
|
||||
}
|
||||
}
|
||||
-187
@@ -1,187 +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.fragments;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||
import com.google.android.apps.mytracks.util.FileUtils;
|
||||
import com.google.android.apps.mytracks.util.PreferencesUtils;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
import android.accounts.Account;
|
||||
import android.accounts.AccountManager;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* A DialogFragment to export a track.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public class ExportDialogFragment extends AbstractMyTracksDialogFragment {
|
||||
|
||||
/**
|
||||
* Export types.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public enum ExportType {
|
||||
EXTERNAL_STORAGE(R.string.export_external_storage);
|
||||
final int resId;
|
||||
|
||||
ExportType(int resId) {
|
||||
this.resId = resId;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Interface for caller of this dialog fragment.
|
||||
*
|
||||
* @author Jimmy Shih
|
||||
*/
|
||||
public interface ExportCaller {
|
||||
|
||||
/**
|
||||
* Called when export is done.
|
||||
*
|
||||
* @param exportType the export type
|
||||
* @param trackFileFormat the track file format
|
||||
*/
|
||||
public void onExportDone(
|
||||
ExportType exportType, TrackFileFormat trackFileFormat);
|
||||
}
|
||||
|
||||
public static final String EXPORT_DIALOG_TAG = "export";
|
||||
|
||||
private ExportCaller caller;
|
||||
|
||||
// UI elements
|
||||
private Spinner exportTypeOptions;
|
||||
private RadioGroup exportExternalStorageOptions;
|
||||
|
||||
@Override
|
||||
public void onAttach(Activity activity) {
|
||||
super.onAttach(activity);
|
||||
try {
|
||||
caller = (ExportCaller) activity;
|
||||
} catch (ClassCastException e) {
|
||||
throw new ClassCastException(
|
||||
activity.toString() + " must implement " + ExportCaller.class.getSimpleName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Dialog createDialog() {
|
||||
FragmentActivity fragmentActivity = getActivity();
|
||||
|
||||
// Get views
|
||||
View view = fragmentActivity.getLayoutInflater().inflate(R.layout.export, null);
|
||||
exportExternalStorageOptions = (RadioGroup) view.findViewById(
|
||||
R.id.export_external_storage_options);
|
||||
|
||||
// Setup exportExternalStorageOptions
|
||||
setExternalStorageOption(
|
||||
(RadioButton) view.findViewById(R.id.export_external_storage_kml), TrackFileFormat.KML);
|
||||
setExternalStorageOption(
|
||||
(RadioButton) view.findViewById(R.id.export_external_storage_gpx), TrackFileFormat.GPX);
|
||||
setExternalStorageOption(
|
||||
(RadioButton) view.findViewById(R.id.export_external_storage_csv), TrackFileFormat.CSV);
|
||||
setExternalStorageOption(
|
||||
(RadioButton) view.findViewById(R.id.export_external_storage_tcx), TrackFileFormat.TCX);
|
||||
TrackFileFormat trackFileFormat = TrackFileFormat.valueOf(PreferencesUtils.getString(
|
||||
fragmentActivity, R.string.export_external_storage_format_key,
|
||||
PreferencesUtils.EXPORT_EXTERNAL_STORAGE_FORMAT_DEFAULT));
|
||||
|
||||
exportExternalStorageOptions.check(getExternalStorageFormatId(trackFileFormat));
|
||||
|
||||
return new AlertDialog.Builder(fragmentActivity)
|
||||
.setNegativeButton(R.string.generic_cancel, null)
|
||||
.setPositiveButton(R.string.menu_export, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
FragmentActivity context = getActivity();
|
||||
TrackFileFormat format = null;
|
||||
|
||||
PreferencesUtils.setString(context, R.string.export_type_key, ExportType.EXTERNAL_STORAGE.name());
|
||||
|
||||
format = getTrackFileFormat(exportExternalStorageOptions.getCheckedRadioButtonId());
|
||||
PreferencesUtils.setString(context, R.string.export_external_storage_format_key, format.name());
|
||||
caller.onExportDone(ExportType.EXTERNAL_STORAGE, format);
|
||||
}
|
||||
})
|
||||
.setTitle(R.string.export_title).setView(view).create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets an external storage option.
|
||||
*
|
||||
* @param radioButton the radio button
|
||||
* @param trackFileFormat the track file format
|
||||
*/
|
||||
private void setExternalStorageOption(RadioButton radioButton, TrackFileFormat trackFileFormat) {
|
||||
radioButton.setText(getString(R.string.export_external_storage_option, trackFileFormat.name(),
|
||||
FileUtils.getPathDisplayName(trackFileFormat.getExtension())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the external storage format id from a track file format.
|
||||
*
|
||||
* @param trackFileFormat the track file format
|
||||
*/
|
||||
private int getExternalStorageFormatId(TrackFileFormat trackFileFormat) {
|
||||
switch (trackFileFormat) {
|
||||
case KML:
|
||||
return R.id.export_external_storage_kml;
|
||||
case GPX:
|
||||
return R.id.export_external_storage_gpx;
|
||||
case CSV:
|
||||
return R.id.export_external_storage_csv;
|
||||
default:
|
||||
return R.id.export_external_storage_tcx;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the track file format from an external storage format id.
|
||||
*
|
||||
* @param externalStorageFormatId the external storage format id
|
||||
*/
|
||||
private TrackFileFormat getTrackFileFormat(int externalStorageFormatId) {
|
||||
switch (externalStorageFormatId) {
|
||||
case R.id.export_external_storage_kml:
|
||||
return TrackFileFormat.KML;
|
||||
case R.id.export_external_storage_gpx:
|
||||
return TrackFileFormat.GPX;
|
||||
case R.id.export_external_storage_csv:
|
||||
return TrackFileFormat.CSV;
|
||||
default:
|
||||
return TrackFileFormat.TCX;
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-2
@@ -39,10 +39,9 @@ import java.util.UUID;
|
||||
*/
|
||||
public class BluetoothConnectionManager {
|
||||
|
||||
// My Tracks UUID
|
||||
public static final UUID MY_TRACKS_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
|
||||
|
||||
// Message types sent to hander
|
||||
// Message types sent to handler
|
||||
public static final int MESSAGE_DEVICE_NAME = 1;
|
||||
public static final int MESSAGE_READ = 2;
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@ import java.io.File;
|
||||
public class IntentUtils {
|
||||
|
||||
public static final String TEXT_PLAIN_TYPE = "text/plain";
|
||||
private static final String BLUETOOTH_PACKAGE_NAME = "com.android.bluetooth";
|
||||
private static final String TWITTER_PACKAGE_NAME = "com.twitter.android";
|
||||
|
||||
private IntentUtils() {}
|
||||
|
||||
@@ -54,33 +52,6 @@ public class IntentUtils {
|
||||
Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an intent to share a track url with an app.
|
||||
*
|
||||
* @param context the context
|
||||
* @param trackId the track id
|
||||
* @param trackUrl the track url
|
||||
* @param packageName the sharing app package name
|
||||
* @param className the sharing app class name
|
||||
*/
|
||||
public static final Intent newShareUrlIntent(
|
||||
Context context, long trackId, String trackUrl, String packageName, String className) {
|
||||
Track track = MyTracksProviderUtils.Factory.get(context).getTrack(trackId);
|
||||
String trackDescription = track == null ? ""
|
||||
: new DescriptionGeneratorImpl(context).generateTrackDescription(track, null, null, false);
|
||||
boolean urlOnly = TWITTER_PACKAGE_NAME.equals(packageName)
|
||||
|| BLUETOOTH_PACKAGE_NAME.equals(packageName);
|
||||
|
||||
return new Intent(Intent.ACTION_SEND)
|
||||
.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT | Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP)
|
||||
.putExtra(Intent.EXTRA_SUBJECT, context.getString(R.string.share_track_subject))
|
||||
.putExtra(Intent.EXTRA_TEXT, urlOnly
|
||||
? trackUrl
|
||||
: context.getString(R.string.share_track_share_url_body, trackUrl, trackDescription))
|
||||
.setComponent(new ComponentName(packageName, className))
|
||||
.setType(TEXT_PLAIN_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an intent to share a track file with an app.
|
||||
*
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.google.android.apps.mytracks.util;
|
||||
|
||||
import com.google.android.apps.mytracks.Constants;
|
||||
import com.google.android.apps.mytracks.fragments.ExportDialogFragment.ExportType;
|
||||
import com.google.android.apps.mytracks.io.file.TrackFileFormat;
|
||||
import com.google.android.gms.location.DetectedActivity;
|
||||
import com.google.android.maps.mytracks.R;
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2010 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.
|
||||
-->
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/ScrollView" >
|
||||
<LinearLayout
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="8dp" >
|
||||
<RadioGroup
|
||||
android:id="@+id/export_external_storage_options"
|
||||
style="@style/ExportRadioGroup" >
|
||||
<RadioButton
|
||||
android:id="@+id/export_external_storage_kml"
|
||||
style="@style/TextMedium" />
|
||||
<RadioButton
|
||||
android:id="@+id/export_external_storage_gpx"
|
||||
style="@style/TextMedium" />
|
||||
<RadioButton
|
||||
android:id="@+id/export_external_storage_csv"
|
||||
style="@style/TextMedium" />
|
||||
<RadioButton
|
||||
android:id="@+id/export_external_storage_tcx"
|
||||
style="@style/TextMedium" />
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
@@ -38,11 +38,6 @@ limitations under the License.
|
||||
android:id="@+id/track_detail_markers"
|
||||
android:orderInCategory="5"
|
||||
android:title="@string/menu_markers"/>
|
||||
<item
|
||||
android:icon="@drawable/ic_menu_export"
|
||||
android:id="@+id/track_detail_export"
|
||||
android:orderInCategory="8"
|
||||
android:title="@string/menu_export"/>
|
||||
<item
|
||||
android:icon="@drawable/ic_menu_edit"
|
||||
android:id="@+id/track_detail_edit"
|
||||
@@ -73,9 +68,4 @@ limitations under the License.
|
||||
android:id="@+id/track_detail_settings"
|
||||
android:orderInCategory="14"
|
||||
android:title="@string/menu_settings"/>
|
||||
<item
|
||||
android:icon="@drawable/ic_menu_help_feedback"
|
||||
android:id="@+id/track_detail_help_feedback"
|
||||
android:orderInCategory="15"
|
||||
android:title="@string/menu_help_feedback"/>
|
||||
</menu>
|
||||
@@ -72,10 +72,6 @@ Google은 이용자에 대한 위치정보의 이용∙제공사실을 위치정
|
||||
대표자: 염동훈\n
|
||||
주소 : 서울 강남구 역삼동 737 강남파이낸스센터 22층\n
|
||||
전화번호 : (02) 531-9000\n</string>
|
||||
<string name="export_google_drive_url">drive.google.com</string>
|
||||
<string name="export_google_fusion_tables_url">google.com/fusiontables</string>
|
||||
<string name="export_google_maps_url">maps.google.com</string>
|
||||
<string name="export_google_spreadsheets_url">drive.google.com</string>
|
||||
<string name="marker_statistics_icon_url">http://maps.google.com/mapfiles/ms/micons/ylw-pushpin.png</string>
|
||||
<string name="marker_waypoint_icon_url">http://maps.google.com/mapfiles/ms/micons/blue-pushpin.png</string>
|
||||
<string name="my_tracks_help_url">http://support.google.com/gmm/bin/topic.py?topic=2391064&hl=%1$s</string>
|
||||
|
||||
@@ -623,64 +623,6 @@ limitations under the License.
|
||||
%2$s the directory. E.g., '/MyTracks/kml'.">
|
||||
Exported %1$s to %2$s
|
||||
</string>
|
||||
<string name="export_google_drive"
|
||||
translation_description="When exporting a track, the option to export to Google Drive.">
|
||||
Google Drive
|
||||
</string>
|
||||
<string name="export_google_error"
|
||||
translation_description="When exporting a track, the error message.
|
||||
|
||||
%1$s service name. E.g, Google Maps.
|
||||
%2$s service url. E.g, maps.google.com.">
|
||||
An error has occurred. Unable to export to %1$s (%2$s). Please try again.
|
||||
</string>
|
||||
<string name="export_google_error_public"
|
||||
translation_description="The error message when not able to make a track public.
|
||||
|
||||
%1$s service name. E.g, Google Drive.
|
||||
%2$s service url. E.g, drive.google.com.">
|
||||
Unable to make track public in %1$s (%2$s)
|
||||
</string>
|
||||
<string name="export_google_fusion_tables"
|
||||
translation_description="When exporting a track, the option to export to Google Fusion Tables.">
|
||||
Google Fusion Tables
|
||||
</string>
|
||||
<string name="export_google_fusion_tables_private"
|
||||
translation_description="When exporting a track to Google Fusion Tables, the option to export as
|
||||
a new private table as opposed to a new public table.">
|
||||
as new private table
|
||||
</string>
|
||||
<string name="export_google_fusion_tables_public"
|
||||
translation_description="When exporting a track to Google Fusion Tables, the option to export as
|
||||
a new public table as opposed to a new private table.">
|
||||
as new public table
|
||||
</string>
|
||||
<string name="export_google_maps"
|
||||
translation_description="When exporting a track, the option to export to Google Maps.">
|
||||
Google Maps
|
||||
</string>
|
||||
<string name="export_google_maps_public"
|
||||
translation_description="When exporting a track to Google Maps, the option to export as a new
|
||||
public map as opposed to a new unlisted map.">
|
||||
as new public map
|
||||
</string>
|
||||
<string name="export_google_maps_unlisted"
|
||||
translation_description="When exporting a track to Google Maps, the option to export as a new
|
||||
unlisted map as opposed to a new public map.">
|
||||
as new unlisted map
|
||||
</string>
|
||||
<string name="export_google_spreadsheets"
|
||||
translation_description="When exporting a track, the option to export to Google Spreadsheets.">
|
||||
Google Spreadsheets
|
||||
</string>
|
||||
<string name="export_google_success"
|
||||
translation_description="When sending a track to Google, the additional comment on the bottom of
|
||||
the result page.
|
||||
|
||||
%1$s service name. E.g, Google Maps.
|
||||
%2$s service url. E.g, maps.google.com.">
|
||||
Track exported to %1$s (%2$s). It may take a few minutes for it to appear.
|
||||
</string>
|
||||
<string name="export_title"
|
||||
translation_description="The dialog title when exporting a track.">
|
||||
Export to…
|
||||
|
||||
Reference in New Issue
Block a user