Code Monkey home page Code Monkey logo

patternlockview's Introduction

PatternLockView

自定义图案锁View

private PatternLockView patternLockView;

ScreenShot

image

Layout example 1

 <com.yuan.lock.widget.PatternLockView
        android:id="@+id/lock_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:textSize="14sp"
        app:tips="绘制解锁图案"
        app:radius="35dp"
        app:strokeWidth="2dp"
        app:textColor="@color/lock_view_default_color"
       />

Activity

PatternLockView patternLockView = (PatternLockView) findViewById(R.id.lock_view);
patternLockView.setPatternLockViewListener((values)->{
            StringBuffer sb=new StringBuffer();
            for(int i=0;i<values.length;i++)
                sb.append(values[i]);
            Toast.makeText(MainActivity.this,sb.toString(),Toast.LENGTH_SHORT).show();
        });

attrs

         <!--圆的半径-->
        <attr name="radius" format="dimension"/>
        <!--圆圈选中后的颜色-->
        <attr name="selectedColor" format="color"/>
        <!--圆圈默认颜色-->
        <attr name="color" format="color"/>
        <!--连接线的颜色-->
        <attr name="lineColor" format="color"/>
        <!--连接线的粗细-->
        <attr name="strokeWidth" format="dimension"/>
        <!--提示信息-->
        <attr name="tips" format="string"/>
        <attr name="textColor" format="color"/>
        <attr name="textSize" format="dimension"/>

patternlockview's People

Contributors

yuanjianting avatar

Watchers

 avatar  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.