nice-spinner icon indicating copy to clipboard operation
nice-spinner copied to clipboard

Maybe Spinner Text Formatter can be upgraded

Open houyuehai opened this issue 7 years ago • 3 comments

Good library,Thinks. my data may not be String, it may be a student object, I want to show the name of the Student, but when I choose, I want to get the ID of the student from the listener. Because name is what the user sees, and ID is what the server needs. Maybe Spinner Text Formatter can be upgraded.

public interface SpinnerTextFormatter < T > { Spannable format(T var1); }

houyuehai avatar Jan 14 '19 03:01 houyuehai

and if return null,do not draw item

houyuehai avatar Jan 16 '19 06:01 houyuehai

It merged but still only can be use for String, can not override

 SimpleSpinnerTextFormatter textFormatter = new SimpleSpinnerTextFormatter() {
            @Override
            public Spannable format(Object item) {
                Person person = (Person) item;
                return new SpannableString(person.getName() + " " + person.getSurname());
            }
        };

Still force me to Override

            @Override
            public Spannable format(String text) {
                return super.format(text);
            }

yusufceylan avatar Mar 02 '19 11:03 yusufceylan

This should be possible now: aa42151f2578598a3bde8cf94c88eeea62f5c30d.

arcadefire avatar May 24 '19 14:05 arcadefire