Code Monkey home page Code Monkey logo

datepicker's Introduction

Android Arsenal

You can jump to EN README after CN if you don't read chinese.


Here is begin of CN document.

日历选择器

灰常灰常简单的Android日历选择器~~(注:暂不支持横屏操作,农历节气有一到两天的误差)~~

##Android API 版本要求 API 1

API 11

##版本迭代 ###1.0.0 beta

  • 横屏暂未考虑,竖屏暂未发现问题,项目使用中

###1.1.2 release

  • 增加日期选择时弹性动画
  • 修复设置主色调后农历颜色不改变BUG

###1.1.3 release

  • 不管是横屏还是竖屏,你必须总为该控件指定一个确切宽度比如320dp或者填充父布局,大多数情况下该日期选择器都是在dialog中使用,默认dialog宽度是填充屏幕宽度的,你可以参照Demo来更改diaolog的宽度。

##预览图

##功能简介

  • 支持多选返回结果
  • 支持主色调定制
  • 农历隐藏

更多的功能方法可查看IPick.java

##如何集成到项目 ###方式一 直接从maven center compile

compile 'cn.aigestudio.datepicker:DatePicker:1.1.3'

###方式二 手动导入 ####步骤一 将DatePicker这个Module导入你的Project中

####步骤二 在你Project的settings.gradle文件中增加如下内容:

include ':DatePicker'

这里要注意的是在一些gradle版本中需要以英文逗号的方式追加Module:

include ':YourMoudle',':DatePicker'

添加后当出现“sycn now”提示时点击同步即可

####步骤三 在你项目的build.gradle文件的dependencies区域中添加如下内容:

compile project(':DatePicker')

##如何使用 一旦将DatePicker集成到项目后你便可以像普通控件那样使用它。

如果你需要获取DatePicker日期选择后返回的数据你需要为DatePicker设置一个OnDateSelected回调接口:

mDatePicker = (DatePicker) findViewById(R.id.main_dp);
mDatePicker.setOnDateSelected(new OnDateSelected() {
    @Override
    public void selected(List<String> date) {
        // date为选择的日期字符串列表
    }
});

选择后的日期将会以列表的形式返回,日期字符串的格式为:

yyyy-MM-dd

比如:2015-3-28


这里开始是英文文档

#DatePicker A simple date picker for android~~(note:it doesn't work with horizontal view yet,and it has one or two days deviation of solar term)~~

##Android API Needs API 1

API 11

##Version ###1.0.0 beta

  • Doesn't work with horizontal view yet,but vertical right.

###1.1.2 release

  • Add animation when date picked.
  • Bugfix:color does not change when main color set.

###1.1.3 release

  • You must specify a exactly width like 320dp or match_parent whether portrait or landscape, In most cases the datepicker is use with dialog, and it will match screen in default mode, you can refer to demo to change dialog width.

##Preview

##Function

  • multiple-pick for date
  • specify primary colour
  • hide lunar display

You can see IPick.java for more help.

##How to add to your project ###Method A:compile from maven center

compile 'cn.aigestudio.datepicker:DatePicker:1.1.3'

###Method B:Help yourself ####step 1 import DatePicker lib to your project

####step 2 Add something like below in your settings.gradle file of project:

include ':DatePicker'

Note that in some other gradle version you many add module like below:

include ':YourMoudle',':DatePicker'

Click 'sycn now' when it appear after module add.

####step 3 Add something like below in your build.gradle file of project:

compile project(':DatePicker')

##Usage Once you add DatePicker to your project you can use it like other views which android define.

You need to set a OnDateSelected callback if you want to obtain dates when dates picked.

mDatePicker = (DatePicker) findViewById(R.id.main_dp);
mDatePicker.setOnDateSelected(new OnDateSelected() {
    @Override
    public void selected(List<String> date) {
        // Get dates here
    }
});

The dates you picker will return in the form of string list,format of string like below:

yyyy-MM-dd

For example:2015-3-28


#LICENSE Copyright 2014-2015 AigeStudio(https://github.com/AigeStudio)

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.

datepicker's People

Contributors

aigestudio avatar

Watchers

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