• Stars
    star
    106
  • Rank 325,871 (Top 7 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 Notice

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

More Repositories

1

FastHub

FastHub the ultimate GitHub client for Android.
Java
5,706
star
2

PermissionHelper

Android Library to help you with your runtime Permissions.
Java
1,227
star
3

FastAccess

A tiny launcher or as Samsung likes to call it Floating Toolbox.
Java
309
star
4

KAM

KAM is an apk manager, backup, restore and more.
Java
84
star
5

Android-MVP-for-dummies

this is simple application demonstrate how structuring MVP project in Android.
Java
49
star
6

ComposeEasyForms

Compose easy forms validation library
Kotlin
26
star
7

AndroidFloatingImage

this example explains how to code a floating imageView on top of your apps and with the ability to move it around the screen.
Java
15
star
8

EasyVersion

EasyVersion is a Gradle plugin that manage your app or library version.
Kotlin
9
star
9

android-api-SecureKeys

Store sensible data in a simple and secure way
C++
8
star
10

Filtra-StyleMe-

Filtra is replacement for my old project (Style Me Photo Editor) as i don't maintain that project any more, i decided to create it from scratch for more enhancements and features.
Java
7
star
11

FastHub-code-theme-images

6
star
12

cloen

`git clone` wrapper. Clones a repository, cds into it, and opens it in $EDITOR|$GUI_EDITOR.
Shell
4
star
13

NewKam

This is new implementation of KAM (App Manager) that i thought of revamping the whole base code & UI. i chose to do this as i don't have much time to rebase the old repo.
Java
4
star
14

assignmentReminder

Assignment reminder built using Phonegap.
CSS
3
star
15

Cheaphlight

Cheaphlight, is an un-official client for Google Flight. a work in progress.
Java
3
star
16

ComposeGists

Testing Android Comopse
Kotlin
3
star
17

AwesomeToaster

AwesomeToaster breaks the limitation of the android default Toast Message. AwesomeToaster is designed following the Material Design and it works from API 8 until today's API
Java
2
star
18

The-Flash

The Flash Launcher ( a work in progress ) yet another launcher but not like others.
Java
1
star
19

k0shk0sh.github.io

1
star
20

TouchWiz4Launcher

TouchWiz4 for Android Phones-tablets install along side the stock launcher
1
star
21

android-active-record

Automatically exported from code.google.com/p/android-active-record
HTML
1
star