{"id":20009229,"url":"https://github.com/samlss/daynightloadingview","last_synced_at":"2025-05-04T19:35:50.706Z","repository":{"id":201738132,"uuid":"142841461","full_name":"samlss/DayNightLoadingView","owner":"samlss","description":"🌜☀🌝A loading view that switches between day and night.","archived":false,"fork":false,"pushed_at":"2018-08-09T02:11:47.000Z","size":1641,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-08T11:37:56.902Z","etag":null,"topics":["android","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.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-07-30T07:35:55.000Z","updated_at":"2024-07-16T03:37:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"6fe247da-c05c-4f8e-8fe6-6a133e91159e","html_url":"https://github.com/samlss/DayNightLoadingView","commit_stats":null,"previous_names":["samlss/daynightloadingview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDayNightLoadingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDayNightLoadingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDayNightLoadingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FDayNightLoadingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/DayNightLoadingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252390655,"owners_count":21740359,"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","loadingview"],"created_at":"2024-11-13T07:14:43.838Z","updated_at":"2025-05-04T19:35:49.869Z","avatar_url":"https://github.com/samlss.png","language":"Java","readme":"# DayNightLoadingView\nA day night loading view(一个日夜切换的loading view).\n\n\n[![Api reqeust](https://img.shields.io/badge/api-19+-green.svg)](https://github.com/samlss/SignalLoadingView)  [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/samlss/DayNightLoadingView/blob/master/LICENSE) [![Blog](https://img.shields.io/badge/samlss-blog-orange.svg)](https://blog.csdn.net/Samlss)\n\n\u003cbr\u003e\n\n  * [中文](#%E4%B8%AD%E6%96%87)\n  * [English](#english)\n  * [License](#license)\n\n\u003cbr\u003e\n\n![gif1](https://github.com/samlss/DayNightLoadingView/blob/master/screenshots/screenshot1.gif)\n\n\n---\n\n## 中文\n\n### 使用\u003cbr\u003e\n在根目录的build.gradle添加这一句代码：\n```\nallprojects {\n    repositories {\n        //...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n在app目录下的build.gradle添加依赖使用：\n```\ndependencies {\n    implementation 'com.github.samlss:DayNightLoadingView:1.1'\n}\n```\n\n布局中使用：\n```\n\u003ccom.iigo.library.DayNightLoadingView\n        android:id=\"@+id/dn_loading\"\n        app:background_color=\"#66000000\"\n        app:moon_color=\"#D0D2DF\"\n        app:star_color=\"#F3EBB8\"\n        app:sun_color=\"#FFF600\"\n        app:sunshine_color=\"#DB261B\"\n        android:layout_width=\"400dp\"\n        android:layout_height=\"300dp\"/\u003e\n```\n\n\u003cbr\u003e\n\n代码中使用：\n```\n  dayNightLoadingView.resume(); //恢复动画\n  dayNightLoadingView.pause(); //暂停动画\n  \n  dayNightLoadingView.stop(); //停止和释放动画，可在activity销毁时调用\n```\n\n\u003cbr\u003e\n\n属性说明：\n\n| 属性        | 说明           |\n| ------------- |:-------------:|\n| background_color      | 背景颜色 |\n| sun_color | 太阳颜色 |\n| sunshine_color | 阳光颜色 |\n| moon_color | 月亮颜色 |\n| star_color | 星星颜色 |\n\n\u003cbr\u003e\n\n由于使用了Animator和AnimaterSet的resume和pause方法，因此api要求为 \u003e= 19，如果你想兼容更低的api，\n方法有：\n - 不调用该库的resume和pause接口,最低可兼容到api12\n - 你自己修改代码\n - 联系我，等我有时间的时候尽量完善一下 \n\n\u003cbr\u003e\n\n---\n\n## English\n\n\n### Use\u003cbr\u003e\nAdd it in your root build.gradle at the end of repositories：\n```\nallprojects {\n    repositories {\n        //...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\nAdd it in your app build.gradle at the end of repositories:\n```\ndependencies {\n    implementation 'com.github.samlss:DayNightLoadingView:1.1'\n}\n```\n\n\nin layout.xml：\n```\n\u003ccom.iigo.library.DayNightLoadingView\n        android:id=\"@+id/dn_loading\"\n        app:background_color=\"#66000000\"\n        app:moon_color=\"#D0D2DF\"\n        app:star_color=\"#F3EBB8\"\n        app:sun_color=\"#FFF600\"\n        app:sunshine_color=\"#DB261B\"\n        android:layout_width=\"400dp\"\n        android:layout_height=\"300dp\"/\u003e\n```\n\n\u003cbr\u003e\n\nin java code：\n```\n  dayNightLoadingView.resume(); //resume animator\n  dayNightLoadingView.pause(); //pause animator\n  \n  dayNightLoadingView.stop(); //Stop and release the animation, can be called when the activity is destroyed\n```\n\u003cbr\u003e\n\n\nAttributes description：\n\n| attr        | description  |\n| ------------- |:-------------:|\n| background_color      | the background color |\n| sun_color | the sun color |\n| sunshine_color | the sunshine color |\n| moon_color | the moon color |\n| star_color | the stars color |\n\n\u003cbr\u003e\n\nDue to use of the resume and pause methods of Animator and AnimalSet, the api requirement is \u003e= 19, \nif you want  to be compatible with lower apis,\nthe methods are:\n- Do not call the resume and pause method of this library, the minimum compatible with api 12.\n- Modify the code by yourself.\n- Contact me, i will try to improve it when I have time.\n\n[id]: http://example.com/ \"Optional Title Here\"\n\n---\n\n## [LICENSE](https://github.com/samlss/DayNightLoadingView/blob/master/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fdaynightloadingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Fdaynightloadingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fdaynightloadingview/lists"}