{"id":20009248,"url":"https://github.com/samlss/ballsloadingview","last_synced_at":"2025-05-04T19:35:52.577Z","repository":{"id":201738089,"uuid":"146579161","full_name":"samlss/BallsLoadingView","owner":"samlss","description":"⚽A loading view that includes four balls for animating.","archived":false,"fork":false,"pushed_at":"2018-08-29T10:02:38.000Z","size":610,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T11:38:00.112Z","etag":null,"topics":["android","ballloadingview","ballsloadingview","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-29T09:45:55.000Z","updated_at":"2022-10-26T23:16:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"284e391b-ec74-4f3b-8bc3-ecaacd22f536","html_url":"https://github.com/samlss/BallsLoadingView","commit_stats":null,"previous_names":["samlss/ballsloadingview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBallsLoadingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBallsLoadingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBallsLoadingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FBallsLoadingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/BallsLoadingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252390678,"owners_count":21740364,"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","ballloadingview","ballsloadingview","loadingview"],"created_at":"2024-11-13T07:14:50.279Z","updated_at":"2025-05-04T19:35:51.979Z","avatar_url":"https://github.com/samlss.png","language":"Java","readme":"# BallsLoadingView\n一个包含四个做循环动画的小球的loading view\n\n### [更多](https://github.com/samlss/FunnyViews)\n\n \u003cbr/\u003e\n\n[![Api reqeust](https://img.shields.io/badge/api-11+-green.svg)](https://github.com/samlss/BallsLoadingView)  [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/samlss/BallsLoadingView/blob/master/LICENSE) [![Blog](https://img.shields.io/badge/samlss-blog-orange.svg)](https://blog.csdn.net/Samlss)\n\n### 默认的 'translate' 动画效果\n![gif1](https://github.com/samlss/BallsLoadingView/blob/master/screenshots/screenshot1.gif)\n\n### 默认的 'scale' 动画效果\n![gif2](https://github.com/samlss/BallsLoadingView/blob/master/screenshots/screenshot2.gif)\n\n### 自定义颜色的 'scale' 动画效果\n![gif3](https://github.com/samlss/BallsLoadingView/blob/master/screenshots/screenshot3.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:BallsLoadingView:1.0'\n}\n```\n\n\n布局中：\n```java\n \u003ccom.iigo.library.BallsLoadingView\n          android:layout_marginTop=\"50dp\"\n          app:pointRadius=\"6dp\"\n          app:animType=\"scale\"\n          app:firstPointColor=\"@android:color/holo_green_dark\"\n          app:secondPointColor=\"@android:color/holo_red_dark\"\n          app:thirdPointColor=\"@android:color/holo_orange_dark\"\n          app:fourthPointColor=\"@android:color/holo_blue_dark\"\n          android:layout_width=\"100dp\"\n          android:layout_height=\"40dp\" /\u003e\n\n```\n\n\u003cbr\u003e\n\n代码：\n```java\n  ballsLoadingView.setAnimType(BallsLoadingView.ANIM_TYPE_SCALE); //设置动画类型\n  \n  ballsLoadingView.setBallRadius(6); //设置球的半径大小(像素)\n  \n  ballsLoadingView.setFirstBallColor(Color.RED); //设置第一个球的颜色\n  ballsLoadingView.setSecondBallColor(Color.BLACK); //设置第二个球的颜色\n  ballsLoadingView.setThirdBallColor(Color.GREEN); //设置第三个球的颜色\n  ballsLoadingView.setFourthBallColor(Color.BLUE); //设置第四个球的颜色\n  \n  ballsLoadingView.start(); //开始动画\n  ballsLoadingView.stop(); //停止动画\n  \n  ballsLoadingView.release(); //不需要使用该loading view的时候可手动释放，例如在activity的ondestroy()中\n```\n\u003cbr\u003e\n\n属性说明：\n\n| 属性      |              说明              |\n| --------- | :-----------------------------------: |\n| firstBallColor | 第一个球的颜色 |\n| secondBallColor | 第二个球的颜色|\n| thirdBallColor | 第三个球的颜色 |\n| fourthBallColor | 第四个球的颜色 |\n| ballRadius | 球的半径 |\n| animType | 动画类型(translate, scale) |\n\n\u003cbr\u003e\n\n# 注意\n\n我没有开放设置动画插值器和动画时间的相关接口，如果你需要拓展更多的功能，你可以通过下载源码进行修改\n\n## [LICENSE](https://github.com/samlss/BallsLoadingView/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fballsloadingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Fballsloadingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fballsloadingview/lists"}