MaterialPatternllockView



下载  收藏



AmniX / MaterialPatternllockView



A View which is lookalike Lollipop Pattern View



16845



介绍:



material风格的图案解锁。



运行效果:





使用说明:


首先导入项目中的materiallockview模块

然后

<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"             />


 

回调

 

/**            

                          * 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) {            

                          

                          }            

                          }