Giter Club home page Giter Club logo

android-pickerview's Introduction

Android-PickerView

pickerview ###这是一个兼容手机和电视(焦点选择)的高仿IOS风格的选择器。

###Gradle依赖

compile 'com.sunjian:android-pickview-lib:1.0.0'

示例图:

  • 手机日期

  • 手机选项(根据集合显示,这里以地址为例)

![](https://github.com/crazysunj/Android-PickerView/blob/master/picture/optionsPhone .png)

  • 电视日期(红色表示聚焦,颜色可修改)

  • 电视选项

####几个小用法

  • 若继承已有对话框,想调整布局的位置,不改变布局的数量,只需要重写
	/**
     * 如果想调整布局可通过继承,重写该方法,但是id不能变
     * 若需求较为复杂,请自己自定义dialog
     */
    @LayoutRes
    protected int getResLayoutId() {
        return R.layout.pickerview_tv_options;
    }
  • 若继承基类,请重写以下方法,当然id是固定的,具体自己看,哈哈。
	//关于wheelview的id都是规定的,year,month,day,hour,min
    @IdRes
    protected abstract int getPickerViewId();
  • WheelView支持以下属性
//位置,支持左中右
<attr name="gravity">
     <enum name="center" value="17"/>
     <enum name="left" value="3"/>
     <enum name="right" value="5"/>
</attr>
//字体大小
<attr name="textSize" format="dimension"/>
//上下字体颜色
<attr name="textColorOut" format="color"/>
//中间字体颜色
<attr name="textColorCenter" format="color"/>
//聚焦字体颜色,用于聚焦类APP
<attr name="highLight_textColorCenter" format="color"/>
//分割线颜色
<attr name="dividerColor" format="color"/>
//是否用于聚焦
<attr name="isRequestFocus" format="boolean"/>
//是否循环
<attr name="isCyclic" format="boolean"/>
//单位
<attr name="lable" format="string"/>
  • 初始化都以传bundle的形式传入,对话框都是继承于dialogfragment,方便管理。

好了,大家有问题直接在github上提问吧,也可以直接加我QQ387953660,喜欢的朋友赏颗星星吧!

android-pickerview's People

Contributors

crazysunj avatar

Watchers

 avatar

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.