forked from upstream-mirrors/OpenTracks
Code review
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
<classpathentry kind="lib" path="libs/accounts.jar"/>
|
<classpathentry kind="lib" path="libs/accounts.jar"/>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="src" path="gen"/>
|
<classpathentry kind="src" path="gen"/>
|
||||||
<classpathentry exported="true" kind="lib" path="/MyTracksLib/libs/protobuf-java-2.3.0-lite.jar"/>
|
|
||||||
<classpathentry kind="src" path="MyTracksLib_src"/>
|
<classpathentry kind="src" path="MyTracksLib_src"/>
|
||||||
|
<classpathentry exported="true" kind="lib" path="/MyTracksLib/libs/protobuf-java-2.3.0-lite.jar"/>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ import com.google.android.apps.mytracks.io.SendToMyMaps;
|
|||||||
import com.google.android.apps.mytracks.io.TempFileCleaner;
|
import com.google.android.apps.mytracks.io.TempFileCleaner;
|
||||||
import com.google.android.apps.mytracks.io.TrackWriter;
|
import com.google.android.apps.mytracks.io.TrackWriter;
|
||||||
import com.google.android.apps.mytracks.io.TrackWriterFactory;
|
import com.google.android.apps.mytracks.io.TrackWriterFactory;
|
||||||
|
import com.google.android.apps.mytracks.io.SendToDocs;
|
||||||
import com.google.android.apps.mytracks.io.SendToMyMaps.OnSendCompletedListener;
|
import com.google.android.apps.mytracks.io.SendToMyMaps.OnSendCompletedListener;
|
||||||
import com.google.android.apps.mytracks.io.TrackWriterFactory.TrackFileFormat;
|
import com.google.android.apps.mytracks.io.TrackWriterFactory.TrackFileFormat;
|
||||||
import com.google.android.apps.mytracks.io.SendToDocs;
|
|
||||||
import com.google.android.apps.mytracks.services.ITrackRecordingService;
|
import com.google.android.apps.mytracks.services.ITrackRecordingService;
|
||||||
import com.google.android.apps.mytracks.services.StatusAnnouncerFactory;
|
import com.google.android.apps.mytracks.services.StatusAnnouncerFactory;
|
||||||
import com.google.android.apps.mytracks.services.TrackRecordingService;
|
import com.google.android.apps.mytracks.services.TrackRecordingService;
|
||||||
@@ -93,9 +93,6 @@ import org.xml.sax.SAXException;
|
|||||||
*/
|
*/
|
||||||
public class MyTracks extends TabActivity implements OnTouchListener,
|
public class MyTracks extends TabActivity implements OnTouchListener,
|
||||||
OnSharedPreferenceChangeListener, ProgressIndicator {
|
OnSharedPreferenceChangeListener, ProgressIndicator {
|
||||||
private static final String GDATA_SERVICE_NAME_TRIX = "wise";
|
|
||||||
private static final String GDATA_SERVICE_NAME_DOCLIST = "writely";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Singleton instance
|
* Singleton instance
|
||||||
*/
|
*/
|
||||||
@@ -526,7 +523,7 @@ public class MyTracks extends TabActivity implements OnTouchListener,
|
|||||||
R.string.progress_message_authenticating_docs);
|
R.string.progress_message_authenticating_docs);
|
||||||
authenticate(results,
|
authenticate(results,
|
||||||
MyTracksConstants.AUTHENTICATE_TO_TRIX,
|
MyTracksConstants.AUTHENTICATE_TO_TRIX,
|
||||||
GDATA_SERVICE_NAME_DOCLIST);
|
SendToDocs.GDATA_SERVICE_NAME_DOCLIST);
|
||||||
} else {
|
} else {
|
||||||
dialogManager.dismissDialogSafely(DIALOG_PROGRESS);
|
dialogManager.dismissDialogSafely(DIALOG_PROGRESS);
|
||||||
}
|
}
|
||||||
@@ -538,7 +535,7 @@ public class MyTracks extends TabActivity implements OnTouchListener,
|
|||||||
setProgressMessage(
|
setProgressMessage(
|
||||||
R.string.progress_message_authenticating_docs);
|
R.string.progress_message_authenticating_docs);
|
||||||
authenticate(results, MyTracksConstants.SEND_TO_DOCS,
|
authenticate(results, MyTracksConstants.SEND_TO_DOCS,
|
||||||
GDATA_SERVICE_NAME_TRIX);
|
SendToDocs.GDATA_SERVICE_NAME_TRIX);
|
||||||
} else {
|
} else {
|
||||||
dialogManager.dismissDialogSafely(DIALOG_PROGRESS);
|
dialogManager.dismissDialogSafely(DIALOG_PROGRESS);
|
||||||
}
|
}
|
||||||
@@ -551,8 +548,8 @@ public class MyTracks extends TabActivity implements OnTouchListener,
|
|||||||
setProgressMessage(R.string.progress_message_sending_docs);
|
setProgressMessage(R.string.progress_message_sending_docs);
|
||||||
final long trackId = results.getLongExtra("trackid", selectedTrackId);
|
final long trackId = results.getLongExtra("trackid", selectedTrackId);
|
||||||
final SendToDocs sender = new SendToDocs(this,
|
final SendToDocs sender = new SendToDocs(this,
|
||||||
authMap.get(GDATA_SERVICE_NAME_TRIX),
|
authMap.get(SendToDocs.GDATA_SERVICE_NAME_TRIX),
|
||||||
authMap.get(GDATA_SERVICE_NAME_DOCLIST), trackId);
|
authMap.get(SendToDocs.GDATA_SERVICE_NAME_DOCLIST), trackId);
|
||||||
Runnable onCompletion = new Runnable() {
|
Runnable onCompletion = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
setProgressValue(100);
|
setProgressValue(100);
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ import java.io.IOException;
|
|||||||
* @author Sandor Dornbush
|
* @author Sandor Dornbush
|
||||||
*/
|
*/
|
||||||
public class SendToDocs {
|
public class SendToDocs {
|
||||||
|
/** The GData service name for Google Spreadsheets (aka Trix) */
|
||||||
|
public static final String GDATA_SERVICE_NAME_TRIX = "wise";
|
||||||
|
|
||||||
|
/** The GData service name for the Google Docs Document List */
|
||||||
|
public static final String GDATA_SERVICE_NAME_DOCLIST = "writely";
|
||||||
|
|
||||||
private final Activity activity;
|
private final Activity activity;
|
||||||
private final AuthManager trixAuth;
|
private final AuthManager trixAuth;
|
||||||
private final AuthManager docListAuth;
|
private final AuthManager docListAuth;
|
||||||
@@ -223,6 +229,7 @@ public class SendToDocs {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
MyTracks.getInstance().setProgressValue(80);
|
MyTracks.getInstance().setProgressValue(80);
|
||||||
|
createdNewSpreadSheet = true;
|
||||||
|
|
||||||
if (spreadsheetId == null) {
|
if (spreadsheetId == null) {
|
||||||
MyTracks.getInstance().setProgressValue(85);
|
MyTracks.getInstance().setProgressValue(85);
|
||||||
|
|||||||
Reference in New Issue
Block a user