Android 12 Developer Preview is here! Try it out, and give us your feedback!

DateValidatorPointBackward

public class DateValidatorPointBackward
extends Object implements CalendarConstraints.DateValidator

java.lang.Object
   ↳ com.google.android.material.datepicker.DateValidatorPointBackward


A CalendarConstraints.DateValidator that enables only dates before a given point. Defaults to the current moment in device time backwards using now(), but can be set to any point, as UTC milliseconds, using before(long).

Summary

Inherited constants

Fields

public static final Creator<DateValidatorPointBackward> CREATOR

Part of Parcelable requirements.

Public methods

static DateValidatorPointBackward before(long point)

Returns a CalendarConstraints.DateValidator which enables only days before point, in UTC milliseconds.

int describeContents()
boolean equals(Object o)
int hashCode()
boolean isValid(long date)

Returns true if the provided date is enabled.

static DateValidatorPointBackward now()

Returns a CalendarConstraints.DateValidator enabled from the current moment in device time backwards.

void writeToParcel(Parcel dest, int flags)

Inherited methods

Fields

CREATOR

public static final Creator<DateValidatorPointBackward> CREATOR

Part of Parcelable requirements. Do not use.

Public methods

before

public static DateValidatorPointBackward before (long point)

Returns a CalendarConstraints.DateValidator which enables only days before point, in UTC milliseconds.

Parameters
point long

Returns
DateValidatorPointBackward

describeContents

public int describeContents ()

Returns
int

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

hashCode

public int hashCode ()

Returns
int

isValid

public boolean isValid (long date)

Returns true if the provided date is enabled.

Parameters
date long

Returns
boolean

now

public static DateValidatorPointBackward now ()

Returns a CalendarConstraints.DateValidator enabled from the current moment in device time backwards.

Returns
DateValidatorPointBackward

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

Parameters
dest Parcel

flags int