Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Freshman111/VerificationCodeView

Open more actions menu

Repository files navigation

VerificationCodeView

VerificationCode View

可用于动态生成验证码,常见于金融类app

App Preview

jpgjpg

代码原理以及说明请看这一篇博客: Android实现动态验证码的技术调研与实现

建议将宽高比设置为5:2,如果不是5:2现在会按照5:2的比例居中显示到控件

usage

<sgffsg.com.verifycodeview.VerificationCodeView
    android:id="@+id/verifycodeview"
    android:layout_alignParentRight="true"
    android:layout_width="100dp"
    android:layout_height="40dp" />

verificationCodeView.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        edit_input.setText("");
        verificationCodeView.refreshCode();
    }
});

####请求网络验证码时

<sgffsg.com.verifycodeview.VerificationCodeView
    android:id="@+id/net_verifycodeview"
    android:layout_width="100dp"
    android:layout_height="40dp"
    android:visibility="gone"
    app:isNetCode="true"/>

Thanks

CaptchaImageView

##License MIT

About

VerificationCode View

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.