GithubHelp home page GithubHelp logo

wongzy / recyclerwheelview Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 6.0 216 KB

An efficient Android WheelView based on RecyclerView, which is easy to use, and it can customized by yourself.

License: MIT License

Kotlin 100.00%
recyclerview android wheelview

recyclerwheelview's Introduction

RecyclerWheelView

中文文档

An efficient Android WheelView based on RecyclerView, which is easy to use, and it can customized by yourself.

Getting Started

First of all, this lib is based on androidx, if your library do not migrate to androidx, there might be some problems if you used this.

If you want to use this library, you should add those to your module's gradle

implementation 'cn.wongzhenyu:recyclerwheelview:0.0.3'
implementation 'androidx.recyclerview:recyclerview:XXX'

Because RecyclerWheelView have dependency of recyclerview(library of androidx), and to avoid the conflicts of library version, I used compileonly to import recyclerview library, so you should add recyclerview by yourself.

Result

there are two examples' results about recyclerwheelview in this project, if you used recyclerwheelview, you can make this effect easily.

String wheel view

The attributes of StringWheelView and its explain as follows:

attribute name explain example
wheelSelectedItemTextColor the color of selected String app:wheelSelectedItemTextColor="@color/colorAccent"
wheelSelectedTextSize the size of selected String app:wheelSelectedTextSize="18sp"
wheelSelectedItemBackground the background of selected String item(can use custom drawable) app:wheelSelectedItemBackground="@drawable/string_selected_wheel_bg"
wheelNormalTextSize the size of unselected String app:wheelNormalTextSize="15sp"
wheelNormalTextColor the color of unselected String app:wheelNormalTextColor="@color/colorPrimaryDark"
wheelNormalItemBackground the background of unselected String item(can use costom drawable) app:wheelNormalItemBackground="@drawable/string_nor_wheel_bg"
wheelItemHeight the height of String item, attention, the height of selected String item and unselected String item is same app:wheelItemHeight="100dp"

Custom wheel view

You can customize RecyclerWheelView just like recycler view, you can see how it realize in this demo project.

recyclerwheelview's People

Contributors

wongzy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

recyclerwheelview's Issues

没有办法 设置默认的位置吗?

现在默认位置是第一个位置,

我想设置为第n个位置 咋弄呢

比如一个日期选择器 月份 1-12月份,但是现在是9月份,我列表第一次show出来 我想展示默认选中是9月份

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.