use of net.osmand.plus.widgets.multistatetoggle.RadioItem in project Osmand by osmandapp.
the class SelectIndexesHelper method showSrtmTypeSelectionDialog.
private void showSrtmTypeSelectionDialog() {
SrtmDownloadItem srtmItem = (SrtmDownloadItem) downloadItem;
final RadioItem meterBtn = createSrtmRadioBtn(true);
final RadioItem feetBtn = createSrtmRadioBtn(false);
List<RadioItem> radioItems = new ArrayList<>();
radioItems.add(meterBtn);
radioItems.add(feetBtn);
SelectableItem<DownloadItem> preview = createSrtmSelectableItem(srtmItem);
dialog = ModeSelectionBottomSheet.showInstance(activity, preview, radioItems, true);
dialog.setDialogStateListener(new DialogStateListener() {
@Override
public void onDialogCreated() {
dialog.setTitle(app.getString(R.string.srtm_unit_format));
dialog.setPrimaryDescription(app.getString(R.string.srtm_download_single_help_message));
updateSize();
dialog.setSelectedMode(useMetricByDefault ? meterBtn : feetBtn);
}
@Override
public void onCloseDialog() {
resetUseMeters();
}
});
dialog.setOnApplySelectionListener(getOnApplySelectionListener(listener));
}
use of net.osmand.plus.widgets.multistatetoggle.RadioItem 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 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 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 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