{"id":27402333,"url":"https://github.com/hi-dhl/jprogressview","last_synced_at":"2025-07-24T03:06:59.102Z","repository":{"id":107967412,"uuid":"279120189","full_name":"hi-dhl/JProgressView","owner":"hi-dhl","description":"一个灵活的进度条，支持图形：圆形、圆角矩形、矩形等等，陆续会添加更多的图形，如果对你有帮助，请在右上角 star 一下，感谢","archived":false,"fork":false,"pushed_at":"2020-12-18T02:33:24.000Z","size":122,"stargazers_count":77,"open_issues_count":2,"forks_count":14,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-14T04:30:37.585Z","etag":null,"topics":["circle","progressview","rectangle","rectangle-detection","view"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/hi-dhl.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2020-07-12T18:03:48.000Z","updated_at":"2024-10-25T07:02:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"375ebb23-5513-46ce-b2f0-239ae1f9e9d9","html_url":"https://github.com/hi-dhl/JProgressView","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hi-dhl/JProgressView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FJProgressView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FJProgressView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FJProgressView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FJProgressView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hi-dhl","download_url":"https://codeload.github.com/hi-dhl/JProgressView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hi-dhl%2FJProgressView/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266786798,"owners_count":23983871,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["circle","progressview","rectangle","rectangle-detection","view"],"created_at":"2025-04-14T04:25:10.250Z","updated_at":"2025-07-24T03:06:59.093Z","avatar_url":"https://github.com/hi-dhl.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# \u003cp align=\"center\"\u003e JProgressView \u003cbr/\u003e \u003cimg src='http://cdn.51git.cn/2020-07-15-15948208369286.gif'\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e 如果这个仓库对你有帮助，请仓库右上角帮我 star 一下\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n一个小巧灵活可定制的进度条，支持图形：圆形、圆角矩形、矩形等等，陆续会添加更多的图形\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/hi-dhl\"\u003e\u003cimg src=\"https://img.shields.io/badge/GitHub-HiDhl-4BC51D.svg?style=flat\"\u003e\u003c/a\u003e \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache2.0-blue.svg?style=flat\"\u003e\u003c/a\u003e \u003cimg src=\"https://img.shields.io/badge/language-kotlin-orange.svg\"/\u003e \u003cimg src=\"https://img.shields.io/badge/platform-android-lightgrey.svg\"/\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"http://cdn.51git.cn/2020-07-13-15946108487308.gif\"/\u003e \n\u003c/p\u003e\n\n## JProgressView 包含以下功能\n\n* 支持在 XML 中配置是否自动播放动画（true : 当 view 可见的时候会自动播放动画）\n* 支持自定义图形：圆形、圆角矩形、矩形\n* 支持代码和 XML 设置进度条属性；同时设置代码会覆盖 XML 设置的属性\n* 支持设置文字是否显示，文字距离进度条的位置、大小、颜色等等\n* 支持设置进度的的颜色，当前进度值、进度的最大值、动画运行时间等等\n* 更多功能正在开发中...... \n\n## Download\n\n* 将下列代码添加在项目 build.gradle 文件内\n\n```\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n```\n\n* 将下列代码添加进模块 build.gradle 文件内\n\n```\ndependencies {\n    implementation 'com.hi-dhl:progressview:1.0.2'\n}\n```\n\n## Usage\n\n**1.在 layout 文件内添加以下命名空间**\n\n```\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n```\n\n**2.实现一个进度条基本示例**\n\n```\n\u003ccom.hi.dhl.jprogressview.JProgressView\n    android:id=\"@+id/circleProgresssView0\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"20dp\"\n    app:progress_animate_duration=\"1500\"\n    app:progress_color=\"@color/progress_color\"\n    app:progress_color_background=\"@color/progress_color_background\"\n    app:progress_paint_bg_width=\"@dimen/progress_paint_width\"\n    app:progress_paint_value_width=\"@dimen/progress_paint_width\"\n    app:progress_rect_text_align=\"1\"\n    app:progress_text_color=\"@color/progress_text_color\"\n    app:progress_text_size=\"@dimen/text_size_14sp\"\n    app:progress_text_visible=\"true\"\n    app:progress_type=\"2\"\n    app:progress_value=\"40\"\n    app:progress_rect_radius=\"8dp\"\n    app:progress_value_max=\"100\" /\u003e\n```\n\n**通用属性，适合所有形状的进度条：**\n\n| 名称 | 值类型 | 默认值 | 备注 |\n| --- | --- | --- | --- |\n| progress_type | integer  | 圆形：1 | 矩形：0；圆形：1；圆角矩形：2 |\n| progress_animate_duration | integer | 2000 | 动画运行时间 |\n| progress_color | color | Color.GRAY | 当前进度颜色 |\n| progress_color_background | color  | Color.GRAY | 进度条背景颜色 |\n| progress_paint_bg_width | dimen | 10 | 进度条背景画笔的宽度 |\n| progress_paint_value_width | dimen | 10 | 当前进度画笔的宽度 |\n| progress_text_color | color | Color.BLUE | 进度条上的文字的颜色 |\n| progress_text_size | dimen | `sp2Px(20f)` | 进度条上的文字的大小 |\n| progress_text_visible | boolean | 默认不显示：false | 是否显示文字 |\n| progress_value | integer | 0 | 当前进度 |\n| progress_value_max | integer | 100 | 当前进度条的最大值 |\n| progress_start_animate | boolean | 默认不自动开启：false | 是否开动画自动播放 |\n\n**以下属性，矩形 或者 圆角矩形进度条专有属性：**\n\n| 名称 | 值类型 | 默认值 | 备注 |\n| --- | --- | --- | --- |\n| progress_rect_text_align | integer  | 中间：1 | 文字位于进度条位置(左边：0；中间：1；右边：2) |\n| progress_rect_radius | dimen  | 0 | 进度条圆角 |\n\n**以下属性，圆形进度条专有属性：**\n\n| 名称 | 值类型 | 默认值 | 备注 |\n| --- | --- | --- | --- |\n| progress_circle_sweep_angle | integer  | top：1 | 进度条开始角度(left：0；top：1；right：2；bottom：3) |\n\n### 开启或停止动画\n\n默认不开启动画，在需要开启动画的地方调用以下代码：\n\n```\ncircleProgresssView0.startAnimal()\n```\n\n调用以下代码停止动画：\n\n```\nprogresssView.stopAnimal()\n```\n\n还可以通过代码设置进度条一些属性，代码会覆盖 XML 设置的属性\n\n```\nprogresssView\n    .setProgress(0f)// 当前进度\n    .setMaxProgress(100)// 进度条的最大值\n    .setReverse(false)// 进度条回放\n    .setAnimateDuration(1000)// 动画运行时间\n    .isShowText(true)// 是否显示文字\n    .setProgressColor(resources.getColor(R.color.progress_color, null))// 当前进度颜色\n    .setProgressColorBackground(resources.getColor(R.color.progress_color_background, null))// 进度条背景颜色\n    .setRectRadius(resources.getDimension(R.dimen.common_radius_8dp))// 圆角\n    .setRectTextAlign(1)// 文字位于进度条位置(左边：0；中间：1；右边：2)\n    .setTextColor(resources.getColor(R.color.progress_text_color, null))// 文字颜色\n    .setTextSize(resources.getDimension(R.dimen.text_size_14sp))// 文字大小\n    .setShapeType(2)// 形状： 矩形：0；圆形：1；圆角矩形：2\n    .setProgressPaintBackgroundWidth(resources.getDimension(R.dimen.progress_paint_width))// 进度条背景画笔的宽度\n    .setProgressPaintWidth(resources.getDimension(R.dimen.progress_paint_width))// 当前进度画笔的宽度\n    .resetValue()// 通过代码设置完属性之后，需要调用，重新绘制\n```\n\n未来还未支持更多自定义图形，请持续关注，如果这个仓库对你有帮助，请仓库右上角帮我 star 一下。\n\n---\n\n最后推荐我一直在更新维护的项目和网站：\n\n* 计划建立一个最全、最新的 AndroidX Jetpack 相关组件的实战项目 以及 相关组件原理分析文章，正在逐渐增加 Jetpack 新成员，仓库持续更新，欢迎前去查看：[AndroidX-Jetpack-Practice](https://github.com/hi-dhl/AndroidX-Jetpack-Practice)\n\n* LeetCode / 剑指 offer / 国内外大厂面试题 / 多线程 题解，语言 Java 和 kotlin，包含多种解法、解题思路、时间复杂度、空间复杂度分析\u003cbr/\u003e\n\n    \u003cimage src=\"http://cdn.51git.cn/2020-10-04-16017884626310.jpg\" width = \"500px\"/\u003e\n  \n    * 剑指 offer 及国内外大厂面试题解：[在线阅读](https://offer.hi-dhl.com)\n    * LeetCode 系列题解：[在线阅读](https://leetcode.hi-dhl.com)\n\n* 最新 Android 10 源码分析系列文章，了解系统源码，不仅有助于分析问题，在面试过程中，对我们也是非常有帮助的，仓库持续更新，欢迎前去查看 [Android10-Source-Analysis](https://github.com/hi-dhl/Android10-Source-Analysis)\n\n* 整理和翻译一系列精选国外的技术文章，每篇文章都会有**译者思考**部分，对原文的更加深入的解读，仓库持续更新，欢迎前去查看 [Technical-Article-Translation](https://github.com/hi-dhl/Technical-Article-Translation)\n\n* 「为互联网人而设计，国内国外名站导航」涵括新闻、体育、生活、娱乐、设计、产品、运营、前端开发、Android 开发等等网址，欢迎前去查看 [为互联网人而设计导航网站](https://site.51git.cn)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhi-dhl%2Fjprogressview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhi-dhl%2Fjprogressview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhi-dhl%2Fjprogressview/lists"}