From bb111f8dd468032b65474327fd0d7f9573d6a1d7 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sat, 25 Aug 2012 12:47:07 +0200 Subject: [PATCH] Revert changes for address search --- .../plus/activities/FontFitTextView.java | 6 ++- .../search/SearchByNameAbstractActivity.java | 37 ++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java b/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java index e0cb9c107a..c9e6ceed46 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java +++ b/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java @@ -54,7 +54,11 @@ public class FontFitTextView extends TextView { //if (getLineCount() != lines) { setLines(lines); setMaxLines(lines); - setGravity(Gravity.TOP); + if( lines == 1) { + setGravity(Gravity.CENTER_VERTICAL); + } else { + setGravity(Gravity.TOP); + } //} setTextSize(TypedValue.COMPLEX_UNIT_PX, tp.getTextSize()); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java index 5890ad66cf..bd994dacdf 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchByNameAbstractActivity.java @@ -238,24 +238,25 @@ public abstract class SearchByNameAbstractActivity extends OsmandListActivity return getText(obj); } public void itemSelectedBase(final T obj, View v) { - LatLon loc = getLocation(obj); - if (obj != null && loc != null) { - QuickAction qa = new QuickAction(v); - ActionItem ai = new ActionItem(); - ai.setTitle("Default"); - ai.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - itemSelected(obj); - } - }); - qa.addActionItem(ai); - // TODO more granular description and text message! - MapActivityActions.createDirectionsActions(qa, loc, - obj, getText(obj), getZoomToDisplay(endingObject), - SearchByNameAbstractActivity.this, true, null); - qa.show(); - } + itemSelected(obj); +// LatLon loc = getLocation(obj); +// if (obj != null && loc != null) { +// QuickAction qa = new QuickAction(v); +// ActionItem ai = new ActionItem(); +// ai.setTitle("Default"); +// ai.setOnClickListener(new OnClickListener() { +// @Override +// public void onClick(View v) { +// itemSelected(obj); +// } +// }); +// qa.addActionItem(ai); +// // TODO more granular description and text message! +// MapActivityActions.createDirectionsActions(qa, loc, +// obj, getText(obj), getZoomToDisplay(endingObject), +// SearchByNameAbstractActivity.this, true, null); +// qa.show(); +// } } public abstract void itemSelected(T obj);