{"id":13644621,"url":"https://github.com/mcxtzhang/SwipeCaptcha","last_synced_at":"2025-04-21T10:33:55.078Z","repository":{"id":112693234,"uuid":"73688956","full_name":"mcxtzhang/SwipeCaptcha","owner":"mcxtzhang","description":"Swipe captcha of Android  platform.  Android 平台的滑动验证码。","archived":false,"fork":false,"pushed_at":"2019-04-19T03:35:30.000Z","size":1232,"stargazers_count":713,"open_issues_count":5,"forks_count":143,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-05T02:03:46.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://blog.csdn.net/zxt0601/article/details/53315975","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/mcxtzhang.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}},"created_at":"2016-11-14T09:34:14.000Z","updated_at":"2025-03-08T03:28:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"31aaafd9-fd38-4a1b-b4d0-0abe7426f4e7","html_url":"https://github.com/mcxtzhang/SwipeCaptcha","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxtzhang%2FSwipeCaptcha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxtzhang%2FSwipeCaptcha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxtzhang%2FSwipeCaptcha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mcxtzhang%2FSwipeCaptcha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mcxtzhang","download_url":"https://codeload.github.com/mcxtzhang/SwipeCaptcha/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040562,"owners_count":21365130,"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:09.614Z","updated_at":"2025-04-21T10:33:50.058Z","avatar_url":"https://github.com/mcxtzhang.png","language":"Java","funding_links":[],"categories":["表单","Generowanie","验证码生成工具"],"sub_categories":[],"readme":"# -SwipeCaptcha\nSwipe captcha of Android platform。\nAndroid 平台的滑动验证码。\n\n**在 Android端app上，自定义View，仿一个斗鱼web端滑动验证码**。\n博文：http://blog.csdn.net/zxt0601/article/details/53315975\n\n![我们的Demo,Ac娘镇楼](http://ac-mhke0kuv.clouddn.com/7fcb58653e358b9ec003.gif)\n\n# Usage 用法：\nStep 1. Add the JitPack repository to your build file\n在项目根build.gradle文件中增加JitPack仓库依赖。\n```\n    allprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url \"https://jitpack.io\" }\n\t\t}\n\t}\n```\nStep 2. Add the dependency\n```\n    dependencies {\n\t        compile 'com.github.mcxtzhang:SwipeCaptcha:V1.0.0'\n\t}\n```\n\n\nStep 3. \n```\n    \u003ccom.mcxtzhang.captchalib.SwipeCaptchaView\n        android:id=\"@+id/swipeCaptchaView\"\n        android:layout_width=\"300dp\"\n        android:layout_height=\"200dp\"\n        android:layout_centerHorizontal=\"true\"\n        android:scaleType=\"centerCrop\"\n        tools:src=\"@drawable/pic11\"\n        app:captchaHeight=\"30dp\"\n        app:captchaWidth=\"30dp\"/\u003e\n\n    \u003cSeekBar\n        android:id=\"@+id/dragBar\"\n        android:layout_width=\"320dp\"\n        android:layout_height=\"60dp\"\n        android:layout_below=\"@id/swipeCaptchaView\"\n        android:layout_centerHorizontal=\"true\"\n        android:layout_marginTop=\"30dp\"\n        android:progressDrawable=\"@drawable/dragbg\"\n        android:thumb=\"@drawable/thumb_bg\"/\u003e\n```\n\n\n\n\n那么本控件包含不仅包含以下功能：\n* 随机区域**起点(左上角x,y)**生成一个验证码阴影。\n* 验证码拼图 **凹凸图形**会随机变换。\n* 验证码区域**宽高**可自定义。\n* **抠图**验证码区域，绘制一个用于联动滑动的验证码滑块。\n* 验证失败，会闪烁几下然后回到原点。\n* 验证成功，会有白光扫过的动画。\n\n分解一下验证码核心实现思路：\n*  控件继承自ImageView。理由：\n1 如果放在项目中用，验证码图片希望可以是接口返回。ImageView以及其子类支持花式加载图片。\n2 继承自ImageView，绘制图片本身不用我们干预，也不用我们操心scaleType，节省很多工作。\n* 在`onSizeChanged()`方法中生成 和 控件宽高相关的属性值：\n1 初始化时随机生成验证码区域起点\n2 生成验证码区域Path\n3 生成滑块Bitmap\n* `onDraw()`时，依次绘制：\n1 验证码阴影\n2 滑块\n\n# to do list,待完善\n* abstract dragbar(seekbar) interface\n* SwipeCaptcha inside to hold the interface to do something\n\n* 抽象拖动条接口\n* SwipeCaptcha内部要持有这个接口 做一些事情\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcxtzhang%2FSwipeCaptcha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmcxtzhang%2FSwipeCaptcha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmcxtzhang%2FSwipeCaptcha/lists"}