{"id":18565060,"url":"https://github.com/jenly1314/viewfinderview","last_synced_at":"2025-05-07T10:36:22.143Z","repository":{"id":159260241,"uuid":"616048341","full_name":"jenly1314/ViewfinderView","owner":"jenly1314","description":":dart: ViewfinderView 是一个取景视图：主要用于渲染扫描相关的动画效果。其样式主要分为两大类：经典样式（带扫描框）、流行样式（不带扫描框）；可任意定制。","archived":false,"fork":false,"pushed_at":"2025-04-20T06:08:53.000Z","size":14175,"stargazers_count":64,"open_issues_count":1,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-20T06:26:37.897Z","etag":null,"topics":["android","laser","scaning","scanner","scanning","view","viewfinder"],"latest_commit_sha":null,"homepage":"https://jenly1314.github.io/ViewfinderView/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenly1314.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2023-03-19T13:20:13.000Z","updated_at":"2025-04-20T06:06:45.000Z","dependencies_parsed_at":"2023-12-28T00:20:45.395Z","dependency_job_id":"f7d90967-151c-4bc4-9908-d0ac7c48ddd7","html_url":"https://github.com/jenly1314/ViewfinderView","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"e54e6dc7511a8c4d79267c87f0913bc2f087b559"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenly1314%2FViewfinderView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenly1314%2FViewfinderView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenly1314%2FViewfinderView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenly1314%2FViewfinderView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenly1314","download_url":"https://codeload.github.com/jenly1314/ViewfinderView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252860584,"owners_count":21815537,"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":["android","laser","scaning","scanner","scanning","view","viewfinder"],"created_at":"2024-11-06T22:17:33.478Z","updated_at":"2025-05-07T10:36:22.123Z","avatar_url":"https://github.com/jenly1314.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ViewfinderView\n\n[![Download](https://img.shields.io/badge/download-App-blue.svg)](https://raw.githubusercontent.com/jenly1314/ViewfinderView/master/app/release/app-release.apk)\n[![MavenCentral](https://img.shields.io/maven-central/v/com.github.jenly1314/viewfinderview)](https://repo1.maven.org/maven2/com/github/jenly1314/viewfinderview)\n[![JitPack](https://jitpack.io/v/jenly1314/ViewfinderView.svg)](https://jitpack.io/#jenly1314/ViewfinderView)\n[![CircleCI](https://circleci.com/gh/jenly1314/ViewfinderView.svg?style=svg)](https://circleci.com/gh/jenly1314/ViewfinderView)\n[![API](https://img.shields.io/badge/API-21%2B-blue.svg?style=flat)](https://android-arsenal.com/api?level=21)\n[![License](https://img.shields.io/badge/license-Apche%202.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n\n**ViewfinderView** 是一个取景视图：主要用于渲染扫描相关的动画效果。其样式主要分为两大类：`classic`：经典样式（带扫描框）、`popular`：流行样式（不带扫描框）；可任意定制。\n\n\u003e 如果你之前有使用过 [ZXingLite](https://github.com/jenly1314/ZXingLite) 或 [MLKit](https://github.com/jenly1314/MLKit)，可能会用到其内部的 **ViewfinderView**。现已将 **ViewfinderView** 独立出来，便于后续统一维护。\n\n\u003e 目前[ZXingLite](https://github.com/jenly1314/ZXingLite)、[MLKit](https://github.com/jenly1314/MLKit)、[WeChatQRCode](https://github.com/jenly1314/WeChatQRCode) 都已使用了此 **ViewfinderView** 作为通用的扫描渲染视图。\n\n## 效果展示\n![Image](GIF.gif)\n\n\u003e 你也可以直接下载 [演示App](https://raw.githubusercontent.com/jenly1314/ViewfinderView/master/app/release/app-release.apk) 体验效果\n\n## 引入\n\n### Gradle:\n\n\n1. 在Project的 **build.gradle** 或 **setting.gradle** 中添加远程仓库\n\n    ```gradle\n    repositories {\n        //...\n        mavenCentral()\n    }\n    ```\n\n2. 在Module的 **build.gradle** 中添加依赖项\n\n    ```gradle\n    implementation 'com.github.jenly1314:viewfinderview:1.3.0'\n\n    ```\n\n## 使用\n\n### ViewfinderView属性说明\n\n| 属性                       | 属性类型      | 默认值                                  | 属性说明                                                  |\n|:-------------------------|:----------|:-------------------------------------|:------------------------------------------------------|\n| vvViewfinderStyle        | enum      | classic                              | 取景框样式；支持`classic`：经典样式（带扫描框）、`popular`：流行样式（不带扫描框）    |\n| vvMaskColor              | color     | \u003cfont color=#000000\u003e#60000000\u003c/font\u003e | 扫描区外遮罩的颜色                                             |\n| vvFrameColor             | color     | \u003cfont color=#1FB3E2\u003e#7F1FB3E2\u003c/font\u003e | 扫描框边框的颜色                                              |\n| vvFrameWidth             | dimension |                                      | 扫描框宽度                                                 |\n| vvFrameHeight            | dimension |                                      | 扫描框高度                                                 |\n| vvFrameRatio             | float     | 0.625f                               | 扫描框与屏幕占比,当未设置扫描框的宽高时，使用占比来计算宽高                        |\n| vvFrameLineStrokeWidth   | dimension | 1dp                                  | 边框线宽度                                                 |\n| vvFramePaddingLeft       | dimension | 0                                    | 扫描框左边的内间距                                             |\n| vvFramePaddingTop        | dimension | 0                                    | 扫描框上边的内间距                                             |\n| vvFramePaddingRight      | dimension | 0                                    | 扫描框右边的内间距                                             |\n| vvFramePaddingBottom     | dimension | 0                                    | 扫描框下边的内间距                                             |\n| vvFrameGravity           | enum      | center                               | 扫描框对齐方式                                               |\n| vvFrameCornerColor       | color     | \u003cfont color=#1FB3E2\u003e#FF1FB3E2\u003c/font\u003e | 扫描框边角的颜色                                              |\n| vvFrameCornerSize        | dimension | 16dp                                 | 扫描框边角的大小                                              |\n| vvFrameCornerStrokeWidth | dimension | 4dp                                  | 扫描框边角的描边宽度                                            |\n| vvFrameCornerRadius      | dimension | 0dp                                  | 扫描框圆角半径                                               |\n| vvFrameDrawable          | reference |                                      | 扫描框自定义图片                                              |\n| vvLaserLineHeight        | dimension | 5dp                                  | 激光扫描线高度                                               |\n| vvLaserMovementSpeed     | dimension | 2dp                                  | 激光扫描线的移动速度                                            |\n| vvLaserAnimationInterval | integer   | 20                                   | 扫描动画延迟间隔时间，单位：毫秒                                      |\n| vvLaserGridColumn        | integer   | 20                                   | 网格激光扫描列数                                              |\n| vvLaserGridHeight        | dimension | 40dp                                 | 网格激光扫描高度，为0dp时，表示动态铺满                                 |\n| vvLaserGridStrokeWidth   | dimension | 1dp                                  | 网格线条的宽                                                |\n| vvLaserColor             | color     | \u003cfont color=#1FB3E2\u003e#FF1FB3E2\u003c/font\u003e | 扫描区激光线的颜色                                             |\n| vvLaserStyle             | enum      | line                                 | 激光扫描的样式                                               |\n| vvLaserDrawable          | reference |                                      | 激光扫描线自定义图片                                            |\n| vvLaserDrawableRatio     | float     | 0.625f                               | 激光扫描图片与屏幕占比                                           |\n| vvLabelText              | string    |                                      | 扫描提示文本信息                                              |\n| vvLabelTextColor         | color     | \u003cfont color=#C0C0C0\u003e#FFC0C0C0\u003c/font\u003e | 提示文本字体颜色                                              |\n| vvLabelTextSize          | dimension | 14sp                                 | 提示文本字体大小                                              |\n| vvLabelTextPadding       | dimension | 24dp                                 | 提示文本距离扫描框的间距                                          |\n| vvLabelTextWidth         | dimension |                                      | 提示文本的宽度，默认为View的宽度                                    |\n| vvLabelTextLocation      | enum      | bottom                               | 提示文本显示位置                                              |\n| vvPointColor             | color     | \u003cfont color=#1FB3E2\u003e#FF1FB3E2\u003c/font\u003e | 结果点的颜色                                                |\n| vvPointStrokeColor       | color     | \u003cfont color=#FFFFFF\u003e#FFFFFFFF\u003c/font\u003e | 结果点描边的颜色                                              |\n| vvPointRadius            | dimension | 15dp                                 | 结果点的半径                                                |\n| vvPointStrokeRatio       | float     | 1.2                                  | 结果点描边半径与结果点半径的比例                                      |\n| vvPointDrawable          | reference |                                      | 结果点自定义图片                                              |\n| vvPointAnimation         | boolean   | true                                 | 是否显示结果点的动画                                            |\n| vvPointAnimationInterval | integer   | 3000                                 | 结果点动画间隔时长；单位：毫秒                                       |\n| vvFullRefresh            | boolean   | false                                | 是否完全刷新；适用于`vvViewfinderStyle`为`classic`经典样式（带扫描框）时    |\n\n\u003e ViewfinderView相关的自定义属性统一使用 **vv** 开头。\n\n### 示例\n\n#### 布局示例\n\nViewfinderView 相关的自定义属性可查看上面的 [ViewfinderView属性说明](#ViewfinderView属性说明)\n\n```xml\n \u003ccom.king.view.viewfinderview.ViewfinderView\n     android:id=\"@+id/viewfinderView\"\n     android:layout_width=\"match_parent\"\n     android:layout_height=\"match_parent\"\n     app:vvLaserStyle=\"line\" /\u003e\n```\n\n更多使用详情，请查看[app](app)中的源码使用示例或直接查看 [API帮助文档](https://jenly1314.github.io/ViewfinderView/api/)\n\n## 相关推荐\n\n- [ZXingLite](https://github.com/jenly1314/ZXingLite) 基于zxing实现的扫码库，优化扫码和生成二维码/条形码功能。\n- [MLKit](https://github.com/jenly1314/MLKit) 一个强大易用的工具包。通过ML Kit您可以很轻松的实现文字识别、条码识别、图像标记、人脸检测、对象检测等功能。\n- [WeChatQRCode](https://github.com/jenly1314/WeChatQRCode) 基于OpenCV开源的微信二维码引擎移植的扫码识别库。\n- [CameraScan](https://github.com/jenly1314/CameraScan) 一个简化扫描识别流程的通用基础库。\n- [LibYuv](https://github.com/jenly1314/LibYuv) 基于Google的libyuv编译封装的YUV转换工具库，主要用途是在各种YUV与RGB之间进行相互转换、裁减、旋转、缩放、镜像等。\n\n\u003c!-- end --\u003e\n\n## 版本日志\n\n#### v1.3.0：2025-4-20\n* 新增属性：`vvFrameCornerRadius`（扫描框圆角半径）\n* 新增属性：`vvLaserGridStrokeWidth`（网格线条的宽）\n* 新增属性：`vvFullRefresh`（是否完全刷新）\n* 优化一些细节\n\n#### [查看更多版本日志](CHANGELOG.md)\n\n## 赞赏\n如果您喜欢ViewfinderView，或感觉ViewfinderView帮助到了您，可以点右上角“Star”支持一下，您的支持就是我的动力，谢谢 :smiley:\u003cp\u003e\n您也可以扫描下面的二维码，请作者喝杯咖啡 :coffee:\n\u003cdiv\u003e\n   \u003cimg src=\"https://jenly1314.github.io/image/page/rewardcode.png\"\u003e\n\u003c/div\u003e\n\n## 关于我\n\n| 我的博客                                                                                | GitHub                                                                                  | Gitee                                                                                  | CSDN                                                                                 | 博客园                                                                            |\n|:------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|\n| \u003ca title=\"我的博客\" href=\"https://jenly1314.github.io\" target=\"_blank\"\u003eJenly's Blog\u003c/a\u003e | \u003ca title=\"GitHub开源项目\" href=\"https://github.com/jenly1314\" target=\"_blank\"\u003ejenly1314\u003c/a\u003e | \u003ca title=\"Gitee开源项目\" href=\"https://gitee.com/jenly1314\" target=\"_blank\"\u003ejenly1314\u003c/a\u003e  | \u003ca title=\"CSDN博客\" href=\"http://blog.csdn.net/jenly121\" target=\"_blank\"\u003ejenly121\u003c/a\u003e  | \u003ca title=\"博客园\" href=\"https://www.cnblogs.com/jenly\" target=\"_blank\"\u003ejenly\u003c/a\u003e  |\n\n## 联系我\n\n| 微信公众号        | Gmail邮箱                                                                          | QQ邮箱                                                                              | QQ群                                                                                                                       | QQ群                                                                                                                       |\n|:-------------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------|\n| [Jenly666](http://weixin.qq.com/r/wzpWTuPEQL4-ract92-R) | \u003ca title=\"给我发邮件\" href=\"mailto:jenly1314@gmail.com\" target=\"_blank\"\u003ejenly1314\u003c/a\u003e | \u003ca title=\"给我发邮件\" href=\"mailto:jenly1314@vip.qq.com\" target=\"_blank\"\u003ejenly1314\u003c/a\u003e | \u003ca title=\"点击加入QQ群\" href=\"https://qm.qq.com/cgi-bin/qm/qr?k=6_RukjAhwjAdDHEk2G7nph-o8fBFFzZz\" target=\"_blank\"\u003e20867961\u003c/a\u003e | \u003ca title=\"点击加入QQ群\" href=\"https://qm.qq.com/cgi-bin/qm/qr?k=Z9pobM8bzAW7tM_8xC31W8IcbIl0A-zT\" target=\"_blank\"\u003e64020761\u003c/a\u003e |\n\n\u003cdiv\u003e\n   \u003cimg src=\"https://jenly1314.github.io/image/page/footer.png\"\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenly1314%2Fviewfinderview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenly1314%2Fviewfinderview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenly1314%2Fviewfinderview/lists"}