Digipad is a simple library for Android that only show a numeric keyboard onscreen

Overview

Android Digipad

Android Digipad

Version

Digipad is a simple library for Android that only show a numeric keyboard onscreen

Adding dependencies

Add this to your build.gradle:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Add the dependencies in your app/build.gradle:

dependencies {
    ....
    implementation 'com.github.yogacp:android-digipad:x.x.x'
}

How to use the library

In your XML layout. Add the Digipad Layout activity_sample.xml:

.... ">
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
        ....
        
    <com.yogacp.digipad.view.Digipad
        android:id="@+id/digipad"
        android:layout_width="match_parent"
        android:layout_height="@dimen/no_space"
        android:layout_margin="@dimen/space_32"
        app:layout_constraintTop_toBottomOf="@+id/viewNumber"
        app:layout_constraintBottom_toBottomOf="parent"/>

androidx.constraintlayout.widget.ConstraintLayout>

In your Activity, add the default setup below:

class SampleActivity : AppCompatActivity() {

    //by viewBinding() is a binding delegation library
    private val binding: ActivitySampleBinding by viewBinding()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        //Set input max length
        binding.digipad.setMaxLength(inputMaxLength)

        //Set the theme color
        binding.digipad.setThemeColor(this, android.R.color.holo_blue_dark)

        //Set the listener
        binding.digipad.setOnDigipadClicked(object : OnDigipadClicked {
            override fun onClicked(numbers: String) {
                inputNumbers = numbers
                binding.etNumbers.setText(inputNumbers)

                if (inputNumbers.length == inputMaxLength) {
                    showMessage("Numbers: $inputNumbers")
                }
            }
        })
        ....
    }
}

PS: by viewBinding() is a binding delegation library from this github: Android Viewbinding Delegation Library

Happy coding :)
You might also like...
Dealing with Android Text by simple way to get high performance.
Dealing with Android Text by simple way to get high performance.

Gapo Android RichText RichText supports Hashtag, Mention, Url, Phone Number, Email, Markdown, Custom Span, SeeMore/SeeLess by limited line or length,

Simple extension for account suggestion and auto completion.

AccountAutoCompleteEditText Just a simple implementation for use of auto complete text view with device account suggestion Usage Just simply put an cu

A simple and flexible Checked TextView or Checkable TextView
A simple and flexible Checked TextView or Checkable TextView

CheckableTextView Checkable TextView [KOTLIN] ⚡ A simple and flexible Checked TextView or Checkable TextView written in Kotlin ⚡ What's New Animation

TextView to display simple HTML

Project stopped This project has been stopped. 4.0 is the last release. Feel free to fork this project and take over maintaining. HtmlTextView for And

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

library to implement and render emojis For Android
library to implement and render emojis For Android

Release Notes SuperNova-Emoji SuperNova-Emoji is a library to implement and render emojis. Minimum SDK Level: 9 (2.3) Contact Java Usage To use defaul

Form validation and feedback library for Android. Provides .setText for more than just TextView and EditText widgets. Provides easy means to validate with dependencies.
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

Lightweight android library for highlighting sections of a textview, with optional callbacks.
Lightweight android library for highlighting sections of a textview, with optional callbacks.

Linker Lightweight android library for highlighting Strings inside of a textview (ignoring case), with optional callbacks. Language: Java MinSDK: 17 J

Awesome Android Typeahead library - User mention plugin, UI widget for auto complete user mention using the at sign (@) like Twitter or Facebook.

android-typeahead Awesome Android Typeahead library - User mention plugin, UI widget for auto complete user mention using the at sign (@) like Twitter

Releases(0.1.0)
Owner
Yoga C. Pranata
I'm not a strong researcher but curious about all new technology, especially in android development. With little help from coffee and snacks.
Yoga C. Pranata
LocalizedEditText - Custom edit text that allow only one language

LocalizedEditText Custom edit text that allow only one language Supported languages : Arabic , English Default language : English Examples

Mostafa Gad 1 Nov 28, 2021
A simple library for hide and show text with animation.

ViewMore TextView ViewMore TextView allows you to use a TextView by hiding the content of the text by a number of established lines and to display all

Michele Quintavalle 81 Dec 23, 2022
A library to show emoji in TextView, EditText (like WhatsApp) for Android

Discontinued This projected is discontinued. Please consider using other alternative, i.e EmojiCompat. Contact me if you want to continue working on a

Hieu Rocker 3.6k Jan 5, 2023
A little animation framework which could help you to show message in a nice looking way

TextSurface A little animation framework which could help you to show message in a nice looking way. Usage Create TextSurface instance or add it in yo

Eugene Levenetc 2.3k Dec 30, 2022
A simple Android library to protect part of text using Span

Text Protector A simple Android library to "protect" part of text using Span What is this? This is a small library for replacing part of a text in a T

Oleg Nestyuk 4 May 16, 2022
Micro Template 📃 A very tiny and simple text templating library for Kotlin.

Micro Template ?? A very tiny and simple text templating library for Kotlin. It has very limited features, so it's intended to be used for short templ

Matteo Mirk 24 Aug 20, 2022
Irineu A. Silva 2 Feb 17, 2022
Simple way to create linked text, such as @username or #hashtag, in Android TextView and EditText

Simple Linkable Text Simple way to create link text, such as @username or #hashtag, in Android TextView and EditText Installation Gradle Add dependenc

Aditya Pradana Sugiarto 76 Nov 29, 2022
A simple Android Tag EditText

TagEditText A simple Android Tag EditText. Setup The easiest way to add the TagEditText library to your project is by adding it as a dependency to you

HearSilent 15 May 5, 2022
Dealing with Android Text by simple way to get high performance.

Gapo Android RichText RichText supports Hashtag, Mention, Url, Phone Number, Email, Markdown, Custom Span, SeeMore/SeeLess by limited line or length,

GapoWork 8 Oct 20, 2021