Formatting
This commit is contained in:
parent
df32aa5b57
commit
30c71820aa
1 changed files with 53 additions and 53 deletions
|
@ -144,9 +144,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
imm.showSoftInput(searchFilter, InputMethodManager.SHOW_IMPLICIT);
|
||||
} else {
|
||||
if(filter != null) {
|
||||
if (filter != null) {
|
||||
searchFilter.setText(filter.getSavedFilterByName() == null ? "" :
|
||||
filter.getSavedFilterByName());
|
||||
filter.getSavedFilterByName());
|
||||
}
|
||||
searchFilterLayout.setVisibility(View.GONE);
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// Issue 2657
|
||||
// Issue 2657
|
||||
super.onDestroy();
|
||||
if (!(currentSearchTask == null || currentSearchTask.getStatus() == Status.FINISHED)) {
|
||||
currentSearchTask.cancel(true);
|
||||
|
@ -209,7 +209,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
.show();
|
||||
return true;
|
||||
}
|
||||
if ((isNameSearch() && !Algorithms.objectEquals(filter.getFilterByName(), query)) ) {
|
||||
if ((isNameSearch() && !Algorithms.objectEquals(filter.getFilterByName(), query))) {
|
||||
filter.clearPreviousZoom();
|
||||
filter.setFilterByName(query);
|
||||
runNewSearchQuery(location, NEW_SEARCH_INIT);
|
||||
|
@ -263,10 +263,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
});
|
||||
searchFilter.setHint(R.string.filter_poi_hint);
|
||||
((ImageView)findViewById(R.id.search_icon)).setImageDrawable(
|
||||
getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_filter_dark));
|
||||
((ImageView) findViewById(R.id.options)).
|
||||
setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
|
||||
((ImageView) findViewById(R.id.search_icon)).setImageDrawable(
|
||||
getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_action_filter_dark));
|
||||
((ImageView) findViewById(R.id.options)).
|
||||
setImageDrawable(getMyApplication().getIconsCache().getThemedIcon(R.drawable.ic_overflow_menu_white));
|
||||
findViewById(R.id.options).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
@ -288,7 +288,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
String filterId = bundle.getString(AMENITY_FILTER);
|
||||
this.filter = app.getPoiFilters().getFilterById(filterId);
|
||||
if (filter != null) {
|
||||
if(filter.isEmpty() && !isNameSearch()) {
|
||||
if (filter.isEmpty() && !isNameSearch()) {
|
||||
showEditActivity(filter);
|
||||
} else {
|
||||
filter.clearPreviousZoom();
|
||||
|
@ -296,7 +296,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
runNewSearchQuery(location, NEW_SEARCH_INIT);
|
||||
}
|
||||
} else {
|
||||
amenityAdapter.setNewModel(Collections.<Amenity> emptyList());
|
||||
amenityAdapter.setNewModel(Collections.<Amenity>emptyList());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@ -334,9 +334,9 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
String queue = s.toString().trim();
|
||||
// if (!isNameSearch() ) {
|
||||
amenityAdapter.getFilter().filter(queue);
|
||||
String cfilter = filter == null || filter.getFilterByName() == null ? "" :
|
||||
filter.getFilterByName().toLowerCase();
|
||||
if(!isNameSearch() && !queue.toString().toLowerCase().startsWith(cfilter)) {
|
||||
String cfilter = filter == null || filter.getFilterByName() == null ? "" :
|
||||
filter.getFilterByName().toLowerCase();
|
||||
if (!isNameSearch() && !queue.toString().toLowerCase().startsWith(cfilter)) {
|
||||
filter.setFilterByName(queue.toString());
|
||||
runNewSearchQuery(location, SEARCH_AGAIN);
|
||||
}
|
||||
|
@ -364,14 +364,14 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
addFilter(optionsMenu, getString(R.string.shared_string_is_open));
|
||||
addFilter(optionsMenu, getString(R.string.shared_string_is_open_24_7));
|
||||
Map<String, PoiType> poiAdditionals = f.getPoiAdditionals();
|
||||
if(poiAdditionals != null) {
|
||||
if (poiAdditionals != null) {
|
||||
TreeMap<String, PoiType> adds = new TreeMap<String, PoiType>();
|
||||
for(PoiType vtype : poiAdditionals.values()) {
|
||||
if(vtype.isTopVisible()) {
|
||||
for (PoiType vtype : poiAdditionals.values()) {
|
||||
if (vtype.isTopVisible()) {
|
||||
adds.put(vtype.getTranslation().replace(' ', ':').toLowerCase(), vtype);
|
||||
}
|
||||
}
|
||||
for(String vtype : adds.keySet()) {
|
||||
for (String vtype : adds.keySet()) {
|
||||
addFilter(optionsMenu, vtype);
|
||||
}
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
if(searchFilterLayout.getVisibility() == View.GONE) {
|
||||
if (searchFilterLayout.getVisibility() == View.GONE) {
|
||||
searchFilterLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
searchFilter.setText((searchFilter.getText().toString() + " " + value.replace(' ', '_').toLowerCase()).trim());
|
||||
|
@ -399,11 +399,11 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
Intent newIntent = new Intent(this, EditPOIFilterActivity.class);
|
||||
// folder selected
|
||||
newIntent.putExtra(EditPOIFilterActivity.AMENITY_FILTER, poi.getFilterId());
|
||||
if(location != null) {
|
||||
if (location != null) {
|
||||
newIntent.putExtra(SearchActivity.SEARCH_LAT, location.getLatitude());
|
||||
newIntent.putExtra(SearchActivity.SEARCH_LON, location.getLongitude());
|
||||
}
|
||||
if(searchNearBy) {
|
||||
if (searchNearBy) {
|
||||
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
|
||||
}
|
||||
startActivityForResult(newIntent, RESULT_REQUEST_CODE);
|
||||
|
@ -445,10 +445,10 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
name = "'" + filter.getFilterByName() + "'";
|
||||
}
|
||||
|
||||
if(name.length() >= maxLength) {
|
||||
if (name.length() >= maxLength) {
|
||||
name = name.substring(0, maxLength) + getString(R.string.shared_string_ellipsis);
|
||||
}
|
||||
if(filter instanceof NominatimPoiFilter && !((NominatimPoiFilter) filter).isPlacesQuery()) {
|
||||
if (filter instanceof NominatimPoiFilter && !((NominatimPoiFilter) filter).isPlacesQuery()) {
|
||||
// nothing to add
|
||||
} else {
|
||||
name += " " + filter.getSearchArea(next);
|
||||
|
@ -460,7 +460,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
boolean taskAlreadyFinished = currentSearchTask == null || currentSearchTask.getStatus() != Status.RUNNING;
|
||||
boolean enabled = taskAlreadyFinished && location != null &&
|
||||
filter != null && filter.isSearchFurtherAvailable();
|
||||
if(isNameSearch() && !Algorithms.objectEquals(searchFilter.getText().toString(), filter.getFilterByName())) {
|
||||
if (isNameSearch() && !Algorithms.objectEquals(searchFilter.getText().toString(), filter.getFilterByName())) {
|
||||
title = R.string.search_button;
|
||||
// Issue #2667 (2)
|
||||
if (currentSearchTask == null) {
|
||||
|
@ -618,7 +618,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
}
|
||||
|
||||
net.osmand.Location getSearchedLocation() {
|
||||
return searchLocation ;
|
||||
return searchLocation;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -655,7 +655,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
Toast.LENGTH_LONG).show();
|
||||
}
|
||||
amenityAdapter.setNewModel(result);
|
||||
if(showOnMapItem != null) {
|
||||
if (showOnMapItem != null) {
|
||||
showOnMapItem.setEnabled(amenityAdapter.getCount() > 0);
|
||||
}
|
||||
} else {
|
||||
|
@ -954,7 +954,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
builder.setTitle(R.string.edit_filter_save_as_menu_item);
|
||||
final EditText editText = new EditText(this);
|
||||
if(filter.isStandardFilter()) {
|
||||
if (filter.isStandardFilter()) {
|
||||
editText.setText((filter.getName() + " " + searchFilter.getText()).trim());
|
||||
} else {
|
||||
editText.setText(filter.getName());
|
||||
|
@ -970,7 +970,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
|||
PoiUIFilter nFilter = new PoiUIFilter(editText.getText().toString(),
|
||||
null,
|
||||
filter.getAcceptedTypes(), (OsmandApplication) getApplication());
|
||||
if(searchFilter.getText().toString().length() > 0) {
|
||||
if (searchFilter.getText().toString().length() > 0) {
|
||||
nFilter.setSavedFilterByName(searchFilter.getText().toString());
|
||||
}
|
||||
if (app.getPoiFilters().createPoiFilter(nFilter)) {
|
||||
|
|
Loading…
Reference in a new issue