{"id":13645692,"url":"https://github.com/yongming9011/VerificationCodeView","last_synced_at":"2025-04-21T14:32:03.739Z","repository":{"id":217102703,"uuid":"79531193","full_name":"yongming9011/VerificationCodeView","owner":"yongming9011","description":"Android平台上的一款简单的验证码控件，支持各种自定义效果。","archived":false,"fork":false,"pushed_at":"2019-06-14T02:18:13.000Z","size":149,"stargazers_count":92,"open_issues_count":0,"forks_count":21,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-09T18:43:24.708Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yongming9011.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-20T06:12:38.000Z","updated_at":"2024-07-23T09:03:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"b067ed65-9f99-4992-bc8f-6a8b46e057c0","html_url":"https://github.com/yongming9011/VerificationCodeView","commit_stats":null,"previous_names":["yongming9011/verificationcodeview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yongming9011%2FVerificationCodeView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yongming9011%2FVerificationCodeView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yongming9011%2FVerificationCodeView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yongming9011%2FVerificationCodeView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yongming9011","download_url":"https://codeload.github.com/yongming9011/VerificationCodeView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250070253,"owners_count":21369843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T01:02:39.805Z","updated_at":"2025-04-21T14:32:03.199Z","avatar_url":"https://github.com/yongming9011.png","language":"Java","readme":"# 兄弟们，哥们早从Android脱坑了，入了后台的坑，该项目早已停止维护，要用于生产环境的请慎重！\n\n# 一、添加依赖\n\n1. **Android Studio**：在项目的根目录下build.gradle里的allprojects下添加如下引用：\n\n```groovy\n   allprojects {\n   \trepositories {\n   \t\t...\n   \t\tmaven { url 'https://jitpack.io' }\n   \t}\n   }\n```\n\n   然后在app目录下 build.gradle 下添加依赖\n\n```groovy\n   dependencies {\n   \t   compile 'com.github.yongming9011:VerificationCodeView:v1.0'\n   }\n```\n\n   ​\n\n2. **Eclipse**：下载项目，将library里面的VerificationCodeView.java跟res/values/attrs.xml文件拷贝进项目。\n\n# 二、用法\n\n- 在布局中集成，注意需要在布局的根节点添加命名`xmlns:zhangym=\"http://schemas.android.com/apk/res-auto\"` 方可使用自定义属性。\n\n  ```xml\n   \u003ccom.zhangym.customview.VerificationCodeView\n          android:id=\"@+id/verificationCodeView\"\n          android:layout_width=\"wrap_content\"\n          android:layout_height=\"wrap_content\"\n          android:layout_centerInParent=\"true\"\n          android:padding=\"20dp\"\n          zhangym:interferenceCirclesCount=\"40\"\n          zhangym:interferenceCirclesRadius=\"5\"\n          zhangym:interferenceLinesCount=\"10\"\n          zhangym:isShowInterferenceCircles=\"true\"\n          zhangym:isShowInterferenceLines=\"true\"\n          zhangym:isTextBold=\"true\"\n          zhangym:textSize=\"50sp\"\n          zhangym:textSkewX=\"0\"\n          zhangym:verificationText=\"9D27\" /\u003e\n  ```\n\n\n- 对应属性说明如下：\n\n  ```xml\n          \u003c!-- 验证码文本 --\u003e\n          \u003cattr name=\"verificationText\" format=\"string\" /\u003e\n          \u003c!-- 设置验证码文本的颜色 --\u003e\n          \u003cattr name=\"textColor\" format=\"color\" /\u003e\n          \u003c!-- 设置验证码文本尺寸 --\u003e\n          \u003cattr name=\"textSize\" format=\"dimension\" /\u003e\n          \u003c!-- 设置验证码是否有下划线 --\u003e\n          \u003cattr name=\"isUnderLine\" format=\"boolean\" /\u003e\n          \u003c!-- 验证码字体是否为粗体--\u003e\n          \u003cattr name=\"isTextBold\" format=\"boolean\" /\u003e\n          \u003c!-- 设置文本的倾斜度，默认为0 ,正数左斜，负数右斜--\u003e\n          \u003cattr name=\"textSkewX\" format=\"float\" /\u003e\n          \u003c!-- 设置验证码字体风格，暂时先不要使用，后续完善 --\u003e\n          \u003cattr name=\"typeFace\" format=\"integer\" /\u003e\n          \u003c!-- 设置验证码文字宽度--\u003e\n          \u003cattr name=\"strokeWidth\" format=\"float\" /\u003e\n          \u003c!-- 是否显示干扰线条,默认为true --\u003e\n          \u003cattr name=\"isShowInterferenceLines\" format=\"boolean\" /\u003e\n          \u003c!-- 设置干扰线条的数量，默认10条 --\u003e\n          \u003cattr name=\"interferenceLinesCount\" format=\"integer\" /\u003e\n          \u003c!-- 设置干扰线条的颜色，如果不设置，默认为随机生成的颜色--\u003e\n          \u003cattr name=\"interferenceLinesColor\" format=\"color\" /\u003e\n          \u003c!--设置干扰线条的宽度，默认为3--\u003e\n          \u003cattr name=\"interferenceLinesWidth\" format=\"float\" /\u003e\n          \u003c!-- 设置是否显示干扰圆点，默认为true --\u003e\n          \u003cattr name=\"isShowInterferenceCircles\" format=\"boolean\" /\u003e\n          \u003c!-- 设置干扰圆点的数量，默认100个--\u003e\n          \u003cattr name=\"interferenceCirclesCount\" format=\"integer\" /\u003e\n          \u003c!-- 设置干扰圆点的颜色，如果不设置，默认为随机生成的颜色--\u003e\n          \u003cattr name=\"interferenceCirclesColor\" format=\"color\" /\u003e\n          \u003c!--设置干扰圆点的半径，默认为5--\u003e\n          \u003cattr name=\"interferenceCirclesRadius\" format=\"float\" /\u003e\n          \u003c!-- 设置验证码背景色，默认为灰色--\u003e\n          \u003cattr name=\"verificationCodeBackground\" format=\"color\" /\u003e\n  ```\n\n以上属性均有对应的 setter方法，也可以在Java代码中进行设置。\n\n\n\n# 三、对应方法的说明\n\n|                    方法                    |             说明             |\n| :--------------------------------------: | :------------------------: |\n| setShowInterferenceLines(boolean showInterferenceLines) |      设置是否显示干扰线条，默认显示       |\n| setShowInterferenceCircles(boolean showInterferenceCircles) |      设置是否显示干扰圆点，默认显示       |\n|      setTextBold(boolean textBold)       |     设置验证码文本是否加粗，默认不加粗      |\n| setCircleColorRandom(boolean circleColorRandom) |    设置干扰圆点是否为随机颜色，默认为随机     |\n| setLineColorRandom(boolean lineColorRandom) |    设置干扰线条颜色是否为随机，默认为随机     |\n| setVerificationText(String verificationText) |         设置验证码文本内容          |\n| setVerificationCodeBackground(int verificationCodeBackground) |      设置验证码的背景色，默认为灰色       |\n| setInterferenceLinesCount(int interferenceLinesCount) |      设置干扰线条的数量，默认为10条      |\n| setInterferenceLinesColor(int interferenceLinesColor) |  设置干扰线条的颜色，如果设置了颜色，则颜色不再   |\n| setInterferenceLinesWidth(float interferenceLinesWidth) |       设置干扰线条的宽度，默认为3       |\n| setInterferenceCirclesCount(int interferenceCirclesCount) |         设置干扰圆点的数量          |\n| setInterferenceCirclesColor(int interferenceCirclesColor) |    设置干扰圆点的颜色，如果设置，则不再随机    |\n| setInterferenceCirclesRadius(float interferenceCirclesRadius) |       设置干扰圆点的半径，默认为5       |\n|       setTextColor(int textColor)        |        设置验证码文本，默认黑色        |\n|        setTextSize(int textSize)         |         设置验证码文本大小          |\n|     setUnderLine(boolean underLine)      |       设置验证码文本是否有下划线        |\n|      setTextSkewX(float textSkewX)       | 设置验证码文本的倾斜值，正数左斜，负数右斜，默认为0 |\n|    setStrokeWidth(float strokeWidth)     |         设置验证码文本的宽度         |\n\n\n\n# 四、效果图\n\n![效果图](https://ww1.sinaimg.cn/large/006y8lValy1fbxzq88636g309t0injss.gif)\n\n\n# 五、联系方式\n\n- [我的博客](http://zhangym.xyz/)\n- **Gmail**:yongming9011@gmail.com\n","funding_links":[],"categories":["其他"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyongming9011%2FVerificationCodeView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyongming9011%2FVerificationCodeView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyongming9011%2FVerificationCodeView/lists"}