• Stars
    star
    713
  • Rank 61,871 (Top 2 %)
  • Language
    Java
  • Created over 7 years ago
  • Updated about 5 years ago

Reviews

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

Repository Details

Swipe captcha of Android platform. Android 平台的滑动验证码。

-SwipeCaptcha

Swipe captcha of Android platform。 Android 平台的滑动验证码。

在 Android端app上,自定义View,仿一个斗鱼web端滑动验证码。 博文:http://blog.csdn.net/zxt0601/article/details/53315975

我们的Demo,Ac娘镇楼

Usage 用法:

Step 1. Add the JitPack repository to your build file 在项目根build.gradle文件中增加JitPack仓库依赖。

    allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}

Step 2. Add the dependency

    dependencies {
	        compile 'com.github.mcxtzhang:SwipeCaptcha:V1.0.0'
	}

Step 3.

    <com.mcxtzhang.captchalib.SwipeCaptchaView
        android:id="@+id/swipeCaptchaView"
        android:layout_width="300dp"
        android:layout_height="200dp"
        android:layout_centerHorizontal="true"
        android:scaleType="centerCrop"
        tools:src="@drawable/pic11"
        app:captchaHeight="30dp"
        app:captchaWidth="30dp"/>

    <SeekBar
        android:id="@+id/dragBar"
        android:layout_width="320dp"
        android:layout_height="60dp"
        android:layout_below="@id/swipeCaptchaView"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="30dp"
        android:progressDrawable="@drawable/dragbg"
        android:thumb="@drawable/thumb_bg"/>

那么本控件包含不仅包含以下功能:

  • 随机区域**起点(左上角x,y)**生成一个验证码阴影。
  • 验证码拼图 凹凸图形会随机变换。
  • 验证码区域宽高可自定义。
  • 抠图验证码区域,绘制一个用于联动滑动的验证码滑块。
  • 验证失败,会闪烁几下然后回到原点。
  • 验证成功,会有白光扫过的动画。

分解一下验证码核心实现思路:

  • 控件继承自ImageView。理由: 1 如果放在项目中用,验证码图片希望可以是接口返回。ImageView以及其子类支持花式加载图片。 2 继承自ImageView,绘制图片本身不用我们干预,也不用我们操心scaleType,节省很多工作。
  • onSizeChanged()方法中生成 和 控件宽高相关的属性值: 1 初始化时随机生成验证码区域起点 2 生成验证码区域Path 3 生成滑块Bitmap
  • onDraw()时,依次绘制: 1 验证码阴影 2 滑块

to do list,待完善

  • abstract dragbar(seekbar) interface

  • SwipeCaptcha inside to hold the interface to do something

  • 抽象拖动条接口

  • SwipeCaptcha内部要持有这个接口 做一些事情

More Repositories

1

SwipeDelMenuLayout

The most simple SwipeMenu in the history, 0 coupling, support any ViewGroup. Step integration swipe (delete) menu, high imitation QQ, iOS. ~史上最简单侧滑菜单,0耦合,支持任意ViewGroup。一步集成侧滑(删除)菜单,高仿QQ、IOS。~
Java
3,667
star
2

ZLayoutManager

Some custom LayoutManager .Such as SwipeCard、FLowLayout。一些自定义的LayoutManager,仿探探、人人影视 炫动滑动 卡片层叠 和流式布局等。
Java
2,524
star
3

SuspensionIndexBar

仿美团选择城市、微信通讯录、饿了么点餐列表的导航悬停分组索引列表。
Java
1,866
star
4

AnimShopButton

A shopping cart button with a telescopic displacement rotation animation ...一个带伸缩位移旋转动画的购物车按钮
Java
1,298
star
5

PathAnimView

用于做Path动画的自定义View。 I have a path.I have a view. (Oh~),Path(Anim)View.
Java
1,079
star
6

all-base-adapter

Adapter terminator, including DataBinding, any ViewGroup, list(Rv, Lv ). Write Adapter, it is enough .Adapter终结者,包含DataBinding,任意ViewGroup,Rv、Lv列表。写Adapter,有它就够了
Java
527
star
7

SupportDemos

本工程最初仅为DiffUtil的一个Demo,后发展为讲解Google Android Support包内那些常用or冷门有用的工具类的合集。
Java
460
star
8

NestFullListView

ListView、RecyclerView、ScrollView里嵌套ListView 相对优雅的解决方案
Java
245
star
9

Demos

The playground of mcxtzhang....
Java
148
star
10

DataBindingUtils

Some utils about Data Binding.(More easier adapter to write multi type list.) | 一些DataBinding相关的工具类。(一句代码实现多类型列表的Adapter)
Java
9
star
11

csdn-retrofit

CSDN视频授课源码
Java
7
star
12

gradle-plugins

plugins and utils of gralde(groovy).
Groovy
6
star
13

ModularizationDemo

A demo of Modularization.. 大工程组件化的Demo.
Java
6
star
14

react-native-demo

learn ReactNative demos.
JavaScript
3
star
15

mvp-code-creator

A plugin for auto create MVP codes.
Java
2
star
16

tagview

Java
2
star
17

android_playground_as4

1
star
18

DownloadManager

a http download manager
Java
1
star
19

groovy-demo

Demos of groovy
Groovy
1
star
20

TJ-notes

Notes and code of Thinking in Java.
Java
1
star
21

aly-rn

JavaScript
1
star
22

swipe-exchange

A GridView , which item can drag&drop
Java
1
star
23

view-inspector

Java
1
star