code review comments

This commit is contained in:
Matthew Simmons
2011-03-04 19:23:37 -05:00
parent 3eb53d3195
commit f9eba950e0
9 changed files with 126 additions and 67 deletions
@@ -1180,6 +1180,24 @@ public class MyTracks extends TabActivity implements OnTouchListener,
final boolean sentToFusionTables = sendToGoogleDialog.getSendToFusionTables();
dialogManager.dismissDialogSafely(DIALOG_PROGRESS);
// We've finished sending the track to the user-selected services. Now
// we tell them the results of the upload, and optionally share the track.
// There are a few different paths through this code:
//
// 1. The user pre-requested a share (shareRequested == true). We're going
// to display the result dialog *without* the share button (the share
// listener will be null). The OK button listener will initiate the
// share.
//
// 2. The user did not pre-request a share, but the set of services to
// which we succeeded in uploading the track are compatible with
// sharing. We'll display a share button (the share listener will be
// non-null), and will share the link if the user clicks it.
//
// 3. The user did not pre-request a share, and the set of services to
// which we succeeded in uploading the track are incompatible with
// sharing. We won't display a share button.
final boolean canShare = getSendToFusionTablesTableId() != null
|| getSendToMyMapsMapId() != null;
@@ -1195,8 +1213,6 @@ public class MyTracks extends TabActivity implements OnTouchListener,
DialogInterface.OnClickListener onOkListener = (canShare && shareRequested)
? doShareListener : null;
// If the share listener is null, the share button will not be displayed.
DialogInterface.OnClickListener onShareListener = (canShare && !shareRequested)
? doShareListener : null;
@@ -19,6 +19,7 @@ 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.view.View;
import android.widget.ListView;
@@ -89,7 +90,7 @@ public class ResultDialogFactory {
private static View makeDialogContent(Activity activity, List<SendResult> results,
boolean success) {
ResultListAdapter resultListAdapter = new ResultListAdapter(activity,
R.layout.send_to_google_result_fragment, results);
R.layout.send_to_google_result_list_item, results);
View content = activity.getLayoutInflater().inflate(R.layout.send_to_google_result, null);
ListView resultList = (ListView) content.findViewById(R.id.send_to_google_result_list);
@@ -23,6 +23,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.TextView;
import java.util.List;
@@ -44,7 +45,7 @@ class ResultListAdapter extends ArrayAdapter<SendResult> {
if (view == null) {
LayoutInflater inflater
= (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = inflater.inflate(R.layout.send_to_google_result_fragment, null);
view = inflater.inflate(R.layout.send_to_google_result_list_item, null);
}
SendResult result = getItem(position);