Search in sources :

Example 6 with OnRadioItemClickListener

use of net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener in project Osmand by osmandapp.

the class SelectIndexesHelper method createSrtmRadioBtn.

private RadioItem createSrtmRadioBtn(final boolean useMeters) {
    int titleId = useMeters ? R.string.shared_string_meters : R.string.shared_string_feet;
    String title = Algorithms.capitalizeFirstLetter(app.getString(titleId));
    RadioItem radioItem = new TextRadioItem(title);
    radioItem.setOnClickListener(new OnRadioItemClickListener() {

        @Override
        public boolean onRadioItemClick(RadioItem radioItem, View view) {
            setUseMetersForAllItems(useMeters);
            updateListItems();
            updateSize();
            return true;
        }
    });
    return radioItem;
}
Also used : RadioItem(net.osmand.plus.widgets.multistatetoggle.RadioItem) TextRadioItem(net.osmand.plus.widgets.multistatetoggle.TextToggleButton.TextRadioItem) OnRadioItemClickListener(net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener) TextRadioItem(net.osmand.plus.widgets.multistatetoggle.TextToggleButton.TextRadioItem) View(android.view.View)

Aggregations

View (android.view.View)6 OnRadioItemClickListener (net.osmand.plus.widgets.multistatetoggle.RadioItem.OnRadioItemClickListener)6 RadioItem (net.osmand.plus.widgets.multistatetoggle.RadioItem)5 TextRadioItem (net.osmand.plus.widgets.multistatetoggle.TextToggleButton.TextRadioItem)5 TextView (android.widget.TextView)4 ImageView (android.widget.ImageView)2 LayoutInflater (android.view.LayoutInflater)1 ViewGroup (android.view.ViewGroup)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 MapActivity (net.osmand.plus.activities.MapActivity)1