Code Monkey home page Code Monkey logo

timepickerdialog's Introduction

Welcome to follow me on GitHub

GitHub: https://github.com/JZXiang


中文版文档

TimePickerDialog

An Android time picker library.
Easy to use.
Support five types.
Able to set the minimun and maximum millseconds.

ChangeLog
Download APK

gradle, latest version:

   compile 'com.jzxiang.pickerview:TimePickerDialog:1.0.1'

Demo picture

An example configuration

                    mDialogAll = new TimePickerDialog.Builder()
                                    .setCallBack(this)
                                    .setCancelStringId("Cancel")
                                    .setSureStringId("Sure")
                                    .setTitleStringId("TimePicker")
                                    .setYearText("Year")
                                    .setMonthText("Month")
                                    .setDayText("Day")
                                    .setHourText("Hour")
                                    .setMinuteText("Minute")
                                    .setCyclic(false)
                                    .setMinMillseconds(System.currentTimeMillis())
                                    .setMaxMillseconds(System.currentTimeMillis() + tenYears)
                                    .setCurrentMillseconds(System.currentTimeMillis())
                                    .setThemeColor(getResources().getColor(R.color.timepicker_dialog_bg))
                                    .setType(Type.ALL)
                                    .setWheelItemTextNormalColor(getResources().getColor(R.color.timetimepicker_default_text_color))
                                    .setWheelItemTextSelectorColor(getResources().getColor(R.color.timepicker_toolbar_bg))
                                    .setWheelItemTextSize(12)
                                    .build();

Thanks

android-wheel

License

Copyright 2016 JZXiang

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.

timepickerdialog's People

Contributors

jzxiang avatar mayank-ism avatar

Stargazers

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

Watchers

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

timepickerdialog's Issues

[BUG]设置Type.HOURS_MINS产生的bug

设置 Type.HOURS_MINS 类型,并且设置 setCurrentMillseconds(System.currentTimeMillis()) 之后,我选择了某个时间,比如 19:02, 接口中返回的时间戳 millseconds 应该是 2017 年3 月 30 日 19:02 的时间戳, 可是得到的结果却是 1 月 1 日 19:02 的时间戳。

How to Imoprt into AS

how to import this project in to android studio?I get error:could not find property 'PROJ_GROUP' on project ':TimepickerDialog'.

重大bug

怎么修改默认时间你默认是2015年,我如何设置成1990年

Custom Date Object

I want to put custom time object (one week, one day etc) how can achieve?

tv_title null

在AS中引用,打断点设置标题文本是异常,显示tv_title 为null

分钟的设置

如果我想把分钟间隔设置成20分钟一个 比如00 20 40 应该怎么改

建议

1.日期貌似最大只支持50年,比如我设置最小日期是1900年1月1日最大的只到1950年1月1日,设置的现在时间无效了
2.现在不能设置最大时间

这两问题导致这个控件无法应用在选择生日的用途上,希望尽快加入

setMinMillseconds建议能控制到分钟

现在设置setMinMillseconds后,默认的小时数是min值+1.无法控制到分钟。

比如我设置setMinMillseconds为12:30分,跳出来的dialog是从13:00开始的,无法选择到12:30-13:00之间的时间。

Thanks

建议

希望可以设置最大时间。

不能时间回显么?

选择一个时间,有没有办法在下次点击时回显上次选择的时间啊? 我现在都是重新new,有没有更好的方法

我导入到AS后,Library库资源文件冲突。

我导入到AS后,Library库资源文件冲突。
Library库中的String资源文件有个app_name,跟我项目中的app_name冲突,导致我的APP名称变成了Library,请问这个怎么解决呢?

闪退

在弹窗弹出前快速点击两次程序闪退

bug

如果我这样设置,代码如下:

long tenYears = 60L * 365 * 1000 * 60 * 60 * 24L;
new TimePickerDialog.Builder()
.setTitleStringId("选择生日")
.setThemeColor(ContextCompat.getColor(this, R.color.login_btn_bg_color))
.setMinMillseconds(System.currentTimeMillis() - tenYears)
.setMaxMillseconds(System.currentTimeMillis() )
.setCurrentMillseconds(System.currentTimeMillis())
.setType(Type.YEAR_MONTH_DAY)
.setCallBack(listener)
.build()
.show(getSupportFragmentManager(), "year_month_day");

然后出来的是这样的:

字体居中bug

BaseLine的Y坐标如果这样计算centeYLine + dip2px(getContext(), textHeight) / 2 会导致问题偏上一点点.
应该这样计算 centeYLine + ((fontMetrics.bottom - fontMetrics.top) / 2 - fontMetrics.bottom)

建议控件加入ID

如果一个界面分别调用两次这个控件,例如设置开始时间和结束时间,在没有ID的情况下需要写入两个callback。可以在builder里面暴露出一个setId(int id)的方法,在回调方法里面加上id这个参数,这样就可以啦。

u miss this in your TimeWheel.java

    int monthCount = mMonthAdapter.getItemsCount();
    if (month.getCurrentItem() >= monthCount) {
        month.setCurrentItem(monthCount - 1, true);
    }

24小时制问题

show 的时候 ,比如现在是15.30 ,那么设置setMinMillseconds()为当前秒数,但是show的时候显示的是3.30,并不是显示在15.30,不知说明白没有

建议,关于库的可见选项以及特殊日期

感谢作者提供这么好用的库,以下建议希望采纳:

1、是否已有参数或者可以提供配置参数,配置可看到的选项为5项,现在都是7项,就是限制可选区域的高度

举例:
现在我选中的分钟是03,一列下来我可以看到00、01、02、03、04、05、06,但UI交互想实现的是显示01、02、03、04、05就好

2、是否已有参数或者可以提供配置参数,配置某些特殊的日期显示的文字

举例:
有需求是需要配置不同的日期,要显示为今天、明天、后天,或者某些节日的名称,以让用户更方便的可以选择到一些特殊的日期

所有title的默认值是空

上一个版本中加入了各种title的自定义,如setCancelStringId、setTitleStringId等。
但是这些title的默认值现在都变成空,必须要赋值。
建议给一个默认值。这样就不需要每次调用都给这些title string赋值。

Thanks

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.