{"id":20009251,"url":"https://github.com/samlss/barchartloadingview","last_synced_at":"2025-05-04T19:35:53.583Z","repository":{"id":201738111,"uuid":"146258294","full_name":"samlss/BarChartLoadingView","owner":"samlss","description":"📊A bar chart loading view that you can specify the number of bars.","archived":false,"fork":false,"pushed_at":"2018-08-27T07:09:51.000Z","size":2470,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T11:37:59.208Z","etag":null,"topics":["android","barchart","loadingview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samlss.png","metadata":{"files":{"readme":"README-ZH.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}},"created_at":"2018-08-27T06:52:35.000Z","updated_at":"2023-09-09T19:26:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"1f9bb7f3-6359-4100-b305-f3fa508aee2a","html_url":"https://github.com/samlss/BarChartLoadingView","commit_stats":null,"previous_names":["samlss/barchartloadingview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBarChartLoadingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBarChartLoadingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBarChartLoadingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBarChartLoadingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/BarChartLoadingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252390684,"owners_count":21740365,"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","barchart","loadingview"],"created_at":"2024-11-13T07:14:50.887Z","updated_at":"2025-05-04T19:35:52.235Z","avatar_url":"https://github.com/samlss.png","language":"Java","readme":"# BarChartLoadingView\n一个可以指定条形数量的条形图loading view\n\n \u003cbr/\u003e\n\n[![Api reqeust](https://img.shields.io/badge/api-11+-green.svg)](https://github.com/samlss/BarChartLoadingView)  [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/samlss/BarChartLoadingView/blob/master/LICENSE) [![Blog](https://img.shields.io/badge/samlss-blog-orange.svg)](https://blog.csdn.net/Samlss)\n\n\n![gif1](https://github.com/samlss/BarChartLoadingView/blob/master/screenshots/screenshot1.gif)\n\n![gif2](https://github.com/samlss/BarChartLoadingView/blob/master/screenshots/screenshot2.gif)\n\n### 使用\u003cbr\u003e\n在根目录的build.gradle添加这一句代码：\n```java\nallprojects {\n    repositories {\n        //...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n在app目录下的build.gradle添加依赖使用：\n```java\ndependencies {\n    implementation 'com.github.samlss:BarChartLoadingView:1.0'\n}\n```\n\n\n布局中使用：\n```java\n \u003ccom.iigo.library.BarChartLoadingView\n            android:id=\"@+id/bclv_loading1\"\n            app:barNumber=\"4\"\n            android:layout_centerInParent=\"true\"\n            android:layout_width=\"100dp\"\n            android:layout_height=\"100dp\" /\u003e\n\n```\n\n\u003cbr\u003e\n\n代码中使用：\n```java\n  barChartLoadingView.setBarNumber(6); //设置条形数量\n  barChartLoadingView.setColorSchemeColors(new int[]{Color.RED, Color.GREEN, Color.BLUE, Color.MAGENTA, Color.GRAY, Color.YELLOW}); //设置颜色数组\n  \n  barChartLoadingView.start(); //开始动画\n  barChartLoadingView.stop(); //结束动画\n  \n  barChartLoadingView.release(); //在你不需要该loadingview时使用\n```\n\u003cbr\u003e\n\n关于 **setColorSchemeColors** 方法:\n\n我会以下面代码举例\n```java\nbarChartLoadingView.setColorSchemeColors(new int[]{\n            Color.parseColor(\"#F47E60\"), //color1\n            Color.parseColor(\"#E15B64\"), //color2\n            Color.parseColor(\"#ABBD81\"), //color3\n            Color.parseColor(\"#F8B26A\"), //color4\n    });\n```\n![picture](https://github.com/samlss/BarChartLoadingView/blob/master/screenshots/description.png)\n\n针对每条bar，会根据设置的颜色数组，设置对应颜色数组下标的颜色，如果bar数量超过颜色数组的大小，则会通过对颜色数组取余来进行颜色设置\n\n\n属性说明：\n\n| 属性            |         说明         |\n| --------------- | :-------------------------: |\n| barNumber  | 设置条形数量 |\n\n\u003cbr\u003e\n\n# 注意\n\n我没有限制bar的数量（默认为4条），在你设置barNumber的时候，你应该结合实际的数量需求和性能影响， 从而设置一个合适的数量\n\n另外，如果你需要设置bar的动画的相关属性，你可以通过下载源码来进行修改\n\n------\n\n```\nvalueAnimator.setStartDelay(startDelay);\n```\n目前bar动是通过设置不同的随机startDelay值使视觉产生动画的不规则性，因此有可能造成这个startDelay值非常接近导致不规则性差距非常小，如果你需要更准确的不规则性动画，你可以通过下载源码来进行自定义\n\n## [LICENSE](https://github.com/samlss/BarChartLoadingView/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fbarchartloadingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Fbarchartloadingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fbarchartloadingview/lists"}