All Projects → jiaoyaning → Verificationcodeview

jiaoyaning / Verificationcodeview

Android 自定义方形输入框,仿滴滴验证码输入框

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Verificationcodeview

manon
🧪 Play with SpringBoot 2, JWT, Querydsl, GraphQL, Docker, ELK, PostgreSQL, MariaDB, Redis, MongoDB, Flyway, Maven, Gradle, TestNG, JUnit5, JaCoCo, GreenMail, CI, Quality Gates, Prometheus, Gatling, etc.
Stars: ✭ 26 (-89.76%)
Mutual labels:  gradle
emailkit
EmailKit for Android - This is a powerful, excellent and simple Email framework💌.
Stars: ✭ 99 (-61.02%)
Mutual labels:  gradle
AndroidIDE
AndroidIDE is an IDE for Android to develop full featured Android apps on Android smartphones.
Stars: ✭ 98 (-61.42%)
Mutual labels:  gradle
broom
A disk cleaning utility for developers.
Stars: ✭ 38 (-85.04%)
Mutual labels:  gradle
gradle-multi-project-support
A collection of Gradle plugins to maintain the multi-project or multi-application in the mono-repo.
Stars: ✭ 63 (-75.2%)
Mutual labels:  gradle
StuyLib
Award-Winning FRC Library by StuyPulse Team 694
Stars: ✭ 17 (-93.31%)
Mutual labels:  gradle
Allomancy
Brandon Sanderson's Allomancy, now in Minecraft
Stars: ✭ 18 (-92.91%)
Mutual labels:  gradle
Spongevanilla
The SpongeAPI implementation for Vanilla Minecraft.
Stars: ✭ 254 (+0%)
Mutual labels:  gradle
owl2neo4j
Convert OWL to labeled property graph and import into Neo4J
Stars: ✭ 42 (-83.46%)
Mutual labels:  gradle
gradle-upgrade-interactive
CLI to interactively upgrade gradle dependencies, inspired by yarn.
Stars: ✭ 44 (-82.68%)
Mutual labels:  gradle
plugin-yml
A Gradle plugin that generates plugin.yml for Bukkit/BungeeCord/Nukkit plugins based on the Gradle project
Stars: ✭ 42 (-83.46%)
Mutual labels:  gradle
gradle-console-reporter
Gradle plugin to report various kinds of summaries to console.
Stars: ✭ 49 (-80.71%)
Mutual labels:  gradle
change-tracker-plugin
A Gradle plugin to help analyse the dependency between modules and run tasks only on modules impacted by specific set of changes.
Stars: ✭ 103 (-59.45%)
Mutual labels:  gradle
gradle-screen-record
A GIF recorder, based on gradle script to record screen in Android Device, and the record (XXX.gif) will be auto uploaded to your PC.
Stars: ✭ 19 (-92.52%)
Mutual labels:  gradle
schema-registry-plugin
Gradle plugin to interact with Confluent Schema-Registry.
Stars: ✭ 60 (-76.38%)
Mutual labels:  gradle
gradle-libraries-plugin
No description or website provided.
Stars: ✭ 29 (-88.58%)
Mutual labels:  gradle
ClockScroller
A cool animated RecyclerView clock face scroller handle inspired by the following MaterialUp submission - https://material.uplabs.com/posts/codepen-scrolling-clock
Stars: ✭ 75 (-70.47%)
Mutual labels:  gradle
Animatefx
A library of +70 ready-to-use animations for JavaFX
Stars: ✭ 254 (+0%)
Mutual labels:  gradle
gito
⚡ git helper tool to clone/open/auto-install/edit with a one-liner
Stars: ✭ 26 (-89.76%)
Mutual labels:  gradle
RecyclerELE
Android Library for easy addition of Empty, Loading and Error views in a RecyclerView
Stars: ✭ 27 (-89.37%)
Mutual labels:  gradle

VerificationCodeView

Android 自定义方形输入框,仿滴滴验证码、小篮单车验证码输入框


V1.0.1 版 效果图

Screenshot

监听

public interface OnCodeFinishListener {
        /**
         * 文本改变
         */
        void onTextChange(View view, String content);

        /**
         * 输入完成
         */
        void onComplete(View view, String content);
    }

attr

    <!-- 自定义验证码输入框-->
    <declare-styleable name="vericationCodeView">
        <!--输入框的数量-->
        <attr name="vcv_et_number" format="integer" />
        <!--输入类型-->
        <attr name="vcv_et_inputType">
            <enum name="number" value="0" />
            <enum name="numberPassword" value="1" />
            <enum name="text" value="2" />
            <enum name="textPassword" value="3" />
        </attr>
        <!--输入框的宽度-->
        <attr name="vcv_et_width" format="dimension|reference" />
        <!--输入框文字颜色-->
        <attr name="vcv_et_text_color" format="color|reference" />
        <!--输入框文字大小-->
        <attr name="vcv_et_text_size" format="dimension|reference" />
        <!--输入框背景-->
        <attr name="vcv_et_bg" format="reference" />
        <!--光标样式-->
        <attr name="vcv_et_cursor" format="reference" />
        <!--是否隐藏光标-->
        <attr name="vcv_et_cursor_visible" format="boolean" />
        <!--输入框间距,如果不设置则会把输入框位置平分-->
        <attr name="vcv_et_spacing" format="dimension|reference" />

    </declare-styleable>

Gradle

Step 1. Add it in your root build.gradle at the end of repositories:

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

Step 2. Add the dependency

dependencies {
     compile 'com.jyn.verificationcodeview:verificationcodeview:1.0.1'
}

用法

   <com.jyn.vcview.VerificationCodeView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:gravity="center"
        android:orientation="horizontal"
        app:vcv_et_bg="@drawable/et_code_test1"
        app:vcv_et_cursor="@drawable/et_cursor"
        app:vcv_et_cursor_visible="false"
        app:vcv_et_inputType="numberPassword"
        app:vcv_et_number="6"
        app:vcv_et_spacing="6dp"
        app:vcv_et_text_color="#FFC107"
        app:vcv_et_text_size="6sp" />

vcv_et_bg 背景示例(默认)

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">

    <item android:state_window_focused="false">
        <shape android:shape="rectangle">
            <solid android:color="#FFFFFF" />
            <stroke android:width="1dp" android:color="#C4C4C4" />
            <corners android:radius="5dp" />
        </shape>
    </item>

    <item android:state_focused="true">
        <shape android:shape="rectangle">
            <solid android:color="#ffffff" />
            <stroke android:width="1dp" android:color="#0dbc75" />
            <corners android:radius="5dp" />
        </shape>
    </item>
</selector>

vcv_et_cursor 光标示例(默认)

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <size android:width="2dp" />
    <solid android:color="#0dbc75" />
</shape>

备注:V1.0.0 版在 branch - V1.0.0

开发思路

简书:http://www.jianshu.com/p/781950fe5e73
CSDN:http://blog.csdn.net/jiaoyaning1210/article/details/78427818


如果对您有帮助的话,还请给个star,谢谢!


Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].