1 Star 0 Fork 0

一个好人耶 / Android-Lock9View

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 3.93 KB
一键复制 编辑 原始数据 按行查看 历史
TakWolf 提交于 2016-03-08 15:56 . 代码整理

Android Lock9View

Download API Android Arsenal

An Android grid lock screen view with a callback interface.

ScreenShot

Screenshot

Demo

Google Play Store

Usage

Gradle

compile 'com.takwolf.android:lock9view:0.0.11'

Layout example 1

<com.takwolf.android.lock9.Lock9View
    android:id="@+id/lock_9_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    app:lock9_nodeSrc="@drawable/node_normal"
    app:lock9_nodeOnSrc="@drawable/node_active"
    app:lock9_nodeOnAnim="@anim/node_on_1"
    app:lock9_padding="28dp"
    app:lock9_spacing="28dp"
    app:lock9_lineColor="@color/blue_light"
    app:lock9_lineWidth="8dp"
    app:lock9_autoLink="false"
    app:lock9_enableVibrate="true"
    app:lock9_vibrateTime="20" />

layout_1

Layout example 2

<com.takwolf.android.lock9.Lock9View
    android:id="@+id/lock_9_view"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="24dp"
    android:layout_gravity="center"
    app:lock9_nodeSrc="@drawable/node_small_normal"
    app:lock9_nodeOnSrc="@drawable/node_small_active"
    app:lock9_nodeOnAnim="@anim/node_on_2"
    app:lock9_nodeSize="16dp"
    app:lock9_nodeAreaExpand="24dp"
    app:lock9_lineColor="@color/blue_light"
    app:lock9_lineWidth="4dp"
    app:lock9_autoLink="true"
    app:lock9_enableVibrate="true"
    app:lock9_vibrateTime="20" />

layout_2

PS :

If use "lock9_nodeSize" , it will ignore "lock9_padding" and "lock9_spacing".

The nodes will be layout on the center of 9 average areas.

Touch area

If you want to draw a small node with a bigger touch area, please user :

app:lock9_nodeAreaExpand="24dp"  // default is 0

touchArea = lock9_nodeSize + lock9_nodeAreaExpand * 2

Animation

app:lock9_nodeOnAnim="@anim/node_on_2"

AutoLink

auto_link

app:lock9_autoLink="true" // default is false

Vibrate

app:lock9_enableVibrate="true"  // default is false
app:lock9_vibrateTime="20"      // default is 20 milliseconds

Also need :

<uses-permission android:name="android.permission.VIBRATE" />

Error status

// TODO

Activity

Lock9View lock9View = (Lock9View) findViewById(R.id.lock_9_view);
lock9View.setCallBack(new CallBack() {

    @Override
    public void onFinish(String password) {
        Toast.makeText(MainActivity.this, password, Toast.LENGTH_SHORT).show();
    }

});

Author

TakWolf

takwolf@foxmail.com

http://takwolf.com

License

Copyright 2015-2016 TakWolf

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
1
https://gitee.com/zj512269813/Android-Lock9View.git
git@gitee.com:zj512269813/Android-Lock9View.git
zj512269813
Android-Lock9View
Android-Lock9View
master

搜索帮助