Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
1c546d8895
6 changed files with 21 additions and 21 deletions
|
@ -35,7 +35,6 @@
|
|||
android:layout_gravity="bottom"
|
||||
android:layout_marginRight="@dimen/list_content_padding"
|
||||
android:layout_weight="1"
|
||||
android:hint="@string/shared_string_search"
|
||||
android:maxLines="1"
|
||||
android:nextFocusLeft="@id/edit"
|
||||
android:nextFocusUp="@id/edit"
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
3. All your modified/created strings are in the top of the file (to make easier find what\'s translated).
|
||||
PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy
|
||||
-->
|
||||
<string name="filter_poi_hint">Filter by name</string>
|
||||
<string name="search_poi_category_hint">Type to search all</string>
|
||||
<string name="shared_string_open">Open</string>
|
||||
<string name="rendering_attr_OSMMapperAssistant_name">OSM mapper assistant</string>
|
||||
<string name="agps_info">A-GPS info</string>
|
||||
|
|
|
@ -174,7 +174,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
});
|
||||
showOnMapItem.setEnabled(!isNameSearch() || amenityAdapter.getCount() > 0);
|
||||
if (filter != null && !isNameSearch()) {
|
||||
createMenuItem(omenu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item, R.drawable.ic_action_gsave_dark,
|
||||
createMenuItem(omenu, SAVE_FILTER, R.string.edit_filter_save_as_menu_item, R.drawable.ic_action_fav_dark,
|
||||
MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
|
||||
if (!filter.isStandardFilter()) {
|
||||
createMenuItem(omenu, DELETE_FILTER, R.string.shared_string_delete, R.drawable.ic_action_delete_dark,
|
||||
|
@ -247,6 +247,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
}
|
||||
});
|
||||
((EditText)findViewById(R.id.edit)).setHint(R.string.filter_poi_hint);
|
||||
((ImageView)findViewById(R.id.search_icon)).setImageDrawable(
|
||||
getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_filter_dark));
|
||||
|
||||
findViewById(R.id.options).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
|
|
@ -61,8 +61,11 @@ public class SearchPoiFilterFragment extends ListFragment implements SearchActiv
|
|||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
View v = inflater.inflate(R.layout.searchpoi, container, false);
|
||||
|
||||
v.findViewById(R.id.SearchFilterLayout).setVisibility(View.VISIBLE);
|
||||
((EditText)v.findViewById(R.id.edit)).setHint(R.string.search_poi_category_hint);
|
||||
((ImageView)v.findViewById(R.id.search_icon)).setImageDrawable(
|
||||
getMyApplication().getIconsCache().getContentIcon(R.drawable.ic_action_search_dark));
|
||||
|
||||
setupSearchEditText((EditText) v.findViewById(R.id.edit));
|
||||
setupOptions(v.findViewById(R.id.options));
|
||||
v.findViewById(R.id.poiSplitbar).setVisibility(View.GONE);
|
||||
|
|
|
@ -368,13 +368,9 @@ public class GpxUiHelper {
|
|||
public int compare(String object1, String object2) {
|
||||
Long l1 = mp.get(object1);
|
||||
Long l2 = mp.get(object2);
|
||||
if(l2 == null) {
|
||||
l2 = 0l;
|
||||
}
|
||||
if(l1== null) {
|
||||
l1 = 0l;
|
||||
}
|
||||
return l1 < l2 ? 1 : (l1 == l2 ? 0 : -1);
|
||||
long lhs = l1 == null ? 0 : l1.longValue();
|
||||
long rhs = l2 == null ? 0 : l2.longValue();
|
||||
return lhs < rhs ? 1 : (lhs == rhs ? 0 : -1);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
|
@ -388,12 +384,7 @@ public class GpxUiHelper {
|
|||
Collections.sort(list, new Comparator<String>() {
|
||||
@Override
|
||||
public int compare(String object1, String object2) {
|
||||
if (object1.compareTo(object2) > 0) {
|
||||
return -1;
|
||||
} else if (object1.equals(object2)) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
return -object1.compareTo(object2);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
@ -454,7 +454,7 @@ public class PoiLegacyFilter implements SearchPoiTypeFilter {
|
|||
}
|
||||
|
||||
private void fillPoiAdditionals(AbstractPoiType pt) {
|
||||
for(PoiType add : pt.getPoiAdditionals()) {
|
||||
for (PoiType add : pt.getPoiAdditionals()) {
|
||||
poiAdditionals.put(add.getKeyName().replace('_', ':').replace(' ', ':'), add);
|
||||
poiAdditionals.put(add.getTranslation().replace(' ', ':').toLowerCase(), add);
|
||||
}
|
||||
|
@ -471,10 +471,12 @@ public class PoiLegacyFilter implements SearchPoiTypeFilter {
|
|||
while(e.hasNext()) {
|
||||
Entry<PoiCategory, LinkedHashSet<String>> pc = e.next();
|
||||
fillPoiAdditionals(pc.getKey());
|
||||
if(pc.getValue() != null) {
|
||||
for(String s : pc.getValue()) {
|
||||
if (pc.getValue() != null) {
|
||||
for (String s : pc.getValue()) {
|
||||
PoiType subtype = poiTypes.getPoiTypeByKey(s);
|
||||
fillPoiAdditionals(subtype);
|
||||
if (subtype != null) {
|
||||
fillPoiAdditionals(subtype);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -504,7 +506,6 @@ public class PoiLegacyFilter implements SearchPoiTypeFilter {
|
|||
acceptedTypes.remove(poiCategory);
|
||||
}
|
||||
updatePoiAdditionals();
|
||||
|
||||
}
|
||||
|
||||
public String getFilterId(){
|
||||
|
|
Loading…
Reference in a new issue