Giter Site home page Giter Site logo

gestureunlock's Introduction

GestureUnlock

A customized gesture view.

V1.0 Commited on 2017/8/1

The UnlockView contains all code. Thanks for using!

Usage

1.Just copy the UnlockView.java to your project;
2.Add this view into your layout

    <com.wulei.gestureunlock.UnlockView
        android:id="@+id/unlock"
        android:layout_height="wrap_content"
        android:layout_width="match_parent" />

3.Find the view in code:

mUnlockView= (UnlockView) findViewById(R.id.unlock);

4.Set the mode(CREATE_MODE:the mode for creating gesture;CHECK_MODE:the mode for verifing gesture):

5.Add Listener:

        //The listener for creating gesture;
        mUnlockView.setGestureListener(new UnlockView.CreateGestureListener() {
            @Override
            public void onGestureCreated(String result) {
                ...
            }
        });
        //The listener for verifing gesture;
        mUnlockView.setOnUnlockListener(new UnlockView.OnUnlockListener() {
            @Override
            public boolean isUnlockSuccess(String result) {
              ...
            }

            @Override
            public void onSuccess() {
                ...
            }

            @Override
            public void onFailure() {
                ...
            }
        });

6.Customize your gesture unlockview:

mUnlockView.setErrorColor(Color.parseColor("#FF0000"));//Customize the color of error circles
mUnlockView.setNormalColor(Color.parseColor("#D5DBE8"));//Customize the color of normal circles
mUnlockView.setSelectColor(Color.parseColor("#508CEE"));//Customize the color of selected circles
mUnlockView.setPathWidth(3);//Customize the width of path
mUnlockView.setNormalR(20);//Customize the radius of inner circle
mUnlockView.setSelectR(30);//Customize the radius of outer circle

7.Enjoy it!

中文博客链接:吴磊的简书

How to contact me:

QQ:331948214
Email:[email protected]

gestureunlock's People

Contributors

moduniran avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.