Revert changes for address search

This commit is contained in:
Victor Shcherb 2012-08-25 12:47:07 +02:00
parent f07399c3a7
commit bb111f8dd4
2 changed files with 24 additions and 19 deletions

View file

@ -54,7 +54,11 @@ public class FontFitTextView extends TextView {
//if (getLineCount() != lines) { //if (getLineCount() != lines) {
setLines(lines); setLines(lines);
setMaxLines(lines); setMaxLines(lines);
setGravity(Gravity.TOP); if( lines == 1) {
setGravity(Gravity.CENTER_VERTICAL);
} else {
setGravity(Gravity.TOP);
}
//} //}
setTextSize(TypedValue.COMPLEX_UNIT_PX, tp.getTextSize()); setTextSize(TypedValue.COMPLEX_UNIT_PX, tp.getTextSize());
} }

View file

@ -238,24 +238,25 @@ public abstract class SearchByNameAbstractActivity<T> extends OsmandListActivity
return getText(obj); return getText(obj);
} }
public void itemSelectedBase(final T obj, View v) { public void itemSelectedBase(final T obj, View v) {
LatLon loc = getLocation(obj); itemSelected(obj);
if (obj != null && loc != null) { // LatLon loc = getLocation(obj);
QuickAction qa = new QuickAction(v); // if (obj != null && loc != null) {
ActionItem ai = new ActionItem(); // QuickAction qa = new QuickAction(v);
ai.setTitle("Default"); // ActionItem ai = new ActionItem();
ai.setOnClickListener(new OnClickListener() { // ai.setTitle("Default");
@Override // ai.setOnClickListener(new OnClickListener() {
public void onClick(View v) { // @Override
itemSelected(obj); // public void onClick(View v) {
} // itemSelected(obj);
}); // }
qa.addActionItem(ai); // });
// TODO more granular description and text message! // qa.addActionItem(ai);
MapActivityActions.createDirectionsActions(qa, loc, // // TODO more granular description and text message!
obj, getText(obj), getZoomToDisplay(endingObject), // MapActivityActions.createDirectionsActions(qa, loc,
SearchByNameAbstractActivity.this, true, null); // obj, getText(obj), getZoomToDisplay(endingObject),
qa.show(); // SearchByNameAbstractActivity.this, true, null);
} // qa.show();
// }
} }
public abstract void itemSelected(T obj); public abstract void itemSelected(T obj);