Skip to content

sharukhmohammed/SliderDateTimePicker

Repository files navigation

SliderDateTimePicker

Developed this Date Time Picker as the requirement for Wheelstreet - Bike Rentals Android App

contributions welcome License: MIT MinSdk: 14 Download HitCount

This is based off Horizontal-Calendar with Time Selector built on top of it

Installation

Add this line in app level build.gradle file

implementation 'sharukh.sliderdtpicker:sliderdtpicker:latest-version'

Dependencies

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

Usage

SliderDateTimePicker.newInstance()
                        .setOnDateTimeSetListener((new SliderDateTimePicker.OnDateTimeSetListener() {
                            @Override
                            public void onDateTimeSelected(final Calendar startTime) {

                                SliderDateTimePicker.newInstance()
                                        .setStartDate(startTime.getTime())
                                        .setOnDateTimeSetListener(new SliderDateTimePicker.OnDateTimeSetListener() {
                                            @Override
                                            public void onDateTimeSelected(Calendar endTime) {

                                                textView.setText(sdf.format(startTime.getTime()) + " ---to--- " + sdf.format(endTime.getTime()));

                                            }
                                        })
                                        .setStartLabel("Some Kinda Label")
                                        .setEndLabel("Whatever")
                                        .setTimeTextColor(ContextCompat.getColor(getApplicationContext(), R.color.ongoing_dark))
                                        .setSelectedDateBackground(ContextCompat.getDrawable(getApplicationContext(), R.drawable.somedrawble))
                                        .setSelectedTimeBackground(ContextCompat.getDrawable(getApplicationContext(), R.drawable.somedrawble2))
                                        .setDoneButtonBackground(ContextCompat.getDrawable(getApplicationContext(), R.color.failure_dark))
                                        .show(getSupportFragmentManager(), "Your wish");
                            }
                        }))
                        .setStartLabel("Start Time")
                        .show(getSupportFragmentManager(), "Your wish");

Contributions

All contributions in any kind are more than welcome!

forthebadge forthebadge forthebadge

Buy Me a Coffee at ko-fi.com

License (MIT)

Copyright 2019 Sharukh Mohammed

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Developed this Date Time Picker as the requirement for Wheelstreet - Bike Rentals Android App

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages