nice-spinner

A nice spinner for Android
授权协议 Apache-2.0 License
开发语言 Java
所属分类 手机/移动开发、 Android UI 组件
软件类型 开源软件
地区 不详
投 递 者 楚涵润
操作系统 Android
开源组织
适用人群 未知
 软件概览

Nice Spinner

NiceSpinner 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.

Usage

The 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"/>
  • Note: change layout_width to at least the width of the largest item on the list to prevent resizing

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);

Listeners

For 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);
        ...
    }
});

Attributes

You can add attributes to customize the view. Available attributes:

name type info
arrowTint color sets the color on the drop-down arrow
hideArrow boolean set whether show or hide the drop-down arrow
arrowDrawable reference set the drawable of the drop-down arrow
textTint color set the text color
dropDownListPaddingBottom dimension set the bottom padding of the drop-down list
backgroundSelector integer set the background selector for the drop-down list rows
popupTextAlignment enum set the horizontal alignment of the default popup text
entries reference set the data source from an array of strings

How to include

With gradle: edit your build.gradle:

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}

dependencies {
    implementation 'com.github.arcadefire:nice-spinner:1.4.4'
}

Or declare it into your pom.xml:

<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

Copyright (C) 2015 Angelo Marchesin.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
  • 一个漂亮的Android Spinner - nice-spinner 转载于:https://www.cnblogs.com/zhujiabin/p/6207078.html

  • 在项目中我们经常会用到Spinner(下拉框)来做选择,常用比如筛选框.选择项 今天给搭建分享一个特别好用的三方框架NiceSpinner的使用方法 第一步.添加依赖库 implementation 'com.github.arcadefire:nice-spinner:1.4.4' 第二步.创建一个xml布局 1.创建Spinner样式 <?xml version="1.0" encoding

  • 1.简介 GitHub地址:https://github.com/arcadefire/nice-spinner   Gradle中添加: allprojects { repositories { ... maven { url "https://jitpack.io" } } } dependencies { implementation

  • 自从我尝试向我的应用程序添加主题以来,我遇到了一个问题.目前我只是使用主题来改变屏幕的背景颜色.问题是,除了屏幕更改为主题颜色的背景外,微调控件中文本的背景也会更改为该颜色.显示下拉菜单时,微调控制器将被块背景颜色替换. 主题定义如下: #ffc0cb #FFE97E 主题在Activity OnCreate中设置: setTheme(R.style.Theme.Yellow); Spinner设

  • import android.content.Context; import android.util.AttributeSet; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; impor

  • 相信大家都有遇到下拉选择这个功能,接下来我把我学习的给大家分享一下。 一、导入依赖 implementation 'com.github.arcadefire:nice-spinner:1.4.4' 二、具体应用 1、接来下就是创建一个xml布局了fragment_restaurant,我个人比较喜欢用constraintlayout约束性布局,我觉得还挺好用的。 <androidx.c

 相关资料
  • nice(改变进程优先顺序) 相关函数 setpriority,getpriority 表头文件 #include<unistd.h> 定义函数 int nice(int inc); 函数说明 nice()用来改变进程的进程执行优先顺序。参数inc数值越大则优先顺序排在越后面,即表示进程执行会越慢。只有超级用户才能使用负的inc 值,代表优先顺序排在前面,进程执行会较快。 返回值 如果执行成功则返

  • nice 改变进程优先顺序 相关函数 setpriority,getpriority 表头文件 #include<unistd.h> 定义函数 int nice(int inc); 函数说明 nice()用来改变进程的进程执行优先顺序。参数inc数值越大则优先顺序排在越后面,即表示进程执行会越慢。只有超级用户才能使用负的inc 值,代表优先顺序排在前面,进程执行会较快。 返回值 如果执行成功则

  • Markdown Nice ( mdnice )是一个支持自定义样式的在线微信Markdown排版工具 支持自定义样式的 Markdown 编辑器 支持微信公众号排版 支持知乎、稀土掘金、博客园和 CSDN 等一系列平台 内容和自定义样式浏览器中实时保存 支持上传图片、脚注、公式

  • 简单、智能、令人愉悦的表单验证方案。内置强大的验证机制,适用于各种简单和复杂的应用场景。 支持自动初始化,完全不用写js也可以验证表单。 支持主题机制,多规则绑定,事件驱动,国际化。 支持主流浏览器(IE6+、Chrome、Firefox、Opera、Safari)。 有详细的中文API文档 在线试试:http://niceue.com/validator/demo/twitter-js.php?theme=simple_right

  • 一、关于 Nice: Nice 是轻量的CSS基础代码库,没有一味的重置,而是 注重各浏览器基础表现 ,减小开发难度。 Nice只重置掉可能产生问题的样式(body、form的默认margin等),并且解决了一些可能产生的兼容性问题,保留和坚持部分浏览器的基础样式,解决部分潜在的问题,提升细节体验。Nice会一直围绕3点开发: 1. 统一的基础表现 2. 更小的开发难度 3. 更好的用户体验 二、

  • Nice-Select 是一个轻量级的 jQuery 插件,它可以用定制化的下拉选项替代本地的选择元素。