All Projects → GoodieBag → Pinview

GoodieBag / Pinview

Licence: mit
A pinview library for android. ✨

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Pinview

Otpview
A custom view to enter otp/pin of different sizes used usually in cases of authentication.
Stars: ✭ 172 (-73.54%)
Mutual labels:  xml, library, otp
Internettools
XPath/XQuery 3.1 interpreter for Pascal with compatibility modes for XPath 2.0/XQuery 1.0/3.0, custom and JSONiq extensions, XML/HTML parsers and classes for HTTP/S requests
Stars: ✭ 82 (-87.38%)
Mutual labels:  xml, library
Textfieldboxes
Material Design text field that comes in a box, based on (OLD) Google Material Design guidelines.
Stars: ✭ 760 (+16.92%)
Mutual labels:  xml, library
Rawspeed
fast raw decoding library
Stars: ✭ 179 (-72.46%)
Mutual labels:  xml, library
Cxf
Apache CXF
Stars: ✭ 697 (+7.23%)
Mutual labels:  xml, library
Jackrabbit Oak
Mirror of Apache Jackrabbit Oak
Stars: ✭ 321 (-50.62%)
Mutual labels:  xml, library
Ksprefs
🚀⚡ Kotlin SharedPreferences wrapper & cryptographic preferences android library.
Stars: ✭ 176 (-72.92%)
Mutual labels:  xml, library
Cayenne
Mirror of Apache Cayenne
Stars: ✭ 250 (-61.54%)
Mutual labels:  xml, library
Csconsoleformat
.NET C# library for advanced formatting of console output [Apache]
Stars: ✭ 296 (-54.46%)
Mutual labels:  xml, library
Jackrabbit
Mirror of Apache Jackrabbit
Stars: ✭ 273 (-58%)
Mutual labels:  xml, library
Meza
A Python toolkit for processing tabular data
Stars: ✭ 374 (-42.46%)
Mutual labels:  xml, library
Libplist
A library to handle Apple Property List format in binary or XML
Stars: ✭ 330 (-49.23%)
Mutual labels:  xml, library
Libexpat
🌿 Expat library: Fast streaming XML parser written in C; in the process of migrating from SourceForge to GitHub
Stars: ✭ 549 (-15.54%)
Mutual labels:  xml, library
Fantoccini
A high-level API for programmatically interacting with web pages through WebDriver.
Stars: ✭ 619 (-4.77%)
Mutual labels:  library
Elixir Boilerplate
⚗ The stable base upon which we build our Elixir projects at Mirego.
Stars: ✭ 627 (-3.54%)
Mutual labels:  otp
Taskscheduler
Cooperative multitasking for Arduino, ESPx and STM32 microcontrollers
Stars: ✭ 613 (-5.69%)
Mutual labels:  library
Superembed.js
Fluid width for YouTube, Vimeo, Vine, VideoPress, DailyMotion, and more embedded videos.
Stars: ✭ 615 (-5.38%)
Mutual labels:  library
Papis
Powerful and highly extensible command-line based document and bibliography manager.
Stars: ✭ 636 (-2.15%)
Mutual labels:  library
Louvre
A small customizable library useful to handle an gallery image pick action built-in your app. 🌄🌠
Stars: ✭ 629 (-3.23%)
Mutual labels:  library
Qlibc
qLibc is a simple and yet powerful C library providing generic data structures and algorithms
Stars: ✭ 614 (-5.54%)
Mutual labels:  library

Pinview

Android Arsenal Release API

Pinview library for android 😾

alt tag alt_tag

Gradle Dependency

Add this in your root build.gradle file at the end of repositories:

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

Add the dependency :

dependencies {
	   implementation 'com.github.GoodieBag:Pinview:v1.4'
	}

Sync the gradle and that's it! 👍

Features :

  • Flawless focus change to the consecutive pin box when the text is entered/deleted.
  • When the user taps on the Pinview, the first empty box available is focused automatically (when the cursor is hidden).
  • Listeners for onDataEntered ( To call an API when the pin is entered) and touch exists.
  • Customisations are available for pin box sizes, background(drawables, selectors), inputType etc.

Usage

XML :

<com.goodiebag.pinview.Pinview
        android:id="@+id/pinview"
        app:pinBackground="@drawable/example_drawable"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:pinWidth="40dp"
        app:pinHeight="40dp"
        app:pinLength="4"
        app:cursorVisible="false"
	app:forceKeyboard="true"
        app:hint="0"
        app:inputType="text"
        app:password="false"/>

This can be referenced in the java class by the findViewById method.

Available xml attributes and explanations :

app:pinBackground : Sets the pin box's background, accepts a drawable or a selector drawable. When a selector is used, the focused pin box is highlighted.
app:pinWidth and app:pinHeight : Sets the width and height of the pinbox.
app:pinLength : number of pin boxes to be displayed.
app:forceKeyboard : forces the keyboard when the pinview is activity/fragment is opened. app:cursorVisibility : Toggles cursor visibility.
app:hint : Pin box hint.
app:inputType : Accepts number or text as values.
app:password : Masks the pin value with * when true.
app:splitWidth : Determines the width between two pin boxes.

Java :

To create the view programmatically :

Pinview pin = new Pinview(this);

Or reference it from findViewById

pin = (Pinview) findViewById(R.id.pinview);
pin.setPinBackgroundRes(R.drawable.sample_background);
pin.setPinHeight(40);
pin.setPinWidth(40);
pin.setInputType(Pinview.InputType.NUMBER);
pin.setValue("1234");
myLayout.addView(pin);    
To get and set the pin values use the pin.getValue() and pin.setValue() methods respectively.

There is an event listener which is triggered when the user is done entering the otp which can be used as follows :

pinview.setPinViewEventListener(new Pinview.PinViewEventListener() {
            @Override
            public void onDataEntered(Pinview pinview, boolean fromUser) {
	    	//Make api calls here or what not
                Toast.makeText(MainActivity.this, pinview.getValue(), Toast.LENGTH_SHORT).show();
            }
        });

Note :

This library cannot be assured to work on 3rd party keyboards (especially when the cursor is off). It works as expected on google keyboards. We will be adding a work-around in the future releases.

LICENSE

MIT License

Copyright (c) 2017 GoodieBag

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].