CodemateLtd/LolliPin

Name: LolliPin

Owner: Codemate Ltd

Description: A Material design Android pincode library. Supports Fingerprint.

Forked from: omadahealth/LolliPin

Created: 2017-12-01 08:43:20.0

Updated: 2017-12-01 08:43:22.0

Pushed: 2017-11-11 13:20:00.0

Homepage:

Size: 1446

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

LolliPin Android Arsenal

A Lollipop material design styled android pincode library (API 14+)

To include in your project, add this to your build.gradle file:

/Lollipin
ompile ('com.github.orangegangsters:lollipin:2.0.0@aar') {
  transitive = true

Starting from version 2.1.0 we will have a different package name:

/Lollipin
ompile ('com.github.omadahealth:lollipin:2.1.0@aar') {
  transitive = true

Demo Demo

========

By

Developers:

    [Olivier Goutay](https://github.com/olivierg13) and [Stoyan Dimitrov](https://github.com/StoyanD) and [Dae Park](https://github.com/daespark)

Contributors:

    [Art Beatte IV](https://github.com/abeatte), [Alex Morgan](https://github.com/axemorgan)

Designers:

    [Yassine Bentaieb](http://yassinebentaieb.com/)

========

Security
Password protection

The password itself is not saved, only its hash using the SHA-1 algorithm. This hash is then saved on the SharedPreferences, allowing to verify that the user entered the right PinCode, without giving the possibility to retrieve it.

Introducing Fingerprint

Once the user has enabled the password, he can also use his fingerprint scanner (using Google Api, not Samsung) to unlock his device.

========

Usage

If you want an example on how to use it, you can find an example app in this repo.

========

Preparing dependencies

We are using a custom version of RippleView that contains a RippleAnimationListener. In order to be able to fetch this dependency, you need to add these lines into your main build.gradle file:

rojects {
repositories {
    maven{
        url "https://github.com/omadahealth/omada-nexus/raw/master/release"
    }
    jcenter()

}

========

Overriding the AppLockActivity

In order to use the “Forgot” system, we let you extend the AppLockActivity class to provide your own way of handling the user behaviour in this case (logout, delete datas etc…)

ic class CustomPinActivity extends AppLockActivity {
@Override
public void showForgotDialog() {
    //Launch your popup or anything you want here
}

========

Init

Advised to be done by extending the Application, but can be done elsewhere. The method below provides a way to enable or disable the PinCode system:

========

Enabling
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.enableAppLock(this, CustomPinActivity.class);

Once enabled, you must extend “PinActivity” for every Activity you wish to protect.

========

Disabling
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.disableAppLock();

========

Set up the PinCode

Whenever you want the user to set up his pin code, you need to request:

nt intent = new Intent(MainActivity.this, CustomPinActivity.class);
nt.putExtra(AppLock.EXTRA_TYPE, AppLock.ENABLE_PINLOCK);
tActivityForResult(intent, REQUEST_CODE_ENABLE);

========

Unlock system

As soon as you enable the PinCode system, the Unlock screen will appear by itself when the user resume the app after a defined timeout. Please refer to the next section to know how to customize these values.

========

Customization

Some features are customizable:

The unlock timeout:
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.getAppLock().setTimeout(10000);
The pin length required:
ic class CustomPinActivity extends AppLockActivity {

...
...

@Override
public int getPinLength() {
    return 5;
}

...
...

The logo displayed at the top of the page:
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.getAppLock().setLogoId(R.drawable.security_lock);
The ignored activities:

For instance you got a login activity that you want to avoid getting the lock screen, you can ignore this activity by doing:

Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.getAppLock().addIgnoredActivity(NotLockedActivity.class);
The AppLockActivity Layout:

By providing a custom layout to getContentView() you can alter how your AppLockActivity looks. However, you must include 4 required elements:

rride
public int getContentView() {
    return R.layout.activity_pin;
}
The Pin Dots:

By supplying alternate drawable resources for app:lp_empty_pin_dot and app:lp_full_pin_dot you can custimize how it looks.

.github.orangegangsters.lollipin.lib.views.PinCodeRoundView
            android:id="@+id/pin_code_round_view"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="@dimen/pin_code_round_top_margin"
            android:layout_marginBottom="@dimen/pin_code_elements_margin"
            app:lp_empty_pin_dot="@drawable/pin_empty_dot"
            app:lp_full_pin_dot="@drawable/pin_full_dot"/>

========

Credits

========

License
MIT License (MIT)

right (c) 2015 OrangeGangsters

ission is hereby granted, free of charge, to any person obtaining a copy
his software and associated documentation files (the "Software"), to deal
he Software without restriction, including without limitation the rights
se, copy, modify, merge, publish, distribute, sublicense, and/or sell
es of the Software, and to permit persons to whom the Software is
ished to do so, subject to the following conditions:

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

SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
ESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
ORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
ILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
WARE.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.