Coder Social home page Coder Social logo

ovallockview's Introduction

OvalLockView

动画效果

这里写图片描述

使用方法: 1.布局文件添加

<com.zhpan.lockview.view.LockView
        android:id="@+id/lock_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />

2.设置操作的监听事件

mLockView.setOnLockOperateListener(new OnLockOperateListener() {
         @Override
         public void onLockPrepared() {//  准备上锁
             
         }

         @Override
         public void onUnLockPrepared() {//  准备开锁

         }

         @Override
         public void onLockStart() {// 开始上锁

         }

         @Override
         public void onUnlockStart() {// 开始开锁

         }

         @Override
         public void onNotPrepared() {// 上下滑动距离未达到准备上锁或者准备开锁状态而释放

         }
     });

3.开放接口

// 设置蓝牙是否连接
mLockView.setBluetoothConnect(false);
// 设置上锁状态
mLockView.setLockState(isLock);
// 设置View是否可以滑动
mLockView.setCanSlide(true)
// 设置滑动阻尼大小
mLockView.setDamping(1.7)
// 设置View中心文字
mLockView.setText("已上锁");
// 设置中心大圆的颜色
mLockView.setCircleColor
// 开启心跳动画
mLockView.startWave();
// 停止心跳动画
mLockView.stopWave();
// 是否正在搜索/连接蓝牙
mLockView.connecting(true);

// 点击事件监听(只有在未连接蓝牙时有效)
mLockView.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {
             
         }
     });

ovallockview's People

Contributors

zhpanvip avatar

Watchers

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