{"id":20009230,"url":"https://github.com/samlss/diceloadingview","last_synced_at":"2025-05-04T19:35:49.872Z","repository":{"id":201738133,"uuid":"145825662","full_name":"samlss/DiceLoadingView","owner":"samlss","description":"🎲A dice 3D rotation loading view.","archived":false,"fork":false,"pushed_at":"2018-12-28T02:20:36.000Z","size":4585,"stargazers_count":96,"open_issues_count":2,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-08T11:37:56.272Z","etag":null,"topics":["android","diceloadingview","diceview","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-23T08:38:46.000Z","updated_at":"2024-10-20T08:56:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"104cd40d-a39a-45bd-83b3-c9105266876e","html_url":"https://github.com/samlss/DiceLoadingView","commit_stats":null,"previous_names":["samlss/diceloadingview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDiceLoadingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDiceLoadingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDiceLoadingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDiceLoadingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/DiceLoadingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252390642,"owners_count":21740356,"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","diceloadingview","diceview","loadingview"],"created_at":"2024-11-13T07:14:43.845Z","updated_at":"2025-05-04T19:35:49.310Z","avatar_url":"https://github.com/samlss.png","language":"Java","readme":"# DiceLoadingView\n\n一个骰子3D旋转loading view \n\n你可以指定立方体中每一面骰子的点数，颜色和背景，同时也可以指定执行的动画时间和动画插值器\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/DiceLoadingView)  [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/samlss/DiceLoadingView/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/DiceLoadingView/blob/master/screenshots/screenshot1.gif)\n\n![gif2](https://github.com/samlss/DiceLoadingView/blob/master/screenshots/screenshot2.gif)\n\n![gif3](https://github.com/samlss/DiceLoadingView/blob/master/screenshots/screenshot3.gif)\n\n------\n\n### 使用\u003cbr\u003e\n在根目录的build.gradle添加这一句代码： \n\n```\nallprojects {\n    repositories {\n        //...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n在app目录下的build.gradle添加依赖使用： \n\n```\ndependencies {\n    implementation 'com.github.samlss:DiceLoadingView:1.0'\n}\n\n```\n------\n\n在开始介绍DiceLoadingView之前，先看一下骰子即DeiceView的组成\n\n## DiceView\n在DiceLoadingView中应用的骰子view\n\n以下为效果图：\u003cbr\u003e\n![DiceView](https://github.com/samlss/DiceLoadingView/blob/master/screenshots/screenshot4.png)\n\n### 使用\u003cbr\u003e\n布局中：\n\n```\n\u003ccom.iigo.library.DiceView\n            android:layout_marginTop=\"10dp\"\n            app:number=\"one\"\n            app:bgColor=\"@android:color/white\"\n            app:borderColor=\"@color/colorPrimary\"\n            app:pointColor=\"@color/colorPrimary\"\n            android:layout_width=\"50dp\"\n            android:layout_height=\"50dp\" /\u003e\n```\n\n代码：\n\n```\ndiceView.setNumber(2); //设置骰子点数，必须为1-6\ndiceView.setPointColor(Color.RED); //设置点的颜色\ndiceView.setBgColor(Color.RED); //设置背景颜色\ndiceView.setBorderColor(Color.RED); //设置边界颜色\n```\n\n属性说明：\n\n开始描述效果图之前，先看一张说明图：\n\n![picture](https://github.com/samlss/DiceLoadingView/blob/master/screenshots/description2.png)\n\n| attr            |         description         |\n| --------------- | :-------------------------: |\n| number | 骰子点数 one(1), two(2), three(3), four(4), five(5), six(6) |\n| pointColor  | 点的颜色 |\n| bgColor  | 背景颜色 |\n| borderColor | 边界颜色 |\n\n## DiceLoadingView\n### 使用\u003cbr\u003e\n\n布局中使用： \n\n```\n \u003ccom.iigo.library.DiceLoadingView\n                    android:id=\"@+id/dlv_loading1\"\n                    app:animDuration=\"2000\"\n                    app:animInterpolator=\"AccelerateDecelerateInterpolator\"\n                    app:firstSideDiceNumber=\"1\"\n                    app:firstSideDicePointColor=\"@color/colorPrimary\"\n                    app:firstSideDiceBgColor=\"@android:color/white\"\n                    app:firstSideDiceBorderColor=\"@color/colorPrimary\"\n                    app:secondSideDiceNumber=\"2\"\n                    app:secondSideDicePointColor=\"@android:color/holo_orange_dark\"\n                    app:secondSideDiceBgColor=\"@android:color/white\"\n                    app:secondSideDiceBorderColor=\"@android:color/holo_orange_dark\"\n                    app:thirdSideDiceNumber=\"3\"\n                    app:thirdSideDicePointColor=\"@android:color/holo_red_dark\"\n                    app:thirdSideDiceBgColor=\"@android:color/white\"\n                    app:thirdSideDiceBorderColor=\"@android:color/holo_red_dark\"\n                    app:fourthSideDiceNumber=\"4\"\n                    app:fourthSideDiceBgColor=\"@android:color/white\"\n                    app:fourthSideDiceBorderColor=\"@android:color/holo_green_dark\"\n                    app:fourthSideDicePointColor=\"@android:color/holo_green_dark\"\n                    android:layout_width=\"50dp\"\n                    android:layout_height=\"50dp\" /\u003e\n\n```\n\n\u003cbr\u003e\n\n代码中使用： \n\n```java\ndiceLoadingView.start(); //开始动画\ndiceLoadingView.stop(); //停止动画\ndiceLoadingView.pause(); //暂停动画\ndiceLoadingView.resume(); //恢复动画\ndiceLoadingView.release(); //不需要使用该loading view的时候可手动释放，例如在activity的ondestroy()中\n\ndiceLoadingView.setDuration(3000); //设置动画时间\ndiceLoadingView.setInterpolator(new AnticipateOvershootInterpolator()); //设置动画插值器\ndiceLoadingView.setFirstSideDiceNumber(2); //设置第一面骰子点数(1-6)\ndiceLoadingView.setFirstSidePointColor(Color.parseColor(\"#FF7D81\")); //设置第一面骰子点的颜色\ndiceLoadingView.setFirstSideDiceBgColor(Color.WHITE); //设置第一面骰子背景颜色\ndiceLoadingView.setFirstSideDiceBorderColor(Color.GRAY); //设置第一面骰子边界颜色\n\ndiceLoadingView.setSecondSideDiceNumber(3); //设置第二面骰子点数(1-6)\ndiceLoadingView.setSecondSidePointColor(Color.BLUE); //设置第二面骰子点的颜色\ndiceLoadingView.setSecondSideDiceBgColor(Color.WHITE); //设置第二面骰子背景颜色\ndiceLoadingView.setSecondSideDiceBorderColor(Color.BLUE); //设置第二面骰子边界颜色\n\ndiceLoadingView.setThirdSideDiceNumber(4); //设置第三面骰子点数(1-6)\ndiceLoadingView.setThirdSidePointColor(Color.GREEN); //设置第三面骰子点的颜色\ndiceLoadingView.setThirdSideDiceBgColor(Color.WHITE); //设置第三面骰子背景颜色\ndiceLoadingView.setThirdSideDiceBorderColor(Color.GREEN); //设置第三面骰子边界颜色\n\ndiceLoadingView.setFourthSideDiceNumber(5); //设置第四面骰子点数(1-6)\ndiceLoadingView.setFourthSidePointColor(Color.RED); //设置第四面骰子点的颜色\ndiceLoadingView.setFourthSideDiceBgColor(Color.WHITE); //设置第四面骰子背景颜色\ndiceLoadingView.setFourthSideDiceBorderColor(Color.RED); //设置第四面骰子边界颜色\n```\n\u003cbr\u003e\n\n\n属性说明：\n\n开始描述效果图之前，先看两张张说明图：\n\n针对立方体而言\n\n![picture](https://github.com/samlss/DiceLoadingView/blob/master/screenshots/description1.png)\n\n针对每一个骰子面而言:\n\n![picture](https://github.com/samlss/DiceLoadingView/blob/master/screenshots/description2.png)\n\n\n| attr            |         description         |\n| --------------- | :-------------------------: |\n| animDuration  | 动画时间 |\n| animInterpolator | 动画加速器 |\n| firstSideDiceNumber  | 第一面骰子点数(1-6) |\n| firstSideDicePointColor | 第一面骰子点的颜色 |\n| firstSideDiceBgColor  | 第一面骰子背景颜色 |\n| firstSideDiceBorderColor | 第一面骰子边界颜色 |\n| secondSideDiceNumber  | 第二面骰子点数(1-6) |\n| secondSideDicePointColor | 第二面骰子点的颜色 |\n| secondSideDiceBgColor  | 第二面骰子背景颜色 |\n| secondSideDiceBorderColor | 第二面骰子边界颜色 |\n| thirdSideDiceNumber  | 第三面骰子点数(1-6) |\n| thirdSideDicePointColor | 第三面骰子点的颜色 |\n| thirdSideDiceBgColor  | 第三面骰子背景颜色 |\n| thirdSideDiceBorderColor | 第三面骰子边界颜色 |\n| fourthSideDiceNumber  | 第四面骰子点数(1-6) |\n| fourthSideDicePointColor | 第四面骰子点的颜色 |\n| fourthSideDiceBgColor  | 第四面骰子背景颜色 |\n| fourthSideDiceBorderColor | 第四面骰子边界颜色 |\n\n\u003cbr\u003e\n\n### 注意\n为了更好的显示效果，请设置DiceLoadingView的宽高为相等的\n\n\n## [LICENSE](https://github.com/samlss/DiceLoadingView/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fdiceloadingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Fdiceloadingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fdiceloadingview/lists"}