Conflicts:
	OsmAnd/src/net/osmand/plus/helpers/WaypointDialogHelper.java
This commit is contained in:
Victor Shcherb 2014-10-20 21:43:15 +02:00
parent 8115553eb8
commit 2eb10ce57d

View file

@ -3,7 +3,6 @@ package net.osmand.plus.helpers;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import android.widget.*;
import net.osmand.Location; import net.osmand.Location;
import net.osmand.data.LatLon; import net.osmand.data.LatLon;
import net.osmand.data.LocationPoint; import net.osmand.data.LocationPoint;
@ -35,6 +34,15 @@ import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
/** /**
*/ */
@ -84,29 +92,16 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
removeDialog(); removeDialog();
} else { } else {
boolean created = false; boolean created = false;
if (closePointDialog == null) { View dlg = closePointDialog;
if (dlg == null) {
created = true; created = true;
final LayoutInflater vi = (LayoutInflater) app.getSystemService(Context.LAYOUT_INFLATER_SERVICE); final LayoutInflater vi = (LayoutInflater) app.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
closePointDialog = vi.inflate(R.layout.waypoint_reached, null); dlg = vi.inflate(R.layout.waypoint_reached, null);
} }
updatePointInfoView(app, mapActivity, closePointDialog, point, null); updatePointInfoView(app, mapActivity, dlg, point, null);
View all = closePointDialog.findViewById(R.id.all_points); View all = dlg.findViewById(R.id.all_points);
all.setVisibility(/*many.size() <= 1 ? View.GONE : */View.VISIBLE); all.setVisibility(/*many.size() <= 1 ? View.GONE : */View.VISIBLE);
if (created) { View btnN = dlg.findViewById(R.id.info_close);
closePointDialog.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.view_black_selection));
((TextView) closePointDialog.findViewById(R.id.waypoint_text)).setTextColor(Color.WHITE);
all.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showWaypointsDialog(mapActivity);
}
});
mainLayout.addView(closePointDialog, getDialogLayoutParams());
waitBeforeLayoutIsResized(closePointDialog);
}
View btnN = closePointDialog.findViewById(R.id.info_close);
btnN.setOnClickListener(new View.OnClickListener() { btnN.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -114,6 +109,21 @@ public class WaypointDialogHelper implements OsmAndLocationListener {
updateDialog(); updateDialog();
} }
}); });
if (created) {
dlg.setBackgroundDrawable(mapActivity.getResources().getDrawable(R.drawable.view_black_selection));
((TextView) dlg.findViewById(R.id.waypoint_text)).setTextColor(Color.WHITE);
all.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
showWaypointsDialog(mapActivity);
}
});
closePointDialog = dlg;
mainLayout.addView(closePointDialog, getDialogLayoutParams());
waitBeforeLayoutIsResized(dlg);
}
} }
} }