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
Size: 1446
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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
========
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/)
========
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.
Once the user has enabled the password, he can also use his fingerprint scanner (using Google Api, not Samsung) to unlock his device.
========
If you want an example on how to use it, you can find an example app in this repo.
========
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()
}
========
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
}
========
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:
========
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.enableAppLock(this, CustomPinActivity.class);
Once enabled, you must extend “PinActivity” for every Activity you wish to protect.
========
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.disableAppLock();
========
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);
========
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.
========
Some features are customizable:
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.getAppLock().setTimeout(10000);
ic class CustomPinActivity extends AppLockActivity {
...
...
@Override
public int getPinLength() {
return 5;
}
...
...
Manager<CustomPinActivity> lockManager = LockManager.getInstance();
Manager.getAppLock().setLogoId(R.drawable.security_lock);
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);
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;
}
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"/>
========
========
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.