• Stars
    star
    441
  • Rank 98,861 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created almost 10 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Android grid lock screen view with a callback interface.

Limitations

这个项目很长时间出于非活跃状态,主要是手势解锁布局实现上存在一些限制。

一个完整的手势解锁布局,应该包括的功能有:

  • 基本的手势连线

  • 连接节点的动画

  • 不同情况下的状态以及样式(常规、正确、错误状态时节点和连线颜色,以及停留时间)

  • 布局策略(节点数量、触摸范围、连线和结点的层级关系)

  • 反馈(连接节点时显示涟漪效果或者声音提示或者震动反馈)

我目前没有找到一个好的方法能够完美并且优雅的实现上面所有功能的扩展。

自己的几个关于手势解锁需求的项目,都是在这个基础上做了 UI 上的定制化修改。

Android Lock9View

Build Status Bintray Platform API License Android Arsenal

An Android grid lock screen view with a callback interface.

ScreenShot

Screenshot

Demo

Google Play Store

Usage

Gradle

implementation 'com.takwolf.android:lock9view:0.1.3'

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

Activity

Lock9View lock9View = (Lock9View) findViewById(R.id.lock_9_view);
lock9View.setGestureCallback(new Lock9View.GestureCallback() {

    @Override
    public void onNodeConnected(@NonNull int[] numbers) {
        // Do something
    }

    @Override
    public void onGestureFinished(@NonNull int[] numbers) {
        // Do something
    }

});

Change Log

0.1.0

  • This is a broken api version.

  • Extend gesture callback.

License

Copyright 2014 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.

More Repositories

1

ark-pixel-font

Open source Pan-CJK pixel font / 开源的泛中日韩像素字体
Python
3,175
star
2

CNode-Material-Design

CNode 社区第三方 Android 客户端,原生 App,Material Design 风格,支持夜间模式。
Java
1,343
star
3

fusion-pixel-font

开源像素字体。支持 8、10 和 12 像素。
Python
1,141
star
4

retro-pixel-font

A set of open source old game style pixel fonts / 一组开源的有怀旧游戏感觉的像素字体
Python
99
star
5

NyanCatEverywhere

让彩虹猫入侵全世界!
JavaScript
70
star
6

Android-RefreshAndLoadMore-Demo

一种简单且优雅的下拉刷新和加载更多分页的解决方案。
Kotlin
47
star
7

Android-HeaderAndFooterRecyclerView

Let RecyclerView support add HeaderView and FooterView.
Java
41
star
8

tge

A lightweight cross-platform 2D game framework written in pure Rust and based on OpenGL 3.3+.
Rust
34
star
9

hzk-pixel-font

中文像素字体,支持 12 和 16 像素。
Python
30
star
10

GB2260.java

中华人民共和国行政区划代码(GB/T 2260),数据库Java版实现。
Java
27
star
11

Android-AspectRatioLayout

A simple aspect ratio layout for Android.
Java
21
star
12

ark-pixel-font-inherited

方舟像素字体的传承字形版本
Python
21
star
13

Android-Foreback

A utility to help listen Android application enter foreground or background.
Java
20
star
14

Java-MorseCoder

摩尔斯电码翻译器的一个 Java 语言实现。使用了非标准方式支持 Unicode 编码。
Java
13
star
15

aseprite-universal-pixel-theme

Aseprite 泛用多语言像素主题
Python
13
star
16

pixel-font-builder

A library that helps create pixel style fonts.
Python
10
star
17

fez-pixel-font

A font for the Alphabet in the game FEZ called "Zu Language".
Python
9
star
18

nico-font-tool

A tool for converting fonts to NICO Game Framework format fonts.
Nim
7
star
19

Android-InsetsWidget

一组可以动态适配 WindowInsets 尺寸的组件,用于快速实现沉浸式布局效果。
Java
6
star
20

TakWolf

5
star
21

pixel-glyphs-hangul-syllables

Unicode 区块:AC00 ~ D7AF; Hangul Syllables
Python
5
star
22

zelda-pixel-font

The Legend of Zelda - Pixel Font
Python
5
star
23

bdffont

BdfFont is a library for manipulating Glyph Bitmap Distribution Format (BDF) Fonts.
Python
3
star
24

takwolf.github.io

JavaScript
3
star
25

source-han-mapping-viewer

一个思源系列字体地区字形映射的在线查看器。
JavaScript
3
star
26

Android-Repause

A utility to help listen Android application level resumed or paused.
Java
3
star
27

pixel-font-knife

A set of pixel font utilities.
Python
3
star
28

pixel-art-video-game-content-rating-system

各国家和地区的「电子游戏分级制度」标识的像素化素材。
Python
3
star
29

pcffont

PcfFont is a library for manipulating Portable Compiled Format (PCF) Fonts.
Python
2
star
30

nico-font-tool.python

A tool for converting fonts to NICO Game Framework format fonts.
Python
2
star
31

unidata-blocks

A library that helps query unicode blocks by Blocks.txt.
Python
2
star
32

CNode-OAuth-Login-Android

直接用 GitHub 账户登录 CNode社区,Android 端用组件。
Java
2
star
33

static.takwolf.com

HTML
2
star
34

pixel-glyphs-braille-patterns

Unicode 区块:2800 ~ 28FF; Braille Patterns
Python
2
star
35

d2d-canvas-for-javascript

A html5 canvas 2d game engine powered by JavaScript .
JavaScript
1
star
36

Java-Digest-And-Crypto-Utils

Java摘要加密工具类
Java
1
star
37

Android-LoopViewPager

Java
1
star
38

d2d-canvas-for-dart

A html5 canvas 2d game engine powered by Google dart.
Dart
1
star
39

web.takwolf.com

HTML
1
star
40

character-encoding-utils

Some character encoding utils.
Python
1
star
41

source-han-vf-sliced

基于 CSS unicode-range 特性,对 woff2 字体进行切片,以优化网络加载体验。
Python
1
star