Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/Jasonchenlijian/MemorySpinner

可以记住历史选项的spinner
https://github.com/Jasonchenlijian/MemorySpinner

Last synced: 1 day ago
JSON representation

可以记住历史选项的spinner

Lists

README

        

# MemorySpinner
- 可以记住历史选项的spinner

## Preview ##
![效果图](https://img.alicdn.com/imgextra/i4/181257671/TB2SphCkXXXXXauXpXXXXXXXXXX_!!181257671.gif)

## Gradle

compile 'com.clj.memoryspinner:memoryspinner:1.1.0'

## Usage

- 在xml中像添加官方Spinner一样添加spinner,并设置自己喜欢的风格


- xml属性说明


















- 在代码中给MemorySpinner设置数据

MemorySpinner memorySpinner = (MemorySpinner) findViewById(R.id.ms);
ArrayList list = new ArrayList<>(Arrays.asList("C_1", "C_2", "C_3", "C_4", "C_5",
"C_6", "C_7", "C_8", "C_9", "C_10", "C_11", "C_12", "C_13", "C_14"));
memorySpinner.setMemoryCount(4);
memorySpinner.setData(null, list);

- 方法说明

`void setMemoryCount(int count)`设置memory数量,默认5

`void setData(ArrayList prepareList, ArrayList normalList)`设置填充的list,第一项为预设memory内容,可空;第二项为所有内容,不能为空。