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
EditText in Material Design

MaterialEditText NOTE: 2.0 is NOT BACKWARDS COMPATIBLE! See more on wiki or 中文看这里 AppCompat v21 makes it easy to use Material Design EditText in our a

Kai Zhu 6.1k Dec 30, 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
This is an IDEA plugin that allows you to connect Android devices via WiFi for debugging your codes.

AdbWifiUtils Github | Issues | README | 中文文档 ● [Description]: This is an IDEA plugin that allows you to connect Android devices via WiFi for debugging

AWeiLoveAndroid 3 Sep 19, 2022
This repo provides a sample application that demonstrates how you can speed up the authentication experience for frontline workers on shared devices using QR codes.

Project This repo has been populated by an initial template to help get you started. Please make sure to update the content to build a great experienc

Microsoft 5 Dec 7, 2022
Navigation Drawer Activity with material design style and simplified methods

MaterialNavigationDrawer Navigation Drawer Activity with material design style and simplified methods       It requires 10+ API and android support v7

Fabio Biola 1.6k Dec 30, 2022
A material style progress wheel compatible with 2.3

![](https://img.shields.io/badge/Methods and size-106 | 12 KB-e91e63.svg) Material-ish Progress A material style progress wheel compatible with 2.3 Tr

Nico Hormazábal 2.5k Dec 28, 2022
A material style progress wheel compatible with 2.3

![](https://img.shields.io/badge/Methods and size-106 | 12 KB-e91e63.svg) Material-ish Progress A material style progress wheel compatible with 2.3 Tr

Nico Hormazábal 2.5k Jan 4, 2023