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: 3 months ago
JSON representation
可以记住历史选项的spinner
- Host: GitHub
- URL: https://github.com/Jasonchenlijian/MemorySpinner
- Owner: Jasonchenlijian
- License: apache-2.0
- Created: 2016-02-01T02:52:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-05-04T09:17:05.000Z (over 6 years ago)
- Last Synced: 2024-06-16T03:31:48.346Z (5 months ago)
- Language: Java
- Homepage:
- Size: 106 KB
- Stars: 148
- Watchers: 11
- Forks: 30
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - MemorySpinner - 可以记住历史选项的spinner (Spinner)
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内容,可空;第二项为所有内容,不能为空。