A material style input for codes

Overview

Material Code input

Download Android Arsenal

A material style input for put codes

Demo Screenshot

Demo Screenshot

Based on

Code input field concept by SAMUEL KANTALA

How to use

Minimal SDK Version 11

Usage with default colors (the default codes is 6)

  <com.github.glomadrian.codeinputlib.CodeInput
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:hint_text="Pairing code"
      />

Usage with custom colors and attributes

<com.github.glomadrian.codeinputlib.CodeInput
    android:layout_marginTop="20dp"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:underline_color="#457ad1"
    app:underline_selected_color="#9e1ace"
    app:text_color="#b12eff"
    app:hint_color="#77ce9d"
    app:hint_text="Pin code"
    app:codes="4"
    />

Remember put this for custom attribute usage

xmlns:app="http://schemas.android.com/apk/res-auto"

Get the input code (Returns a Character[])

  codeInput.getCode()

You can use the onCodeReadyListener which is called when all the characters are entered.

  CodeInput cInput = (CodeInput) findViewById(R.id.pairing);
    cInput.setCodeReadyListener(new CodeInput.codeReadyListener() {
      @Override
      public void onCodeReady(Character[] code) {
        // Code has been entered ....
        Toast.makeText(MainActivity.this,"code entered is : "+ Arrays.toString(code),Toast.LENGTH_SHORT).show();
      }
    });

For Gradle

Add repository

repositories {
  maven {
    url "http://dl.bintray.com/glomadrian/maven"
  }
}

Add dependency

  compile 'com.github.glomadrian:CodeInput:1.1@aar'

Developed By

Adrián García Lomas - [email protected]

License

Copyright 2015 Adrián García Lomas

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Recycle TypedArray when Initializing Attributes.

    Recycle TypedArray when Initializing Attributes.

    First, Thanks for awesome library. This is really what I wanted. I found an small issue that TypedArray didn't release from memory after use. So I add recycle() when initializing attributes are done.

    opened by Hazealign 0
  • How to use in Java Code?

    How to use in Java Code?

    How can I know if the code has been entered completely? is there any listener?

    codeInput.getCode() will give the code but It would be great if we have a onCodeCompletionListener sort of thing

    opened by dmsherazi 0
  • Programmatically input into material-code-input

    Programmatically input into material-code-input

    Thank you for creating this library.

    As I would like to integrate material-code-input with https://github.com/omadahealth/LolliPin

    I try to programmatically input into material-code-input, using codeInput.setCode.

    Says, I want to input "1", followed by "2".

    I try to call

    codeInput.setCode("1")

    Then, I try to call

    codeInput.setCode("2")

    The end result looks like

    2018-06-25 15_44_18-android emulator - copy_of_nexus_5_api_25_5554

    Then, I try another approach. I first call codeInput.setCode("1"), then followed by codeInput.setCode("12"), then end result looks like

    2018-06-25 15_45_52-android emulator - copy_of_nexus_5_api_25_5554

    May I know, is programmatically input supported by android-otpview-pinview?

    opened by yccheok 0
  • [WARNING] DO NOT USE THIS LIBRARY IF YOUR INPUT CODE IS MORE THAN 7 CHARACTERS

    [WARNING] DO NOT USE THIS LIBRARY IF YOUR INPUT CODE IS MORE THAN 7 CHARACTERS

    Spent time integrating the module, but the field is cut off in width then. Also, match_parent as width does not work.

    Great idea with the lib though! But it needs some work.

    opened by OneManMobile 0
  • Fix Bug

    Fix Bug

    • Adaptive Codes length;
    • The repair can not receive keyboard input event;
    • Add inputType attributes;
    • HintColor reference error;
    • Call requestFocus start animation.
    opened by fingerart 0
Owner
Adrián Lomas
Adrián Lomas
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.

Azimo Labs 161 Nov 25, 2022
User input masking library repo.

More GIFs [~3 MB] Migration Guide: v.6 This update brings breaking changes. Namely, the autocomplete flag is now a part of the CaretGravity enum, thus

red_mad_robot 1.2k Dec 20, 2022
Gmail style MultiAutoCompleteTextView for Android

Version 3.0 The 3.0.1 version is now available! This should resolve a number of text handling issues and lay the groundwork for better support of mixe

Splitwise 1.3k Nov 14, 2022
A simpler way to style your TextViews

BabushkaText BabushkaText is a custom TextView which lets you customize the styling of parts of your text via Spannables, but without the hassle of ha

Henrique Boregio 752 Dec 29, 2022
A simpler way to style your TextViews

BabushkaText BabushkaText is a custom TextView which lets you customize the styling of parts of your text via Spannables, but without the hassle of ha

Henrique Boregio 753 Jun 7, 2022
A Material Android password view that toggles password visibility via an eye icon.

8/17/2016: As of about an hour ago, this library is deprecated! Support for password visibility is now included in the Design Support Library in TextI

Lisa Wray 715 Dec 29, 2022
A material style input for codes

Material Code input A material style input for put codes Based on Code input field concept by SAMUEL KANTALA How to use Minimal SDK Version 11 Usage w

Adrián Lomas 962 Nov 26, 2022
Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone.

####Secret Codes is an Open Source application that allows you to browse through hidden codes of your Android phone. This application will scan throug

Simon Marquis 251 Jan 6, 2023
iOS style scroll wheel (style similar to UIPickerView)

WheelPicker iOS-style scroll wheel picker Read this in other languages: Feature Day / Night Mode Support Customizable style Support circular scro

Tian Yiyan 21 Dec 30, 2022
A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation codes like Share, Contacts, Email and etc, which you can easily use.

Android-Intent-Library A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation code

Next 67 Aug 24, 2022
Collection of source codes, utilities, templates and snippets for Android development.

Android Templates and Utilities [DEPRECATED] Android Templates and Utilities are deprecated. I started with this project in 2012. Android ecosystem ha

Petr Nohejl 1.1k Nov 30, 2022
A helper library to ease the most repetitive codes with simple reusable attributes.

ak-universal-android-helper A helper library to ease the most repetitive codes with simple reusable attributes. AKUAH can help you with many repetitiv

Aakash Kumar 20 Jul 8, 2020
Order picking with QR codes

Order PiQR Order picking with QR codes Open the project in Android Studio and run. First step was to create a new simple project in Android Studio. Th

Marcel van Pinxteren 0 Dec 3, 2021
Oratio Library for Android Studio helps you simplify your Android TTS codes

Oratio Oratio is a library for Android Studio. This library is useful to a number of developers who are currently making apps using android TTS(Text-T

Jacob Lim 1 Oct 28, 2021
Oratio Library for Android Studio helps you simplify your Android TTS codes

Oratio Oratio is a library for Android Studio. This library is useful to a number of developers who are currently making apps using android TTS(Text-T

Jacob Lim 1 Oct 28, 2021
Kotlin sample codes.

Kotlin Samples Kotlin sample codes. HTML Builder html { lang = "en" head { title { +"Kotlin HTML" } } body { p { +"This is the f

Sadra Samadi 2 Mar 13, 2022
BluePass extracts two factor authentication codes (2FA) from SMS and sends them to a paired device via Bluetooth RFCOMM.

BluePass extracts two factor authentication codes (2FA) from SMS and sends them to a paired device via Bluetooth RFCOMM.

Manuel Huber 15 Dec 4, 2022
ZATAC Scanner is Android Kotlin-based QR code scanner and parser which de-crypt TLV qr codes and parse them into their values.

ZATAC Scanner is Android Kotlin-based QR code scanner and parser which de-crypt TLV qr codes and parse them into their values.

Enozom 12 Apr 23, 2022
An application to create custom QR codes to specify waste types and waste disposal procedures for products.

wasteqr An application to create custom QR codes to specify waste types and waste disposal procedures for products. What is WasteQR? WasteQR is an app

Mihir Arya 1 May 24, 2022
Android library for creating QR-codes with logo, custom pixel/eyes shapes, background image. Powered by ZXing.

custom-qr-generator Android library for creating QR-codes with logo, custom pixel/eyes shapes, background image. Powerd by ZXing. Installation To get

Alexander Zhirkevich 34 Dec 17, 2022