Skip to content

一个可以相互获取键值信息的下拉控件

Notifications You must be signed in to change notification settings

andy7076/KeyValueSpinner

Repository files navigation

KeyValueSpinner

一个可以获每个Item键值信息的下拉控件 MaterialDesign风格

Preview

How to

<com.andy7.myviewdemo.widget.MySpinner
    android:id="@+id/myspinner"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

</com.andy7.myviewdemo.widget.MySpinner>


HashMap hashMap = new HashMap<>();
hashMap.put(1, "GREEN");
hashMap.put(2, "RED");
hashMap.put(3, "BLUE");
myspinner.setHashMap(hashMap);
myspinner.setOnSelectorItemKeyValue(new MySpinner.OnSelectorItemKeyValue() {
    @Override
    public void obtainKeyValue(int key, String value) {
        Log.i(TAG, "obtainKeyValue: " + key + "---->" + value);
    }
});

Performance

每个Spinner选项拥有键值信息,当选择选项时可以获得当前选项对应的键值信息,而不是简单的索引位置

About

一个可以相互获取键值信息的下拉控件

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages