Skip to content

Commit d1ccff1

Browse files
Releasing v 1.2
1 parent c9cbf4c commit d1ccff1

File tree

4 files changed

+128
-11
lines changed

4 files changed

+128
-11
lines changed

README.md

+121-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This library provide easy and secure PIN authentication view, which
2222
* size of the each single key.
2323
* color and shape of pin indicators.👉 [Guide](https://github.com/kevalpatel2106/PasscodeView/wiki/Indicators)
2424
* Control over tactile feedback for key press and authentication success/failure events.
25+
* Authenticate using using the pattern.
2526

2627
## Demo:
2728
**Authentication using PIN/Fingerprint**
@@ -42,6 +43,10 @@ This library provide easy and secure PIN authentication view, which
4243
|:---:|:---:|:---:|
4344
|![Rect](/resource/rect_key.png)|![Circle](/resource/circle_key.png)|![Square](/resource/square_key.png)|
4445

46+
**Pattern based authentication**
47+
48+
![Pattern Unlock](/resource/pattern_unlock.gif)
49+
4550
*Here is the link of the demo application. 👉 [Demo](resource/sample.apk)*
4651

4752

@@ -50,11 +55,13 @@ This library provide easy and secure PIN authentication view, which
5055
* Add below lines to `app/build.gradle` file of your project.
5156
```
5257
dependencies {
53-
compile 'com.kevalpatel2106:passcodeview:1.1'
58+
compile 'com.kevalpatel2106:passcodeview:1.2'
5459
}
5560
```
5661
* To integrate using maven visit this [page](https://github.com/kevalpatel2106/PasscodeView/wiki/Dependencies).
57-
62+
63+
## PIN based authentication:
64+
5865
- ### Add `PinView` in your layout file.
5966
```java
6067
<com.kevalpatel.passcodeview.PinView
@@ -115,9 +122,10 @@ This library provide easy and secure PIN authentication view, which
115122
```
116123

117124
- ### Set the shape of the pin indicators you want to use.
118-
- There are two built in key shapes.
125+
- There are three built in key shapes.
119126
* Round indicator
120127
* Dot indicator
128+
* Circle indicator
121129
- Here is the example for the round indicator. You can learn more about other indicators from [here](https://github.com/kevalpatel2106/PasscodeView/wiki/Indicators).
122130
```java
123131
@Override
@@ -207,18 +215,123 @@ This library provide easy and secure PIN authentication view, which
207215
//...
208216
}
209217
```
210-
218+
219+
220+
## Pattern based authentication:
221+
222+
- ### Set the number of rows and columns of the pattern in your activity/fragment.
223+
```java
224+
@Override
225+
protected void onCreate(Bundle savedInstanceState) {
226+
super.onCreate(savedInstanceState);
227+
//....
228+
//...
229+
230+
PatternView patternView = (PatternView) findViewById(R.id.pattern_view);
231+
232+
//Set number of pattern counts.
233+
//REQUIRED
234+
patternView.setNoOfColumn(3); //Number of columns
235+
patternView.setNoOfRows(3); //Number of rows
236+
237+
//...
238+
}
239+
```
240+
241+
- ### Set the correct pattern to authenticate the user in your activity/fragment.
242+
```java
243+
@Override
244+
protected void onCreate(Bundle savedInstanceState) {
245+
super.onCreate(savedInstanceState);
246+
//....
247+
//...
248+
249+
PatternView patternView = (PatternView) findViewById(R.id.pattern_view);
250+
251+
//Set number of pattern counts.
252+
//REQUIRED
253+
patternView.setNoOfColumn(3); //Number of columns
254+
patternView.setNoOfRows(3); //Number of rows
255+
256+
//Set the correct pin code.
257+
//Display row and column number of the pattern point sequence.
258+
//REQUIRED
259+
patternView.setCorrectPattern(new PatternPoint[]{
260+
new PatternPoint(0, 0),
261+
new PatternPoint(1, 0),
262+
new PatternPoint(2, 0),
263+
new PatternPoint(2, 1)
264+
});
265+
//...
266+
}
267+
```
268+
269+
- ### Set the pattern cell shape.
270+
- There are two built in pattern cells available.
271+
* Circle indicator
272+
* Dot indicator
273+
274+
```java
275+
@Override
276+
protected void onCreate(Bundle savedInstanceState) {
277+
super.onCreate(savedInstanceState);
278+
//....
279+
//...
280+
281+
PatternView patternView = (PatternView) findViewById(R.id.pattern_view);
282+
patternView.setNoOfColumn(3); //Number of columns
283+
patternView.setNoOfRows(3); //Number of rows
284+
patternView.setCorrectPattern(new PatternPoint[]{...});
285+
286+
287+
//Build the desired indicator shape and pass the theme attributes.
288+
//REQUIRED
289+
patternView.setPatternCell(new CirclePatternCell.Builder(patternView)
290+
.setRadius(R.dimen.pattern_cell_radius)
291+
.setCellColorResource(R.color.colorAccent)
292+
.build());
293+
294+
//...
295+
}
296+
```
297+
298+
- ### Set callback listener to get callbacks when user is authenticated or authentication fails.
299+
```java
300+
@Override
301+
protected void onCreate(Bundle savedInstanceState) {
302+
super.onCreate(savedInstanceState);
303+
//....
304+
//...
305+
306+
PatternView patternView = (PatternView) findViewById(R.id.pattern_view);
307+
patternView.setNoOfColumn(3); //Number of columns
308+
patternView.setNoOfRows(3); //Number of rows
309+
patternView.setCorrectPattern(new PatternPoint[]{...});
310+
patternView.setPatternCell(...);
311+
312+
patternView.setAuthenticationListener(new AuthenticationListener() {
313+
@Override
314+
public void onAuthenticationSuccessful() {
315+
//User authenticated successfully.
316+
}
317+
318+
@Override
319+
public void onAuthenticationFailed() {
320+
//Calls whenever authentication is failed or user is unauthorized.
321+
//Do something
322+
}
323+
});
324+
//...
325+
}
326+
```
327+
211328
*[**Visit our wiki page for more information.**](https://github.com/kevalpatel2106/PasscodeView/wiki)*
212329
213330
## How to contribute?
214331
* Check out contribution guidelines 👉[CONTRIBUTING.md](https://github.com/kevalpatel2106/PasscodeView/blob/master/CONTRIBUTING.md)
215332
216333
217334
## What's next?
218-
- Create view for pattern based authentication. (**Upcoming Release** preview)
219-
220-
![Pattern Unlock](/resource/pattern_unlock.gif)
221-
222335
- Build more customisation parameters to provide granular control over the theme of the view.
223336

224337

app/src/main/java/com/securelockview/sample/PatternViewActivity.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ protected void onCreate(Bundle savedInstanceState) {
3838
setContentView(R.layout.activity_pattern_view);
3939

4040
PatternView patternView = (PatternView) findViewById(R.id.pattern_view);
41-
patternView.setNoOfColumn(3);
42-
patternView.setNoOfRows(3);
41+
42+
//Set number of pattern counts.
43+
//REQUIRED
44+
patternView.setNoOfColumn(3); //Number of columns
45+
patternView.setNoOfRows(3); //Number of rows
4346

4447
//Set the correct pin code.
48+
//Display row and column number of the pattern point sequence.
4549
//REQUIRED
4650
patternView.setCorrectPattern(new PatternPoint[]{
4751
new PatternPoint(0, 0),

bintray.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
if (project.rootProject.file('local.properties').exists()) {
1919
apply plugin: 'com.jfrog.bintray'
2020

21-
version = "1.1" // This is the library version used when deploying the artifact
21+
version = "1.2" // This is the library version used when deploying the artifact
2222

2323
def siteUrl = 'https://github.com/kevalpatel2106/PasscodeView'
2424
// Homepage URL of the library

gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)