Lock Screen


Source link: https://github.com/amirarcane/lock-screen

Lock Screen

Simple and beautiful Lock Screen library to set an check pin code. Integrated with fingerprint authentication.

Easily secure your app with Lock Screen library as easy as starting an intent.

With great animations for fingerprint authentication.

Set Pin:

Check Pin:

Lock Screen gets a 4 digit pincode from user at first running time. After that every time that you start the intent, It asks
for pincode.

Watching this repository will allow GitHub to email you whenever I publish a release.


Gradle Dependency

Add this line to your build.gradle project

compile 'com.amirarcane.lock-screen:lockscreen:1.0.0'

Usage

Just add Lock Screen activity to your manifest:

<activity android:name="com.amirarcane.lockscreen.activity.EnterPinActivity"

  android:theme="@style/Theme.AppCompat.NoActionBar"/>

Now easily start the Intent:

 Intent intent = new Intent(getContext(), EnterPinActivity.class);
  startActivity(intent);

That's it. As easy as piece of cake.

At first run It checks if you entered pin before or not, If pin was set, It asks for Entering pin else It asks for setting pincode. If you need to change pin or for any reason you want to set pin again just start the intent like below:

  Intent intent = EnterPinActivity.getIntent(getContext(), SET_PIN);

startActivity(intent);

SET_PIN is boolean.

If you need to handle back press of Lock Screen activity, just try onActivityResult:

  @Override

 protected void onActivityResult(int requestCode, int resultCode, Intent data) {

  super.onActivityResult(requestCode, resultCode, data);

  switch (requestCode) {

case REQUEST_CODE:

if (resultCode == EnterPinActivity.RESULT_BACK_PRESSED) {

 Toast.makeText(MainActivity.this, "back pressed", Toast.LENGTH_LONG).show();

}

break;

  
}

 
}

See MainActivity class in Sample app for understanding how this library works.


Customization

If you need to set font for this library try like below:

  Intent intent = EnterPinActivity.getIntent(getContext(), FONT_TEXT, FONT_NUMBERS);

startActivity(intent);

FONT_TEXT and FONT_NUMBERS are path of your fonts in assets folder like "font/Arial.ttf"

IF need set pin and changing fonts, do this:

  Intent intent = EnterPinActivity.getIntent(getContext(), SET_PIN, FONT_TEXT, FONT_NUMBERS);

startActivity(intent);

I customized PinLockView by andrognito for my Lock Screen view. In case of any further customization, fork the library and change it.

Resources

Easy to implement a drop-down warning / message.

This is a simple and elegant menu control.

Error handling library for Android and Java.

Confetti is a high-performance, easily-configurable particle system library that can animate any set of objects through space. You can specify your starting conditions and physical conditions (e.g. X and Y acceleration, boundaries, etc.), and let the confetti library take care of the rest.

Library to convert between RxJava 1.x and 2.x reactive types.

An A/B Testing Library for Android that makes writing simple tests simpler by using annotations.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes