All Projects → jhonnyx2012 → Horizontalpicker

jhonnyx2012 / Horizontalpicker

DatePicker horizontal con selección smooth por día para Android.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Horizontalpicker

Rc Datetime Picker
React component for datetime picker by Moment.js
Stars: ✭ 85 (-26.72%)
Mutual labels:  date, datetime, picker, datepicker
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (+362.07%)
Mutual labels:  date, datetime, picker, datepicker
react-calendar-datetime-picker
A simple and fast date and time picker component for React
Stars: ✭ 58 (-50%)
Mutual labels:  datetime, date, datepicker, picker
imrc-datetime-picker
(Improved) React component datetime picker by momentjs 📆
Stars: ✭ 21 (-81.9%)
Mutual labels:  datetime, date, datepicker, picker
inquirer-datepicker-prompt
Datepicker prompt for inquirer.js
Stars: ✭ 24 (-79.31%)
Mutual labels:  datetime, date, datepicker
Datepicker
A Date Picker with Calendar for iPhone and iPad Apps.
Stars: ✭ 103 (-11.21%)
Mutual labels:  date, picker, datepicker
Mdatepickerview
Quick and easy date picker.
Stars: ✭ 373 (+221.55%)
Mutual labels:  date, picker, datepicker
Calendarview
An Easy to Use Calendar for iOS (Swift 5.0)
Stars: ✭ 429 (+269.83%)
Mutual labels:  date, datetime, datepicker
Jedate
jeDate V6.5.0 是一款原生JS开发的 不依赖任何第三方库 大众化的日期控件,她身兼多职,虽不是万能的,但是她却是功能强大多样的美少女,她除了包含 单双面板、区域选择、 多语言、日历固定、有效无效日期、日期时间戳转换、日期加减、限制时分秒、初始化日期加减N、日期标注点、设定年月(YYYY-MM)、日期范围限制、开始日期设定、自定义日期格式、当天的前后若干天返回、时分秒选择、智能响应、自动纠错、节日识别,操作等常规功能外,根据不同的日期格式,显示不同内容,还拥有更多趋近完美的解决方案。更多的是需要你与她的亲密接触与呵护!
Stars: ✭ 433 (+273.28%)
Mutual labels:  date, datetime, datepicker
Circularpicker
CircularPicker is helpful for creating a controller aimed to manage any calculated parameter.
Stars: ✭ 73 (-37.07%)
Mutual labels:  datetime, picker, datepicker
Vue Datetime
Mobile friendly datetime picker for Vue. Supports date and datetime modes, i18n and more.
Stars: ✭ 928 (+700%)
Mutual labels:  date, datetime, datepicker
Angular Bootstrap Datetimepicker
Native Angular date/time picker component styled by Twitter Bootstrap
Stars: ✭ 1,289 (+1011.21%)
Mutual labels:  datetime, picker, datepicker
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+818.97%)
Mutual labels:  date, datetime, datepicker
vue-timeselector
🕒 Simply customizable powerful time picker for Vue.js
Stars: ✭ 41 (-64.66%)
Mutual labels:  datetime, date, picker
Zebra datepicker
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin
Stars: ✭ 367 (+216.38%)
Mutual labels:  date, datetime, datepicker
react-picky-date-time
A react component for date time picker. Online demo examples
Stars: ✭ 41 (-64.66%)
Mutual labels:  date, datepicker, picker
React Picky Date Time
A react component for date time picker. Online demo examples
Stars: ✭ 31 (-73.28%)
Mutual labels:  date, picker, datepicker
jquery-datepicker
A full-featured datepicker jquery plugin
Stars: ✭ 35 (-69.83%)
Mutual labels:  datetime, datepicker, picker
popoPicker
popoPicker是一个移动端3D滚轮日期时间和单项的选择器,支持无限循环滚动,不依赖第三方库
Stars: ✭ 26 (-77.59%)
Mutual labels:  date, datepicker, picker
Vue Ctk Date Time Picker
VueJS component to select dates & time, including a range mode
Stars: ✭ 707 (+509.48%)
Mutual labels:  date, picker, datepicker

Horizontal Picker

What is this?

HorizontalPicker is a custom-build Android View used for choosing dates (similar to the native date picker) but draws horizontally into a vertically narrow container. It allows easy day picking using the horizontal pan gesture.

Too see it in action, download the demo app to try it out.

This is what it looks like.

Screenshot_1 Screenshot_2

Features

  • Date selection using a smooth swipe gesture
  • Date selection by clicking on a day slot
  • Date selection from code using the HorizontalPicker java object
  • Month and year view
  • Today button to jump to the current day
  • Localized day and month names
  • Configurable number of generated days (default: 120)
  • Configurable number of offset generated days before the current date (default: 7)
  • Customizable set of colors, or themed through the app theming engine

Note: This library uses the JodaTime library to work with days.

Requirements

  • Android 4.1 or later (Minimum SDK level 16)
  • Android Studio (to compile and use)
  • Eclipse is not supported

Getting Started

In your app module's Gradle config file, add the following dependency:

dependencies {
    compile 'com.github.jhonnyx2012:horizontal-picker:1.0.6'
}

Then to include it into your layout, add the following:

<com.github.jhonnyx2012.horizontalpicker.HorizontalPicker
    android:id="@+id/datePicker"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

In your activity, you need to initialize it and set a listener, like this:

public class MainActivity extends AppCompatActivity implements DatePickerListener {
    @Override
    protected void onCreate(@Nullable final Bundle savedInstanceState) {
        // setup activity
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // find the picker
        HorizontalPicker picker = (HorizontalPicker) findViewById(R.id.datePicker);

        // initialize it and attach a listener
        picker
            .setListener(this)
            .init();
    }

    @Override
    public void onDateSelected(@NonNull final DateTime dateSelected) {
        // log it for demo
        Log.i("HorizontalPicker", "Selected date is " + dateSelected.toString());
    }
}

Finally, you can also configure the number of days to show, the date offset, or set a date directly to the picker. For all options, see the full configuration below.

    // at init time
    picker
        .setListener(listner)
        .setDays(20)
        .setOffset(10)
        .setDateSelectedColor(Color.DKGRAY)
        .setDateSelectedTextColor(Color.WHITE)
        .setMonthAndYearTextColor(Color.DKGRAY)
        .setTodayButtonTextColor(getColor(R.color.colorPrimary))
        .setTodayDateTextColor(getColor(R.color.colorPrimary))
        .setTodayDateBackgroundColor(Color.GRAY)
        .setUnselectedDayTextColor(Color.DKGRAY)
        .setDayOfWeekTextColor(Color.DKGRAY)
        .setUnselectedDayTextColor(getColor(R.color.textColor))
        .showTodayButton(false)
        .init();

    // or on the View directly after init was completed
    picker.setBackgroundColor(Color.LTGRAY);
    picker.setDate(new DateTime().plusDays(4));
Copyright 2017 Jhonny Barrios

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].