All Projects → rspective → PagerDatePicker

rspective / PagerDatePicker

Licence: Apache-2.0 license
PagerDatePicker for Android

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to PagerDatePicker

mithril-datepicker
Pick a date! But only if you're using Mithril. (component for Mithril.js ^v1.0)
Stars: ✭ 23 (-71.95%)
Mutual labels:  datepicker
react-native-datepicker-modal
React Native DatePicker Modal Component for iOS/Android
Stars: ✭ 48 (-41.46%)
Mutual labels:  datepicker
react-picky-date-time
A react component for date time picker. Online demo examples
Stars: ✭ 41 (-50%)
Mutual labels:  datepicker
qing
🍧一个UI组件库。包括 { 日期选择器组件 } { 时间选择器组件 } { 分页组件 } { 树组件 } { 级联选择器组件 } { 表单组件 } 等,ES6语法编写,原生模块化
Stars: ✭ 71 (-13.41%)
Mutual labels:  datepicker
PersianDateRangePicker
Select range of date and time in the Persian
Stars: ✭ 41 (-50%)
Mutual labels:  datepicker
WheelPicker
A wheel picker for Android, support DateWheelPicker, TimeWheelPicker(滚轮控件,日期、时间选择器,省市区三级联动)
Stars: ✭ 33 (-59.76%)
Mutual labels:  datepicker
jquery-date-dropdowns
A simple, customisable jQuery datepicker plugin to dynamically generate separate "day", "month" and "year" dropdowns, and provide a formatted date string for form submission
Stars: ✭ 42 (-48.78%)
Mutual labels:  datepicker
DatePicker
html价格日历控件
Stars: ✭ 21 (-74.39%)
Mutual labels:  datepicker
react-native-daterange-picker
A React Native component for picking date ranges or single dates.
Stars: ✭ 86 (+4.88%)
Mutual labels:  datepicker
vue-pikaday
VueJS wrapper component for Pikaday datepicker
Stars: ✭ 37 (-54.88%)
Mutual labels:  datepicker
svelty-picker
Simple date & time picker in svelte
Stars: ✭ 38 (-53.66%)
Mutual labels:  datepicker
MCDatepicker
A vanilla JavaScript Datepicker
Stars: ✭ 69 (-15.85%)
Mutual labels:  datepicker
SBDropDown
Simple DropDown framework ...
Stars: ✭ 21 (-74.39%)
Mutual labels:  datepicker
popoPicker
popoPicker是一个移动端3D滚轮日期时间和单项的选择器,支持无限循环滚动,不依赖第三方库
Stars: ✭ 26 (-68.29%)
Mutual labels:  datepicker
ionic4-date-picker
Calendar date picker for Ionic4 apps
Stars: ✭ 24 (-70.73%)
Mutual labels:  datepicker
flutter date picker
A Cupertino style date picker for Android and IOS
Stars: ✭ 78 (-4.88%)
Mutual labels:  datepicker
XPopupExt
XPopup扩展功能库,基于XPopup强大的弹窗能力和PickerView的选择器逻辑,封装了时间选择器弹窗、城市选择器弹窗和条件选择器。
Stars: ✭ 248 (+202.44%)
Mutual labels:  datepicker
react-datepicker
A Datepicker built using Tailwind and react-popper
Stars: ✭ 31 (-62.2%)
Mutual labels:  datepicker
nepali date picker
Material Style Date Picker with Bikram Sambat(Nepali) Calendar Support. Supports both Android and ios.
Stars: ✭ 30 (-63.41%)
Mutual labels:  datepicker
vue3-datepicker
Simple datepicker component for Vue 3
Stars: ✭ 93 (+13.41%)
Mutual labels:  datepicker

PagerDatePicker

Version: 1.2.0

License Android Arsenal

Description

