Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.github.k0shk0sh:RetainedDateTimePickers

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.k0shk0sh:RetainedDateTimePickers

Android Library to help you with your date & time pickers while retaining the instance of the pickers on orientation change.

  • 1.0.2
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

RetainedDateTimePickers

Android Library to help you with your date & time pickers while retaining the instance of the pickers on orientation change.

Installation

Gradle
compile 'com.github.k0shk0sh:RetainedDateTimePickers:1.0.2'
Maven
<dependency>
  <groupId>com.github.k0shk0sh</groupId>
  <artifactId>RetainedDateTimePickers</artifactId>
  <version>1.0.2</version>
  <type>aar</type>
</dependency>

Usage

Your Activity or Fragment must implement DatePickerCallback and or TimePickerCallback to receive the selected date & selected time if applicable.

RetainedDateTimePickers should be treated as any normal DialogFragment:

  • DatePickerDialog Only
DatePickerFragmentDialog.newInstance().show(getSupportFragmentManager(), "DatePickerFragmentDialog");
  • TimePickerDialog Only
//default  12 hours format
TimePickerFragmentDialog.newInstance().show(getSupportFragmentManager(), "TimePickerFragmentDialog");
//24 hours format
TimePickerFragmentDialog.newInstance(true).show(getSupportFragmentManager(), "TimePickerFragmentDialog");
  • DateTimePickerDialog
DatePickerFragmentDialog.newInstance(true).show(getSupportFragmentManager(), "DatePickerFragmentDialog");
  • Date & Time PickerDialog Customization
DatePickerFragmentDialog.newInstance(
        DateTimeBuilder.get()
                .withTime(true)
                .with24Hours(true)
                .withSelectedDate(currentDate.getTimeInMillis())
                .withMinDate(minDate.getTimeInMillis())
                .withMaxDate(maxDate.getTimeInMillis())
                .withCurrentHour(12)
                .withCurrentMinute(30)
                .withTheme(R.style.PickersTheme))
        .show(getSupportFragmentManager(), "DatePickerFragmentDialog");

To understand more how the library works, please take a look at the sample app.

Screenshots

  • Pickers Portrait Mode
- **Pickers Landscape Mode**
- **Pickers Custom Themes via Styles**

Why this library?

  • DatePickerDialog & TimePickerDialog are not retained on orientation change, you'd do a lot of work to retain them, this library simplify that.
  • It uses DatePickerDialog & TimePickerDialog internally.
  • Its simple to use.
  • Its Customizable (Support Custom Themes).
  • Minimum API is 16, but it'll probably work in API 9 and above, just make sure you test it out (we use Support Fragment).

Dependency

Android Support Fragment Library v24.2.1

Pull requests are welcomed.

Copyright (C) 2016 Kosh. Licensed under the Apache 2.0 license (see the LICENSE file).

FAQs

Package last updated on 21 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc