small fixes

This commit is contained in:
Nazar-Kutz 2020-06-26 09:52:43 +03:00
parent c4214d0afc
commit a1215c9a0c
3 changed files with 5 additions and 2 deletions

View file

@ -45,6 +45,7 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import static net.osmand.plus.search.listitems.QuickSearchBannerListItem.INVALID_ID;
import static net.osmand.search.core.ObjectType.POI_TYPE;
import static net.osmand.plus.search.listitems.QuickSearchBannerListItem.ButtonItem;
@ -240,7 +241,7 @@ public class QuickSearchListAdapter extends ArrayAdapter<QuickSearchListItem> {
TextView title = v.findViewById(R.id.title);
title.setText(buttonItem.getTitle());
ImageView icon = v.findViewById(R.id.icon);
if (buttonItem.getIconId() != -1) {
if (buttonItem.getIconId() != INVALID_ID) {
icon.setImageResource(buttonItem.getIconId());
icon.setVisibility(View.VISIBLE);
} else {

View file

@ -9,6 +9,8 @@ import java.util.List;
public class QuickSearchBannerListItem extends QuickSearchListItem {
public static final int INVALID_ID = -1;
private List<ButtonItem> buttons;
public QuickSearchBannerListItem(OsmandApplication app) {

View file

@ -296,7 +296,7 @@ public class WikipediaPlugin extends OsmandPlugin {
} else {
QuickSearchBannerListItem banner = new QuickSearchBannerListItem(app);
banner.addButton(QuickSearchListAdapter.getIncreaseSearchButtonTitle(app, phrase),
null, -1, new View.OnClickListener() {
null, QuickSearchBannerListItem.INVALID_ID, new View.OnClickListener() {
@Override
public void onClick(View v) {
searchFragment.increaseSearchRadius();