MaterialPatternllockView material风格的图案解锁。

MaterialPatternllockView

A View which is lookalike Lollipop Pattern View

介绍:

material风格的图案解锁。

运行效果:

使用说明:

首先导入项目中的materiallockview模块

然后

1
2
3
4
5
6
7
8
9
<com.amnix.materiallockview.MaterialLockView
         xmlns:lockview= "http://schemas.android.com/apk/res-auto"
         android:id= "@+id/pattern"
         android:layout_width= "wrap_content"
         android:layout_height= "wrap_content"
         android:layout_alignParentBottom= "true"
         lockview:LOCK_COLOR= "#fff"
         lockview:WRONG_COLOR= "#ff0000"
         lockview:CORRECT_COLOR= "#00ff00" />

 

回调

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
      * The call back abstract class for detecting patterns entered by the user.
      */
     public static abstract class OnPatternListener {
 
         /**
          * A new pattern has begun.
          */
         public void onPatternStart() {
 
         }
 
         /**
          * The pattern was cleared.
          */
         public void onPatternCleared() {
 
         }
 
         /**
          * The user extended the pattern currently being drawn by one cell.
          *
          * @param pattern The pattern with newly added cell.
          */
         public void onPatternCellAdded(List<Cell> pattern, String SimplePattern) {
 
         }
 
         /**
          * A pattern was detected from the user.
          *
          * @param pattern The pattern.
          */
         public void onPatternDetected(List<Cell> pattern, String SimplePattern) {
 
         }
     }

猜你喜欢

转载自lishuaishuai.iteye.com/blog/2298956
今日推荐