merge heads

This commit is contained in:
Jimmy Shih
2012-03-23 16:20:35 -07:00
18 changed files with 357 additions and 370 deletions
+25 -28
View File
@@ -661,11 +661,13 @@ limitations under the License.
indicating error."> indicating error.">
Unable to export. Unable to export.
</string> </string>
<string name="export_progress_message"
translation_description="When exporting all the tracks to the SD card, the progress message.">
Exporting all tracks...
</string>
<string name="export_success" <string name="export_success"
translation_description="When exporting all the tracks to the SD card, a toast message translation_description="When exporting all the tracks to the SD card, a toast message
indicating success. indicating success.">
Screenshot: export_success">
Export finished. Export finished.
</string> </string>
@@ -783,6 +785,10 @@ limitations under the License.
No GPX file found in %1$s. The SD card may be unreadable or the directory may not contain any No GPX file found in %1$s. The SD card may be unreadable or the directory may not contain any
GPX file. GPX file.
</string> </string>
<string name="import_progress_message"
translation_description="When importing all the tracks from the SD card, the progress message.">
Importing all tracks...
</string>
<string name="import_success" <string name="import_success"
translation_description="After importing all the tracks from the SD card, the alert message translation_description="After importing all the tracks from the SD card, the alert message
indicating success. indicating success.
@@ -800,11 +806,6 @@ limitations under the License.
'Maps' list page informing the user that his maps cannot be loaded at this time."> 'Maps' list page informing the user that his maps cannot be loaded at this time.">
Your maps could not be loaded at this time. Your maps could not be loaded at this time.
</string> </string>
<string name="maps_list_loading"
translation_description="When sending a track to an existing Google Map, the progress dialog
message informing the user that his maps are being loaded.">
Loading your Google Maps.
</string>
<string name="maps_list_no_maps" <string name="maps_list_no_maps"
translation_description="When sending a track to an existing Google Map, the text on the translation_description="When sending a track to an existing Google Map, the text on the
'Maps' list page informing the user that he doesn't have any maps."> 'Maps' list page informing the user that he doesn't have any maps.">
@@ -815,6 +816,11 @@ limitations under the License.
'Maps' list page asking the user to pick one of his maps."> 'Maps' list page asking the user to pick one of his maps.">
Pick a map: Pick a map:
</string> </string>
<string name="maps_list_progress_message"
translation_description="When sending a track to an existing Google Map, the progress message
informing the user that his maps are being loaded.">
Loading your Google Maps...
</string>
<string name="maps_list_public_label" <string name="maps_list_public_label"
translation_description="When sending a track to an existing Google Map, in the 'Maps' translation_description="When sending a track to an existing Google Map, in the 'Maps'
list page, the label next to the maps that are public, as opposed to being unlisted."> list page, the label next to the maps that are public, as opposed to being unlisted.">
@@ -1179,12 +1185,9 @@ limitations under the License.
file."> file.">
Unable to write to a file. Unable to write to a file.
</string> </string>
<string name="sd_card_progress_write_file" <string name="sd_card_progress_message"
translation_description="When writing to the SD card, the progress dialog message indicating translation_description="When saving a track to the SD card, the progress message.">
that it may take a while. Saving to the SD card...
Screenshot: sd_card_progress_write_file.png">
Exporting a track to the SD card. This may take a while.
</string> </string>
<string name="sd_card_success_read_file" <string name="sd_card_success_read_file"
translation_description="When reading from the SD card, the success message when finish reading translation_description="When reading from the SD card, the success message when finish reading
@@ -1294,12 +1297,11 @@ limitations under the License.
not selected any Google service and no data is sent."> not selected any Google service and no data is sent.">
You did not select any service. The track was not sent. You did not select any service. The track was not sent.
</string> </string>
<string name="send_google_progress_title" <string name="send_google_progress_message"
translation_description="When sending a track to a Google service, the title on the progress translation_description="When sending a track to a Google service, the progress message.
dialog.
%1$s: service name. 'Google Maps', 'Google Fusion Tables', or 'Google Docs'."> %1$s: service name. 'Google Maps', 'Google Fusion Tables', or 'Google Docs'.">
Sending to %1$s. Please wait... Sending to %1$s...
</string> </string>
<string name="send_google_result_share_url" <string name="send_google_result_share_url"
translation_description="When sending a track to Google, in the result dialog, the button on translation_description="When sending a track to Google, in the result dialog, the button on
@@ -1453,11 +1455,8 @@ limitations under the License.
</string> </string>
<string name="settings_backup_now_progress_message" <string name="settings_backup_now_progress_message"
translation_description="In the 'Backup' settings, after pressing the 'Backup now' option, the translation_description="In the 'Backup' settings, after pressing the 'Backup now' option, the
progress dialog telling the user that it is writing all tracks and settings and that it may progress message telling the user that it is writing all tracks and settings to the SD card.">
take a while. Writing all tracks and settings...
Screenshot: settings_backup_now_progress_message.png">
Writing all tracks and settings to the SD card. This may take a while...
</string> </string>
<string name="settings_backup_now_summary" <string name="settings_backup_now_summary"
translation_description="In the 'Backup' settings, under the 'SD card' section, the translation_description="In the 'Backup' settings, under the 'SD card' section, the
@@ -1492,11 +1491,9 @@ limitations under the License.
</string> </string>
<string name="settings_backup_restore_progress_message" <string name="settings_backup_restore_progress_message"
translation_description="In the 'Backup' settings, after pressing the 'Restore now' option, the translation_description="In the 'Backup' settings, after pressing the 'Restore now' option, the
message on the progress dialog indicating that My Tracks is reading all tracks and settings progress message informing that My Tracks is reading all tracks and settings from the backup
from the backup on the SD card and that it may take a while. on the SD card.">
Reading all tracks and settings...
Screenshot: settings_backup_restore_progress.png">
Reading all tracks and settings from the SD card. This may take a while...
</string> </string>
<string name="settings_backup_restore_select_title" <string name="settings_backup_restore_select_title"
translation_description="In the 'Backup' settings, after pressing the 'Restore now' option, the translation_description="In the 'Backup' settings, after pressing the 'Restore now' option, the
@@ -210,8 +210,8 @@ public class ChartActivity extends Activity implements TrackDataListener {
for (int i = 0; i < ChartView.NUM_SERIES; i++) { for (int i = 0; i < ChartView.NUM_SERIES; i++) {
checkBoxes[i].setChecked(chartView.isChartValueSeriesEnabled(i)); checkBoxes[i].setChecked(chartView.isChartValueSeriesEnabled(i));
} }
checkBoxes[ChartView.SPEED_SERIES].setText(reportSpeed ? R.string.stat_speed checkBoxes[ChartView.SPEED_SERIES].setText(reportSpeed
: R.string.stat_pace); ? R.string.stat_speed : R.string.stat_pace);
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setCancelable(true) .setCancelable(true)
@@ -16,6 +16,7 @@
package com.google.android.apps.mytracks; package com.google.android.apps.mytracks;
import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat; import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
import android.app.Activity; import android.app.Activity;
@@ -65,25 +66,18 @@ public class ExportActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_PROGRESS_ID) {
case DIALOG_PROGRESS_ID: return null;
progressDialog = new ProgressDialog(this); }
progressDialog.setCancelable(true); progressDialog = DialogUtils.createHorizontalProgressDialog(
progressDialog.setIcon(android.R.drawable.ic_dialog_info); this, R.string.export_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setIndeterminate(true);
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
exportAsyncTask.cancel(true); exportAsyncTask.cancel(true);
finish(); finish();
} }
}); });
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); return progressDialog;
progressDialog.setTitle(R.string.track_list_export_all);
return progressDialog;
default:
return null;
}
} }
/** /**
@@ -17,6 +17,7 @@
package com.google.android.apps.mytracks; package com.google.android.apps.mytracks;
import com.google.android.apps.mytracks.content.TracksColumns; import com.google.android.apps.mytracks.content.TracksColumns;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.apps.mytracks.util.FileUtils; import com.google.android.apps.mytracks.util.FileUtils;
import com.google.android.apps.mytracks.util.UriUtils; import com.google.android.apps.mytracks.util.UriUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
@@ -110,19 +111,14 @@ public class ImportActivity extends Activity {
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { switch (id) {
case DIALOG_PROGRESS_ID: case DIALOG_PROGRESS_ID:
progressDialog = new ProgressDialog(this); progressDialog = DialogUtils.createHorizontalProgressDialog(
progressDialog.setCancelable(true); this, R.string.import_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setIcon(android.R.drawable.ic_dialog_info); @Override
progressDialog.setIndeterminate(true); public void onCancel(DialogInterface dialog) {
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { importAsyncTask.cancel(true);
@Override finish();
public void onCancel(DialogInterface dialog) { }
importAsyncTask.cancel(true); });
finish();
}
});
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(R.string.track_list_import_all);
return progressDialog; return progressDialog;
case DIALOG_RESULT_ID: case DIALOG_RESULT_ID:
String message; String message;
@@ -30,7 +30,6 @@ import com.google.android.maps.mytracks.R;
import android.app.Dialog; import android.app.Dialog;
import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothAdapter;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor; import android.content.SharedPreferences.Editor;
@@ -178,15 +177,16 @@ public class SettingsActivity extends PreferenceActivity {
switch (id) { switch (id) {
case DIALOG_CONFIRM_RESET_ID: case DIALOG_CONFIRM_RESET_ID:
return DialogUtils.createConfirmationDialog( return DialogUtils.createConfirmationDialog(
this, R.string.settings_reset_confirm_message, new OnClickListener() { this, R.string.settings_reset_confirm_message, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int button) { public void onClick(DialogInterface dialog, int button) {
onResetPreferencesConfirmed(); onResetPreferencesConfirmed();
} }
}); });
case DIALOG_CONFIRM_ACCESS_ID: case DIALOG_CONFIRM_ACCESS_ID:
return DialogUtils.createConfirmationDialog( return DialogUtils.createConfirmationDialog(this,
this, R.string.settings_sharing_allow_access_confirm_message, new OnClickListener() { R.string.settings_sharing_allow_access_confirm_message,
new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int button) { public void onClick(DialogInterface dialog, int button) {
CheckBoxPreference pref = (CheckBoxPreference) findPreference( CheckBoxPreference pref = (CheckBoxPreference) findPreference(
@@ -195,8 +195,9 @@ public class SettingsActivity extends PreferenceActivity {
} }
}); });
case DIALOG_CONFIRM_RESTORE_ID: case DIALOG_CONFIRM_RESTORE_ID:
return DialogUtils.createConfirmationDialog( return DialogUtils.createConfirmationDialog(this,
this, R.string.settings_backup_restore_confirm_message, new OnClickListener() { R.string.settings_backup_restore_confirm_message,
new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(SettingsActivity.this, RestoreChooserActivity.class)); startActivity(new Intent(SettingsActivity.this, RestoreChooserActivity.class));
@@ -379,7 +379,8 @@ public class TrackList extends ListActivity
}); });
case DIALOG_DELETE_CURRENT_ID: case DIALOG_DELETE_CURRENT_ID:
return DialogUtils.createConfirmationDialog(this, return DialogUtils.createConfirmationDialog(this,
R.string.track_list_delete_track_confirm_message, new DialogInterface.OnClickListener() { R.string.track_list_delete_track_confirm_message,
new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
MyTracksProviderUtils.Factory.get(TrackList.this).deleteTrack(trackId); MyTracksProviderUtils.Factory.get(TrackList.this).deleteTrack(trackId);
@@ -203,20 +203,17 @@ public class WaypointsList extends ListActivity implements View.OnClickListener
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_DELETE_CURRENT_ID) {
case DIALOG_DELETE_CURRENT_ID: return null;
return DialogUtils.createConfirmationDialog(this,
R.string.marker_list_delete_marker_confirm_message,
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
providerUtils.deleteWaypoint(
selectedWaypointId, new DescriptionGeneratorImpl(WaypointsList.this));
}
});
default:
return null;
} }
return DialogUtils.createConfirmationDialog(this,
R.string.marker_list_delete_marker_confirm_message, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
providerUtils.deleteWaypoint(
selectedWaypointId, new DescriptionGeneratorImpl(WaypointsList.this));
}
});
} }
@Override @Override
@@ -61,7 +61,6 @@ public class WelcomeActivity extends Activity {
View view = getLayoutInflater().inflate(R.layout.about, null); View view = getLayoutInflater().inflate(R.layout.about, null);
TextView aboutVersion = (TextView) view.findViewById(R.id.about_version); TextView aboutVersion = (TextView) view.findViewById(R.id.about_version);
aboutVersion.setText(SystemUtils.getMyTracksVersion(this)); aboutVersion.setText(SystemUtils.getMyTracksVersion(this));
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
.setCancelable(true) .setCancelable(true)
.setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() { .setNegativeButton(R.string.about_license, new DialogInterface.OnClickListener() {
@@ -16,11 +16,11 @@
package com.google.android.apps.mytracks.io.backup; package com.google.android.apps.mytracks.io.backup;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.widget.Toast; import android.widget.Toast;
@@ -35,7 +35,6 @@ public class BackupActivity extends Activity {
private static final int DIALOG_PROGRESS_ID = 0; private static final int DIALOG_PROGRESS_ID = 0;
private BackupAsyncTask backupAsyncTask; private BackupAsyncTask backupAsyncTask;
private ProgressDialog progressDialog;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@@ -59,25 +58,16 @@ public class BackupActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_PROGRESS_ID) {
case DIALOG_PROGRESS_ID: return null;
progressDialog = new ProgressDialog(this); }
progressDialog.setCancelable(true); return DialogUtils.createSpinnerProgressDialog(
progressDialog.setIcon(android.R.drawable.ic_dialog_info); this, R.string.settings_backup_now_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setIndeterminate(true);
progressDialog.setMessage(getString(R.string.settings_backup_now_progress_message));
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
finish(); finish();
} }
}); });
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(R.string.generic_progress_title);
return progressDialog;
default:
return null;
}
} }
/** /**
@@ -17,11 +17,11 @@
package com.google.android.apps.mytracks.io.backup; package com.google.android.apps.mytracks.io.backup;
import com.google.android.apps.mytracks.MyTracks; import com.google.android.apps.mytracks.MyTracks;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
@@ -43,7 +43,6 @@ public class RestoreActivity extends Activity {
private static final int DIALOG_PROGRESS_ID = 0; private static final int DIALOG_PROGRESS_ID = 0;
private RestoreAsyncTask restoreAsyncTask; private RestoreAsyncTask restoreAsyncTask;
private ProgressDialog progressDialog;
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
@@ -72,25 +71,16 @@ public class RestoreActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_PROGRESS_ID) {
case DIALOG_PROGRESS_ID: return null;
progressDialog = new ProgressDialog(this); }
progressDialog.setCancelable(true); return DialogUtils.createSpinnerProgressDialog(this,
progressDialog.setIcon(android.R.drawable.ic_dialog_info); R.string.settings_backup_restore_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setIndeterminate(true);
progressDialog.setMessage(getString(R.string.settings_backup_restore_progress_message));
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
finish(); finish();
} }
}); });
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(R.string.generic_progress_title);
return progressDialog;
default:
return null;
}
} }
/** /**
@@ -24,8 +24,6 @@ import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.widget.Toast; import android.widget.Toast;
@@ -90,32 +88,30 @@ public class RestoreChooserActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_CHOOSER_ID) {
case DIALOG_CHOOSER_ID: return null;
String items[] = new String[backupDates.length];
for (int i = 0; i < backupDates.length; i++) {
items[i] = StringUtils.formatDateTime(this, backupDates[i].getTime());
}
return new AlertDialog.Builder(this)
.setCancelable(true)
.setItems(items, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(RestoreChooserActivity.this, RestoreActivity.class)
.putExtra(RestoreActivity.EXTRA_DATE, backupDates[which].getTime()));
finish();
}
})
.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
finish();
}
})
.setTitle(R.string.settings_backup_restore_select_title)
.create();
default:
return null;
} }
String items[] = new String[backupDates.length];
for (int i = 0; i < backupDates.length; i++) {
items[i] = StringUtils.formatDateTime(this, backupDates[i].getTime());
}
return new AlertDialog.Builder(this)
.setCancelable(true)
.setItems(items, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startActivity(new Intent(RestoreChooserActivity.this, RestoreActivity.class).putExtra(
RestoreActivity.EXTRA_DATE, backupDates[which].getTime()));
finish();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
finish();
}
})
.setTitle(R.string.settings_backup_restore_select_title)
.create();
} }
} }
@@ -18,6 +18,7 @@ package com.google.android.apps.mytracks.io.file;
import com.google.android.apps.mytracks.content.MyTracksProviderUtils; import com.google.android.apps.mytracks.content.MyTracksProviderUtils;
import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat; import com.google.android.apps.mytracks.io.file.TrackWriterFactory.TrackFileFormat;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.apps.mytracks.util.FileUtils; import com.google.android.apps.mytracks.util.FileUtils;
import com.google.android.apps.mytracks.util.PlayTrackUtils; import com.google.android.apps.mytracks.util.PlayTrackUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
@@ -27,8 +28,6 @@ import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog; import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
@@ -120,20 +119,14 @@ public class SaveActivity extends Activity {
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { switch (id) {
case DIALOG_PROGRESS_ID: case DIALOG_PROGRESS_ID:
progressDialog = new ProgressDialog(this); progressDialog = DialogUtils.createHorizontalProgressDialog(
progressDialog.setCancelable(true); this, R.string.sd_card_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setIcon(android.R.drawable.ic_dialog_info); @Override
progressDialog.setIndeterminate(true); public void onCancel(DialogInterface dialog) {
progressDialog.setMessage(getString(R.string.sd_card_progress_write_file)); saveAsyncTask.cancel(true);
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { finish();
@Override }
public void onCancel(DialogInterface dialog) { });
saveAsyncTask.cancel(true);
finish();
}
});
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(R.string.generic_progress_title);
return progressDialog; return progressDialog;
case DIALOG_RESULT_ID: case DIALOG_RESULT_ID:
return new AlertDialog.Builder(this) return new AlertDialog.Builder(this)
@@ -141,14 +134,14 @@ public class SaveActivity extends Activity {
.setIcon(success .setIcon(success
? android.R.drawable.ic_dialog_info : android.R.drawable.ic_dialog_alert) ? android.R.drawable.ic_dialog_info : android.R.drawable.ic_dialog_alert)
.setMessage(messageId) .setMessage(messageId)
.setOnCancelListener(new OnCancelListener() { .setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
dialog.dismiss(); dialog.dismiss();
onPostResultDialog(); onPostResultDialog();
} }
}) })
.setPositiveButton(R.string.generic_ok, new OnClickListener() { .setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int arg1) { public void onClick(DialogInterface dialog, int arg1) {
dialog.dismiss(); dialog.dismiss();
@@ -17,16 +17,14 @@ package com.google.android.apps.mytracks.io.maps;
import com.google.android.apps.mytracks.io.gdata.maps.MapsMapMetadata; import com.google.android.apps.mytracks.io.gdata.maps.MapsMapMetadata;
import com.google.android.apps.mytracks.io.sendtogoogle.SendRequest; import com.google.android.apps.mytracks.io.sendtogoogle.SendRequest;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
import com.google.common.annotations.VisibleForTesting; import com.google.common.annotations.VisibleForTesting;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
@@ -46,13 +44,11 @@ import java.util.ArrayList;
*/ */
public class ChooseMapActivity extends Activity { public class ChooseMapActivity extends Activity {
private static final int PROGRESS_DIALOG = 1; private static final int DIALOG_PROGRESS_ID = 0;
@VisibleForTesting private static final int DIALOG_ERROR_ID = 1;
static final int ERROR_DIALOG = 2;
private SendRequest sendRequest; private SendRequest sendRequest;
private ChooseMapAsyncTask asyncTask; private ChooseMapAsyncTask asyncTask;
private ProgressDialog progressDialog;
@VisibleForTesting @VisibleForTesting
ArrayAdapter<ListItem> arrayAdapter; ArrayAdapter<ListItem> arrayAdapter;
@@ -122,39 +118,34 @@ public class ChooseMapActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { switch (id) {
case PROGRESS_DIALOG: case DIALOG_PROGRESS_ID:
progressDialog = new ProgressDialog(this); return DialogUtils.createSpinnerProgressDialog(
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER); this, R.string.maps_list_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setMessage(getString(R.string.maps_list_loading)); @Override
progressDialog.setCancelable(true); public void onCancel(DialogInterface dialog) {
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { asyncTask.cancel(true);
@Override finish();
public void onCancel(DialogInterface dialog) { }
asyncTask.cancel(true); });
finish(); case DIALOG_ERROR_ID:
} return new AlertDialog.Builder(this)
}); .setCancelable(true)
progressDialog.setIcon(android.R.drawable.ic_dialog_info); .setIcon(android.R.drawable.ic_dialog_alert)
progressDialog.setTitle(R.string.generic_progress_title); .setMessage(R.string.maps_list_error)
return progressDialog; .setOnCancelListener(new DialogInterface.OnCancelListener() {
case ERROR_DIALOG: @Override
AlertDialog.Builder builder = new AlertDialog.Builder(this); public void onCancel(DialogInterface dialog) {
builder.setIcon(android.R.drawable.ic_dialog_alert); finish();
builder.setTitle(R.string.generic_error_title); }
builder.setMessage(R.string.maps_list_error); })
builder.setPositiveButton(R.string.generic_ok, new OnClickListener() { .setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int arg1) { public void onClick(DialogInterface dialog, int arg1) {
finish(); finish();
} }
}); })
builder.setOnCancelListener(new OnCancelListener() { .setTitle(R.string.generic_error_title)
@Override .create();
public void onCancel(DialogInterface dialog) {
finish();
}
});
return builder.create();
default: default:
return null; return null;
} }
@@ -192,7 +183,7 @@ public class ChooseMapActivity extends Activity {
* Shows the progress dialog. * Shows the progress dialog.
*/ */
public void showProgressDialog() { public void showProgressDialog() {
showDialog(PROGRESS_DIALOG); showDialog(DIALOG_PROGRESS_ID);
} }
/** /**
@@ -200,7 +191,7 @@ public class ChooseMapActivity extends Activity {
*/ */
@VisibleForTesting @VisibleForTesting
void showErrorDialog() { void showErrorDialog() {
showDialog(ERROR_DIALOG); showDialog(DIALOG_ERROR_ID);
} }
/** /**
@@ -208,7 +199,7 @@ public class ChooseMapActivity extends Activity {
*/ */
@VisibleForTesting @VisibleForTesting
void removeProgressDialog() { void removeProgressDialog() {
removeDialog(PROGRESS_DIALOG); removeDialog(DIALOG_PROGRESS_ID);
} }
/** /**
@@ -16,6 +16,7 @@
package com.google.android.apps.mytracks.io.sendtogoogle; package com.google.android.apps.mytracks.io.sendtogoogle;
import com.google.android.apps.mytracks.util.DialogUtils;
import com.google.android.maps.mytracks.R; import com.google.android.maps.mytracks.R;
import android.app.Activity; import android.app.Activity;
@@ -41,7 +42,7 @@ import android.os.Bundle;
*/ */
public abstract class AbstractSendActivity extends Activity { public abstract class AbstractSendActivity extends Activity {
private static final int PROGRESS_DIALOG = 1; private static final int DIALOG_PROGRESS_ID = 0;
protected SendRequest sendRequest; protected SendRequest sendRequest;
private AbstractSendAsyncTask asyncTask; private AbstractSendAsyncTask asyncTask;
@@ -70,26 +71,18 @@ public abstract class AbstractSendActivity extends Activity {
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_PROGRESS_ID) {
case PROGRESS_DIALOG: return null;
progressDialog = new ProgressDialog(this); }
progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog = DialogUtils.createHorizontalProgressDialog(
progressDialog.setIcon(android.R.drawable.ic_dialog_info); this, R.string.send_google_progress_message, new DialogInterface.OnCancelListener() {
progressDialog.setTitle(getString(R.string.send_google_progress_title, getServiceName()));
progressDialog.setMax(100);
progressDialog.setProgress(0);
progressDialog.setCancelable(true);
progressDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
asyncTask.cancel(true); asyncTask.cancel(true);
startNextActivity(false, true); startNextActivity(false, true);
} }
}); }, getServiceName());
return progressDialog; return progressDialog;
default:
return null;
}
} }
/** /**
@@ -105,7 +98,7 @@ public abstract class AbstractSendActivity extends Activity {
* Shows the progress dialog. * Shows the progress dialog.
*/ */
public void showProgressDialog() { public void showProgressDialog() {
showDialog(PROGRESS_DIALOG); showDialog(DIALOG_PROGRESS_ID);
} }
/** /**
@@ -115,7 +108,9 @@ public abstract class AbstractSendActivity extends Activity {
*/ */
public void setProgressDialogValue(int value) { public void setProgressDialogValue(int value) {
if (progressDialog != null) { if (progressDialog != null) {
progressDialog.setIndeterminate(false);
progressDialog.setProgress(value); progressDialog.setProgress(value);
progressDialog.setMax(100);
} }
} }
@@ -55,8 +55,8 @@ public class AccountChooserActivity extends Activity {
private static final String TAG = AccountChooserActivity.class.getSimpleName(); private static final String TAG = AccountChooserActivity.class.getSimpleName();
private static final int NO_ACCOUNT_DIALOG = 1; private static final int DIALOG_NO_ACCOUNT_ID = 0;
private static final int CHOOSE_ACCOUNT_DIALOG = 2; private static final int DIALOG_CHOOSER_ID = 1;
/** /**
* A callback after getting the permission to access a Google service. * A callback after getting the permission to access a Google service.
@@ -108,77 +108,82 @@ public class AccountChooserActivity extends Activity {
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
if (accounts.length == 0) { if (accounts.length == 0) {
showDialog(NO_ACCOUNT_DIALOG); showDialog(DIALOG_NO_ACCOUNT_ID);
} else if (accounts.length > 1 ) { } else if (accounts.length > 1 ) {
showDialog(CHOOSE_ACCOUNT_DIALOG); showDialog(DIALOG_CHOOSER_ID);
} }
} }
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
AlertDialog.Builder builder;
switch (id) { switch (id) {
case NO_ACCOUNT_DIALOG: case DIALOG_NO_ACCOUNT_ID:
builder = new AlertDialog.Builder(this); return new AlertDialog.Builder(this)
builder.setTitle(R.string.send_google_no_account_title); .setCancelable(true)
builder.setMessage(R.string.send_google_no_account_message); .setMessage(R.string.send_google_no_account_message)
builder.setCancelable(true); .setOnCancelListener(new DialogInterface.OnCancelListener() {
builder.setOnCancelListener(new DialogInterface.OnCancelListener() { @Override
public void onCancel(DialogInterface dialog) {
finish();
}
})
.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setTitle(R.string.send_google_no_account_title)
.create();
case DIALOG_CHOOSER_ID:
return createChooserDialog();
default:
return null;
}
}
/**
* Creates a chooser dialog.
*/
private Dialog createChooserDialog() {
String[] choices = new String[accounts.length];
for (int i = 0; i < accounts.length; i++) {
choices[i] = accounts[i].name;
}
return new AlertDialog.Builder(this)
.setCancelable(true)
.setNegativeButton(R.string.generic_cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
})
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override @Override
public void onCancel(DialogInterface dialog) { public void onCancel(DialogInterface dialog) {
finish(); finish();
} }
}); })
builder.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() { .setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
return builder.create();
case CHOOSE_ACCOUNT_DIALOG:
builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.send_google_choose_account_title);
String[] choices = new String[accounts.length];
for (int i = 0; i < accounts.length; i++) {
choices[i] = accounts[i].name;
}
builder.setSingleChoiceItems(choices, selectedAccountIndex, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
selectedAccountIndex = which;
}
});
builder.setCancelable(true);
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
finish();
}
});
builder.setNegativeButton(R.string.generic_cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
finish();
}
});
builder.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Account account = accounts[selectedAccountIndex]; Account account = accounts[selectedAccountIndex];
SharedPreferences prefs = getSharedPreferences( SharedPreferences sharedPreferences = getSharedPreferences(
Constants.SETTINGS_NAME, Context.MODE_PRIVATE); Constants.SETTINGS_NAME, Context.MODE_PRIVATE);
Editor editor = prefs.edit(); Editor editor = sharedPreferences.edit();
editor.putString(getString(R.string.preferred_account_key), account.name); editor.putString(getString(R.string.preferred_account_key), account.name);
ApiAdapterFactory.getApiAdapter().applyPreferenceChanges(editor); ApiAdapterFactory.getApiAdapter().applyPreferenceChanges(editor);
sendRequest.setAccount(account); sendRequest.setAccount(account);
getPermission(MapsConstants.SERVICE_NAME, sendRequest.isSendMaps(), mapsCallback); getPermission(MapsConstants.SERVICE_NAME, sendRequest.isSendMaps(), mapsCallback);
} }
}); })
return builder.create(); .setSingleChoiceItems(
default: choices, selectedAccountIndex, new DialogInterface.OnClickListener() {
return null; @Override
} public void onClick(DialogInterface dialog, int which) {
selectedAccountIndex = which;
}
})
.setTitle(R.string.send_google_choose_account_title)
.create();
} }
private PermissionCallback spreadsheetsCallback = new PermissionCallback() { private PermissionCallback spreadsheetsCallback = new PermissionCallback() {
@@ -43,7 +43,7 @@ import android.widget.TextView;
public class UploadResultActivity extends Activity { public class UploadResultActivity extends Activity {
private static final String TEXT_PLAIN_TYPE = "text/plain"; private static final String TEXT_PLAIN_TYPE = "text/plain";
private static final int RESULT_DIALOG = 1; private static final int DIALOG_RESULT_ID = 0;
private SendRequest sendRequest; private SendRequest sendRequest;
private Track track; private Track track;
@@ -75,105 +75,99 @@ public class UploadResultActivity extends Activity {
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
showDialog(RESULT_DIALOG); showDialog(DIALOG_RESULT_ID);
} }
@Override @Override
protected Dialog onCreateDialog(int id) { protected Dialog onCreateDialog(int id) {
switch (id) { if (id != DIALOG_RESULT_ID) {
case RESULT_DIALOG: return null;
View view = getLayoutInflater().inflate(R.layout.upload_result, null);
LinearLayout mapsResult = (LinearLayout) view.findViewById(R.id.upload_result_maps_result);
LinearLayout fusionTablesResult = (LinearLayout) view.findViewById(
R.id.upload_result_fusion_tables_result);
LinearLayout docsResult = (LinearLayout) view.findViewById(R.id.upload_result_docs_result);
ImageView mapsResultIcon = (ImageView) view.findViewById(
R.id.upload_result_maps_result_icon);
ImageView fusionTablesResultIcon = (ImageView) view.findViewById(
R.id.upload_result_fusion_tables_result_icon);
ImageView docsResultIcon = (ImageView) view.findViewById(
R.id.upload_result_docs_result_icon);
TextView successFooter = (TextView) view.findViewById(R.id.upload_result_success_footer);
TextView errorFooter = (TextView) view.findViewById(R.id.upload_result_error_footer);
boolean hasError = false;
if (!sendRequest.isSendMaps()) {
mapsResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isMapsSuccess()) {
mapsResultIcon.setImageResource(R.drawable.failure);
mapsResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
if (!sendRequest.isSendFusionTables()) {
fusionTablesResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isFusionTablesSuccess()) {
fusionTablesResultIcon.setImageResource(R.drawable.failure);
fusionTablesResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
if (!sendRequest.isSendDocs()) {
docsResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isDocsSuccess()) {
docsResultIcon.setImageResource(R.drawable.failure);
docsResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
if (hasError) {
successFooter.setVisibility(View.GONE);
} else {
errorFooter.setVisibility(View.GONE);
}
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setCancelable(true)
.setIcon(hasError ? android.R.drawable.ic_dialog_alert
: android.R.drawable.ic_dialog_info)
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
finish();
}
})
.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!sendRequest.isShowAll() && shareUrl != null) {
startShareUrlActivity(shareUrl);
}
finish();
}
})
.setTitle(hasError ? R.string.generic_error_title : R.string.generic_success_title)
.setView(view);
// Add a Share URL button if showing all the options and a shareUrl
// exists
if (sendRequest.isShowAll() && shareUrl != null) {
builder.setNegativeButton(getString(R.string.send_google_result_share_url),
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startShareUrlActivity(shareUrl);
finish();
}
});
}
return builder.create();
default:
return null;
} }
View view = getLayoutInflater().inflate(R.layout.upload_result, null);
LinearLayout mapsResult = (LinearLayout) view.findViewById(R.id.upload_result_maps_result);
LinearLayout fusionTablesResult = (LinearLayout) view.findViewById(
R.id.upload_result_fusion_tables_result);
LinearLayout docsResult = (LinearLayout) view.findViewById(R.id.upload_result_docs_result);
ImageView mapsResultIcon = (ImageView) view.findViewById(R.id.upload_result_maps_result_icon);
ImageView fusionTablesResultIcon = (ImageView) view.findViewById(
R.id.upload_result_fusion_tables_result_icon);
ImageView docsResultIcon = (ImageView) view.findViewById(R.id.upload_result_docs_result_icon);
TextView successFooter = (TextView) view.findViewById(R.id.upload_result_success_footer);
TextView errorFooter = (TextView) view.findViewById(R.id.upload_result_error_footer);
boolean hasError = false;
if (!sendRequest.isSendMaps()) {
mapsResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isMapsSuccess()) {
mapsResultIcon.setImageResource(R.drawable.failure);
mapsResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
if (!sendRequest.isSendFusionTables()) {
fusionTablesResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isFusionTablesSuccess()) {
fusionTablesResultIcon.setImageResource(R.drawable.failure);
fusionTablesResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
if (!sendRequest.isSendDocs()) {
docsResult.setVisibility(View.GONE);
} else {
if (!sendRequest.isDocsSuccess()) {
docsResultIcon.setImageResource(R.drawable.failure);
docsResultIcon.setContentDescription(getString(R.string.generic_error_title));
hasError = true;
}
}
if (hasError) {
successFooter.setVisibility(View.GONE);
} else {
errorFooter.setVisibility(View.GONE);
}
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setCancelable(true)
.setIcon(hasError ? android.R.drawable.ic_dialog_alert : android.R.drawable.ic_dialog_info)
.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
finish();
}
})
.setPositiveButton(R.string.generic_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (!sendRequest.isShowAll() && shareUrl != null) {
startShareUrlActivity(shareUrl);
}
finish();
}
})
.setTitle(hasError ? R.string.generic_error_title : R.string.generic_success_title)
.setView(view);
// Add a Share URL button if showing all the options and a shareUrl exists
if (sendRequest.isShowAll() && shareUrl != null) {
builder.setNegativeButton(
R.string.send_google_result_share_url, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
startShareUrlActivity(shareUrl);
finish();
}
});
}
return builder.create();
} }
/** /**
@@ -20,8 +20,9 @@ import com.google.android.maps.mytracks.R;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface.OnClickListener; import android.content.DialogInterface;
/** /**
* Utilities for creating dialogs. * Utilities for creating dialogs.
@@ -36,18 +37,66 @@ public class DialogUtils {
* Creates a confirmation dialog. * Creates a confirmation dialog.
* *
* @param context the context * @param context the context
* @param messageId the id of the confirmation message * @param messageId the confirmation message id
* @param onClickListener the listener to invoke when the users clicks OK * @param onClickListener the listener to invoke when the user clicks OK
*/ */
public static Dialog createConfirmationDialog( public static Dialog createConfirmationDialog(
Context context, int messageId, OnClickListener onClickListener) { Context context, int messageId, DialogInterface.OnClickListener onClickListener) {
return new AlertDialog.Builder(context) return new AlertDialog.Builder(context)
.setCancelable(true) .setCancelable(true)
.setIcon(android.R.drawable.ic_dialog_alert) .setIcon(android.R.drawable.ic_dialog_alert)
.setMessage(messageId) .setMessage(context.getString(messageId))
.setNegativeButton(android.R.string.cancel, null) .setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(android.R.string.ok, onClickListener) .setPositiveButton(android.R.string.ok, onClickListener)
.setTitle(R.string.generic_confirm_title) .setTitle(R.string.generic_confirm_title)
.create(); .create();
} }
/**
* Creates a spinner progress dialog.
*
* @param context the context
* @param messageId the progress message id
* @param onCancelListener the cancel listener
*/
public static ProgressDialog createSpinnerProgressDialog(
Context context, int messageId, DialogInterface.OnCancelListener onCancelListener) {
return createProgressDialog(true, context, messageId, onCancelListener);
}
/**
* Creates a horizontal progress dialog.
*
* @param context the context
* @param messageId the progress message id
* @param onCancelListener the cancel listener
* @param formatArgs the format arguments for the messageId
*/
public static ProgressDialog createHorizontalProgressDialog(Context context, int messageId,
DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
return createProgressDialog(false, context, messageId, onCancelListener, formatArgs);
}
/**
* Creates a progress dialog.
*
* @param spinner true to use the spinner style
* @param context the context
* @param messageId the progress message id
* @param onCancelListener the cancel listener
* @param formatArgs the format arguments for the message id
*/
private static ProgressDialog createProgressDialog(boolean spinner, Context context,
int messageId, DialogInterface.OnCancelListener onCancelListener, Object... formatArgs) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setCancelable(true);
progressDialog.setIcon(android.R.drawable.ic_dialog_info);
progressDialog.setIndeterminate(true);
progressDialog.setMessage(context.getString(messageId, formatArgs));
progressDialog.setOnCancelListener(onCancelListener);
progressDialog.setProgressStyle(spinner ? ProgressDialog.STYLE_SPINNER
: ProgressDialog.STYLE_HORIZONTAL);
progressDialog.setTitle(R.string.generic_progress_title);
return progressDialog;
}
} }
@@ -24,7 +24,6 @@ import android.app.AlertDialog;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
@@ -96,7 +95,7 @@ public class PlayTrackUtils {
.setCancelable(true) .setCancelable(true)
.setMessage(R.string.track_list_play_install_earth_message) .setMessage(R.string.track_list_play_install_earth_message)
.setNegativeButton(android.R.string.cancel, null) .setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(android.R.string.ok, new OnClickListener() { .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(); Intent intent = new Intent();