Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
*.iml
.gradle
gradle.properties
/gradle
/local.properties
/.idea/caches
/.idea
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
Expand Down
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 2 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Amirhossein Naghshzan

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.
97 changes: 97 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# 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:

![Screenshots](https://github.com/amirarcane/lock-screen/blob/master/demo/set.gif)

Check Pin:

![Screenshots](https://github.com/amirarcane/lock-screen/blob/master/demo/check.gif)

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

```java
compile 'com.amirarcane.lock-screen:lockscreen:2.0.0'
```
---
# Usage

Just add Lock Screen activity to your manifest:

```java
<activity android:name="com.amirarcane.lockscreen.activity.EnterPinActivity"
android:theme="@style/Theme.AppCompat.NoActionBar"/>
```

Now easily start the Intent:

```java
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:

```java
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:

```java
@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:

```java
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:

```java
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.
16 changes: 8 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 28
compileSdkVersion 27
defaultConfig {
applicationId "com.example.capstone1"
minSdkVersion 15
targetSdkVersion 28
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -21,12 +22,11 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-core:16.0.9'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compile project(':lockscreen')
}
apply plugin: 'com.google.gms.google-services'
48 changes: 0 additions & 48 deletions app/google-services.json

This file was deleted.

Binary file removed app/hputty-p0.66-t027-h004-installer.exe
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.capstone1;
package com.example.capstone2;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
Expand Down
52 changes: 43 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.capstone1">
<uses-permission android:name="android.permission.INTERNET" />
package="com.example.capstone3">

<uses-permission android:name="android.permission.VIBRATE" />

<application
android:allowBackup="true"
Expand All @@ -10,17 +11,50 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MenuActivity">
</activity>
<activity android:name=".SignUpActivity"></activity>
<activity android:name=".ManagementActivity"></activity>
<activity android:name=".LoginActivity">

<activity android:name="com.example.capstone3.FileExActivity" />
<activity android:name="com.example.capstone3.Main2Activity" />

<receiver
android:name="com.example.capstone3.BootCompleteReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>

<service
android:name="com.example.capstone3.LockScreenService"
android:enabled="true"
android:exported="true" />

<activity android:name="com.example.capstone3.ParentActivity" />
<activity android:name="com.example.capstone3.subActivity" />
<activity android:name="com.example.capstone3.MenuActivity" />
<activity android:name="com.example.capstone3.SignUpActivity" />
<activity android:name="com.example.capstone3.ManagementActivity" />
<activity android:name="com.example.capstone3.PrefExActivity" />
<activity android:name="com.example.capstone3.PrefFragmentActivity" />
<activity android:name="com.example.capstone3.locker"/>
<activity android:name="com.example.capstone3.LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter></activity>
<activity android:name=".MainActivity">
</intent-filter>
</activity>
<activity android:name="com.example.capstone3.MainActivity" />
<activity android:name="com.example.capstone3.ScreenOffExActivity" />

<service
android:name="com.example.capstone3.LockScreenService"
android:enabled="true"
android:exported="true" />

<activity android:name="com.example.capstone3.QuizLockerActivity" />
<activity
android:name="com.example.capstone2.activity.EnterPinActivity"
android:theme="@style/Theme.AppCompat.NoActionBar" />
</application>

</manifest>
23 changes: 23 additions & 0 deletions app/src/main/assets/capital.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"id": 1,
"question": "대한민국의\n수도는?",
"choice1": "서울",
"choice2": "뉴욕",
"answer": "서울"
},
{
"id": 2,
"question": "네팔의\n수도는?",
"choice1": "딜리",
"choice2": "카트만두",
"answer": "카트만두"
},
{
"id": 3,
"question": "라오스의\n수도는?",
"choice1": "베이루트",
"choice2": "비엔티안",
"answer": "베이루트"
}
]
Loading