use of net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener in project Osmand by osmandapp.
the class MultiStateToggleButton method createBtn.
private void createBtn(@NonNull final _Radio item) {
LayoutInflater inflater = UiUtilities.getInflater(app, nightMode);
ViewGroup button = (ViewGroup) inflater.inflate(getRadioItemLayoutId(), container, false);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
OnRadioItemClickListener l = item.getListener();
if (l != null && l.onRadioItemClick(item, container)) {
setSelectedItem(item);
}
}
});
initItemView(button, item);
buttons.add(button);
container.addView(button);
}
use of net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener in project Osmand by osmandapp.
the class HikingRoutesFragment method createRadioButton.
private TextRadioItem createRadioButton(@NonNull String value) {
String name = AndroidUtils.getRenderingStringPropertyValue(app, value);
TextRadioItem item = new TextRadioItem(name);
item.setOnClickListener(new OnRadioItemClickListener() {
@Override
public boolean onRadioItemClick(RadioItem radioItem, View v) {
pref.set(value);
previousValue = value;
View view = getView();
if (view != null) {
setupHeader(view);
setupTypesCard(view);
}
refreshMap();
return true;
}
});
return item;
}
use of net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener in project Osmand by osmandapp.
the class CycleRoutesFragment method createRadioButton.
private TextRadioItem createRadioButton(@NonNull CommonPreference<Boolean> pref, boolean enabled, int titleId) {
TextRadioItem item = new TextRadioItem(getString(titleId));
item.setOnClickListener(new OnRadioItemClickListener() {
@Override
public boolean onRadioItemClick(RadioItem radioItem, View view) {
pref.set(enabled);
View mainView = getView();
if (mainView != null) {
setupTypesCard(mainView);
}
MapActivity mapActivity = (MapActivity) getMyActivity();
if (mapActivity != null) {
mapActivity.refreshMapComplete();
mapActivity.getMapLayers().updateLayers(mapActivity);
}
return true;
}
});
return item;
}
use of net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener in project Osmand by osmandapp.
the class RouteLineColorCard method createMapThemeButton.
private TextRadioItem createMapThemeButton(final boolean isNight) {
TextRadioItem item = new TextRadioItem(app.getString(!isNight ? DAY_TITLE_ID : NIGHT_TITLE_ID));
item.setOnClickListener(new OnRadioItemClickListener() {
@Override
public boolean onRadioItemClick(RadioItem radioItem, View view) {
selectedMapTheme = isNight ? DayNightMode.NIGHT : DayNightMode.DAY;
changeMapTheme(selectedMapTheme);
updateDescription();
return true;
}
});
return item;
}
use of net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener in project Osmand by osmandapp.
the class SplitIntervalBottomSheet method createRadioButton.
private TextRadioItem createRadioButton(final GpxSplitType splitType, int titleId) {
String title = app.getString(titleId);
TextRadioItem item = new TextRadioItem(title);
item.setOnClickListener(new OnRadioItemClickListener() {
@Override
public boolean onRadioItemClick(RadioItem radioItem, View view) {
selectedSplitType = splitType;
updateSlider();
return true;
}
});
return item;
}
Aggregations