Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/glomadrian/material-code-input
A material style input for codes
https://github.com/glomadrian/material-code-input
Last synced: 4 days ago
JSON representation
A material style input for codes
- Host: GitHub
- URL: https://github.com/glomadrian/material-code-input
- Owner: glomadrian
- Created: 2015-08-01T21:07:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-10-25T05:05:10.000Z (about 6 years ago)
- Last Synced: 2024-07-31T18:16:51.512Z (6 months ago)
- Language: Java
- Homepage:
- Size: 172 KB
- Stars: 966
- Watchers: 14
- Forks: 156
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- -awesome-android-ui - Material Code input - 2.0) | <img src="/art/material-code-input.gif" width="60%"> <br><br> <img src="/art/material-code-input2.gif" width="60%"> (Index `(light-weight pages)`)
- awesome-android-ui - Material Code input - 2.0) | <img src="/art/material-code-input.gif" width="60%"> <br><br> <img src="/art/material-code-input2.gif" width="60%"> (Index `(light-weight pages)`)
- awesome-github-android-ui - material-code-input - MD样式的编码输入 (表单)
- awesome-android-ui - Material Code input - 2.0) | <img src="/art/material-code-input.gif" width="60%"> <br><br> <img src="/art/material-code-input2.gif" width="60%"> (Index)
- awesome-android-ui - https://github.com/glomadrian/material-code-input
- awesome-android-ui - https://github.com/glomadrian/material-code-input
README
Material Code input
-----------------
[![Download](https://api.bintray.com/packages/glomadrian/maven/MaterialCodeInput/images/download.svg) ](https://bintray.com/glomadrian/maven/MaterialCodeInput/_latestVersion)
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Material%20Code%20Input-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2221)A material style input for put codes
![Demo Screenshot][1]
![Demo Screenshot][2]
Based on
----------[Code input field concept](http://www.materialup.com/posts/code-input-field-concept) by [SAMUEL KANTALA](http://www.materialup.com/ontidop)
How to use
----------Minimal SDK Version 11
Usage with default colors (the default codes is 6)
```xml
```Usage with custom colors and attributes
```xml
```
Remember put this for custom attribute usage
```java
xmlns:app="http://schemas.android.com/apk/res-auto"
```
Get the input code (Returns a Character[])
```java
codeInput.getCode()
```You can use the `onCodeReadyListener` which is called when all the characters are entered.
```java
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
```java
repositories {
maven {
url "http://dl.bintray.com/glomadrian/maven"
}
}
```
Add dependency
```java
compile 'com.github.glomadrian:CodeInput:1.1@aar'
```Developed By
------------
Adrián García Lomas -
* [Twitter](https://twitter.com/glomadrian)
* [LinkedIn](https://es.linkedin.com/in/glomadrian )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 athttp://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.[1]: ./art/codeInput1.gif
[2]: ./art/codeInput2.gif