在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):arcadefire/nice-spinner开源软件地址(OpenSource Url):https://github.com/arcadefire/nice-spinner开源编程语言(OpenSource Language):Java 89.8%开源软件介绍(OpenSource Introduction):Nice SpinnerNiceSpinner is a re-implementation of the default Android's spinner, with a nice arrow animation and a different way to display its content. It follows the material design guidelines, and it is compatible starting from Api 14. UsageThe usage is pretty straightforward. Add the tag into the XML layout: <org.angmarch.views.NiceSpinner
android:id="@+id/nice_spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"/>
Then use this snippet to populate it with contents: NiceSpinner niceSpinner = (NiceSpinner) findViewById(R.id.nice_spinner);
List<String> dataset = new LinkedList<>(Arrays.asList("One", "Two", "Three", "Four", "Five"));
niceSpinner.attachDataSource(dataset); ListenersFor listening to the item selection actions, you can just use the following snippet: spinner.setOnSpinnerItemSelectedListener(new OnSpinnerItemSelectedListener() {
@Override
public void onItemSelected(NiceSpinner parent, View view, int position, long id) {
// This example uses String, but your type can be any
String item = parent.getItemAtPosition(position);
...
}
}); AttributesYou can add attributes to customize the view. Available attributes:
How to includeWith gradle: edit your allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
implementation 'com.github.arcadefire:nice-spinner:1.4.4'
} Or declare it into your <repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.arcadefire</groupId>
<artifactId>nice-spinner</artifactId>
<version>1.4.4</version>
</dependency> License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论