Date text field with on the fly validation built with Jetpack Compose.

Overview

DateTextField for Jetpack Compose

Date text field with on the fly validation built with Jetpack Compose.

Input is being validated while user is typing it, so it is impossible to enter a wrong value.

Made in LANARS.


Download

repositories {
    ...
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.LanarsInc:compose-date-text-field:{latest version}'
}

Preview

User can only enter existing dates

User can only enter dates that are in the allowed range

Input is being validated even though some fields are not complete

Usage

Basic implementation

DateTextField(
    onEditingComplete = {}
)

You can set the exact date boundaries or leave it by default, from 1/1/1900 to 12/31/2100. Date format by default will be MM/DD/YYYY

DateTextField(
    // Detect focus changes
    modifier = Modifier.onFocusChanged { Log.d("DateInput", it.toString()) },
    // Set the desired date format
    format = Format.MMDDYYYY,
    // Set min and max date
    minDate = LocalDate.of(2009, 8, 27),
    maxDate = LocalDate.of(2020, 9, 17),
    // Detect value changes
    onValueChange = {
        Log.d(
            "DateInput",
            it.toString()
        )
    },
    // Get LocalDate object when date is entered
    onEditingComplete = { Log.d("DateInput", it.toString()) },
    // Preset date value
    value = LocalDate.of(2020, 12, 12)
    // Apply custom text style to content
    contentTextStyle = TextStyle(fontSize = 25.sp, color = Color.Black),
    // Apply custom text style to hint
    hintTextStyle = TextStyle(fontSize = 25.sp, color = Color.Gray),
    // Apply custom style to cursor
    cursorBrush = SolidColor(Color.Red),
    // Set custom delimiter
    delimiter = '.',
    // Set padding between digits
    padding = DateDigitsPadding(6.dp)
    // You can set field to be readonly
    readOnly = true
)
You might also like...
A TextView that automatically resizes text to fit perfectly within its bounds.
A TextView that automatically resizes text to fit perfectly within its bounds.

AutoFitTextView A TextView that automatically resizes text to fit perfectly within its bounds. Usage dependencies { compile 'me.grantland:autofitt

:page_facing_up: Android Text Full Jusiftication / Wrapping / Justify / Hyphenate - V2.0
:page_facing_up: Android Text Full Jusiftication / Wrapping / Justify / Hyphenate - V2.0

LIBRARY IS NO LONGER MAINTAINED If you want to adopt + maintain this library, please drop me a message - [email protected] Android Full Justific

A Custom TextView with trim text
A Custom TextView with trim text

ReadMoreTextView A Custom TextView with trim text Download To add the ReadMoreTextView library to your Android Studio project, simply add the followin

[DISCONTINUED] Rrich text editor for android platform. 安卓富文本编辑器,暂停维护

icarus-android Maybe the best rich text editor on android platform. Base on Simditor Features Alignment (left/center/right) Bold Blockquote Code Horiz

Android library contain custom realisation of EditText component for masking and formatting input text
Android library contain custom realisation of EditText component for masking and formatting input text

Masked-Edittext Masked-Edittext android library EditText widget wrapper add masking and formatting input text functionality. Install Maven dependency

Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android
Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I develop easy to understand , modify and integrate Chips Edit Text widget for Android

Chips EditText Library Chips EditText, Token EditText, Bubble EditText, Spannable EditText and etc.. There are many names of this control. Here I deve

Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.
Androids EditText that animates the typed text. EditText is extended to create AnimatedEditText and a PinEntryEditText.

AnimatedEditText for Android This repository contains AnimatedEditText and TextDrawable all of which extend the behaviour of EditText and implement fe

AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.
AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size.

AutoscaleEditText AutosizeEditText for Android is an extension of native EditText that offer a smooth auto scale text size. Latest Version How to use

Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.
Add text masking functionality to Android EditText. It will prevent user from inserting not allowed signs, and format input as well.

MaskFormatter MaskFormatter adds mask functionality to your EditText. It will prevent user from inserting not allowed signs, and format input as well.

Releases(1.0.2)
Owner
null
Android form edit text is an extension of EditText that brings data validation facilities to the edittext.

Android Form EditText Android form edit text is an extension of EditText that brings data validation facilities to the edittext. Example App I built a

Andrea 1.5k Dec 14, 2022
A module designed to encapsulate the use of an Android EditText field for gathering currency information from a user. Supports all ISO-3166 compliant locales/currencies.

CurrencyEditText CurrencyEditText is an extension of Android's EditText view object. It is a module designed to provide ease-of-use when using an Edit

Josh Kitchens 335 Dec 25, 2022
Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.

android-formidable-validation Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Pr

Linden 147 Nov 20, 2022
A editable text with a constant text/placeholder for Android.

ParkedTextView A EditText with a constant text in the end. How to use <com.goka.parkedtextview.ParkedTextView xmlns:app="http://schemas.android.co

goka 270 Nov 11, 2022
RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

RTL marquee text view android right to left moving text - persian - farsi - arabic - urdo

mehran elyasi 4 Feb 14, 2022
Markdown Text for Android Jetpack Compose 📋.

Markdown Text for Android Jetpack Compose ??.

Jeziel Lago 250 Jan 4, 2023
Jetpack Compose Rich Text Editor

An all-in-one Jetpack Compose component to handle text styling inside TextFields

Paweł Chochura 26 Dec 14, 2022
An all-in-one Jetpack Compose component to handle text styling inside TextFields

An all-in-one Jetpack Compose component to handle text styling inside TextFields

Paweł Chochura 26 Dec 14, 2022
RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android.

RichEditor for Android is a beautiful Rich Text WYSIWYG Editor for Android. Looking for iOS? Check out cjwirth/RichEditorView Supported Functions Bold

Daichi Furiya 6k Jan 2, 2023
Animation effects to text, not really textview

HTextView Animation effects with custom font support to TextView see iOS Effects see Flutter Effects Screenshot type gif Scale Evaporate Fall Line Typ

hanks 5.5k Jan 5, 2023