PagerDatePicker is a library for Android which allows to setup horizontal (for now;)) date list picker. It is a combination of few main Android components:

  • android.support.v7.widget.RecyclerView
  • android.support.v4.view.ViewPager
  • android.support.v4.app.FragmentStatePagerAdapter
  • android.support.v7.widget.RecyclerView.Adapter

Notice that PagerDatePicker is a project under development.

Welcome to fork and pull request.

Features

XML attributes:

Support date format MM-dd-yyyy

    <attr name="date_start" format="string"/>
    <attr name="date_end" format="string"/>
    <attr name="default_day_selection" format="string"/>

API

  • Animations You can assign animation for selected day. This could be set for whole date item view or just for single one. To achieve this you have to load and assign animation to the adapter:
dateAdapter.setCurrentViewAnimation(AnimationUtils.loadAnimation(CONTEXT, ANIM_ID_FOR_YOUR_ANIMATION));

To select which view has to be animated you have to override below method in your ViewHolder

protected abstract View getCurrentViewToAnimate();

Deafult and custom date adapter

If default date item is not enough for you don't worry, you can create your own custom date adapter where you can apply default style/view/functions to your date item.

Things to know:
  • You have to create your custom adapter which has to extend AbsDateAdapter
  • Your view holder has to extend AbsDateItemHolder
  • Implement required methods and add your own if you need

To check details, please see demo app.

Screenshot

image

Get it on Google Play

Quick Setup(Basic Usage)

1.Integration
Gradle
dependencies {
    compile 'pl.rspective.pagerdatepicker:pagerdatepicker:1.2.0'
}
2.Usage (for default date adapter)

Please note, that supported date format is MM-dd-yyyy

1. Add picker and pager to your view
<pl.rspective.pagerdatepicker.view.DateRecyclerView
    android:id="@+id/date_list"
    android:layout_width="match_parent"
    android:layout_height="100dp"
    android:background="#ff343434"/>

<android.support.v4.view.ViewPager
   android:id="@+id/pager"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:layout_below="@id/date_list"/>
2. Add item decoration for your picker (OPTIONAL)

You can do this in two ways:

dateList.addItemDecoration(new RecyclerViewInsetDecoration(this);

Default insets is 1dp

dateList.addItemDecoration(new RecyclerViewInsetDecoration(this, R.dimen.date_card_insets));

Add your own insets value

3. Create deafult adapter with date range and assign it to our picker
dateList.setAdapter(new DefaultDateAdapter(start, end));
4. Init pager adapter and assign it to our datepicker
DatePagerFragmentAdapter fragmentAdapter = new DatePagerFragmentAdapter(getSupportFragmentManager(), dateList.getDateAdapter()) {
    @Override
    protected Fragment getFragment(int position, long date) {
        return ...
    }
};

pager.setAdapter(fragmentAdapter);
dateList.setPager(pager);
5. We are almost there. Now you have to assign a listener to your picker
dateList.setDatePickerListener(new DateRecyclerView.DatePickerListener() {
    @Override
    public void onDatePickerItemClick(DateItem dateItem, int position) {
        //User clicked date item from top date picker
    }

    @Override
    public void onDatePickerPageSelected(int position) {
        //User changed date using swipe (left/right)
    }

    @Override
    public void onDatePickerPageStateChanged(int state) {
        //User changed page
    }

    @Override
    public void onDatePickerPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
        //User changed page
    }
});

If you want to change the default color, just override below colors in your colors.xml:

<color name="date_item_unselected_indicator">#ff5c5c5c</color>
<color name="date_item_selected_indicator">#ffff353b</color>

<color name="date_item_background">#ff373737</color>
<color name="date_item_month_name">#ffd5d5d5</color>
<color name="date_item_day_name">#ff9a9a9a</color>
<color name="date_item_day">#FFFFFFFF</color>

If you want to see more details, go ahead and check the demo!

Assets

Demo launcher icon was made by jerrylow

License

Copyright 2015 RSPECTIVE P RYCHLIK SPÓŁKA JAWNA

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