{"id":20009150,"url":"https://github.com/samlss/chargingview","last_synced_at":"2025-05-04T19:35:46.073Z","repository":{"id":201738113,"uuid":"139659483","full_name":"samlss/ChargingView","owner":"samlss","description":"🔋A simple charging view.","archived":false,"fork":false,"pushed_at":"2018-08-09T02:32:53.000Z","size":933,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T15:23:52.574Z","etag":null,"topics":["android","charging","chargingview","view"],"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-04T02:39:29.000Z","updated_at":"2022-04-21T11:08:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"2bc42777-5fdb-4e94-bade-de176b46b05d","html_url":"https://github.com/samlss/ChargingView","commit_stats":null,"previous_names":["samlss/chargingview"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FChargingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FChargingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FChargingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FChargingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/ChargingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252390601,"owners_count":21740350,"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","charging","chargingview","view"],"created_at":"2024-11-13T07:14:27.808Z","updated_at":"2025-05-04T19:35:45.758Z","avatar_url":"https://github.com/samlss.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChargingView\n[![Api reqeust](https://img.shields.io/badge/api-11+-green.svg)](https://github.com/samlss/ChargingView)  [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/samlss/ChargingView/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/ChargingView/blob/master/screenshot/screenshot1.gif)\n\n\n\n## 中文\n一个简单的充电view\u003cbr\u003e\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:ChargingView:1.1'\n}\n```\n\n布局中使用：\n```\n\u003ccom.iigo.library.ChargingView\n            android:id=\"@+id/cv2\"\n            android:layout_marginTop=\"10dp\"\n            android:layout_width=\"100dp\"\n            android:layout_height=\"200dp\"\n            app:progress=\"50\"\n            app:progressTextColor=\"@android:color/black\"\n            app:chargingColor=\"@android:color/holo_red_light\"\n            app:bg_color=\"#eeeeee\"\n            app:progressTextSize=\"20dp\" /\u003e\n```\n\n\u003cbr\u003e\n\n代码中使用：\n```\n  chargingView.setProgress(95);\n  chargingView.setBgColor(Color.parseColor(\"#aaaaaa\"));\n  chargingView.setChargingColor(Color.YELLOW);\n  chargingView.setTextColor(Color.RED);\n  chargingView.setTextSize(25);\n```\n\n\u003cbr\u003e\n\n属性说明：\n\n| 属性        | 说明           |\n| ------------- |:-------------:|\n| bg_color      | 背景颜色 |\n| chargingColor | 充电中颜色 |\n| progress      | 当前进度0-100 |\n| progressTextSize      | 显示进度text大小|\n| progressTextColor      | 显示进度text颜色 |\n\n\u003cbr\u003e\n\n如果不能满足你的需要，你可以下载源码自行修改。\n\n## English\nA simple charging view.\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:ChargingView:1.1'\n}\n```\n\n\nin layout.xml：\n```\n\u003ccom.iigo.library.ChargingView\n            android:id=\"@+id/cv2\"\n            android:layout_marginTop=\"10dp\"\n            android:layout_width=\"100dp\"\n            android:layout_height=\"200dp\"\n            app:progress=\"50\"\n            app:progressTextColor=\"@android:color/black\"\n            app:chargingColor=\"@android:color/holo_red_light\"\n            app:bg_color=\"#eeeeee\"\n            app:progressTextSize=\"20dp\" /\u003e\n```\n\n\u003cbr\u003e\n\nin java code：\n```\n  chargingView.setProgress(95);\n  chargingView.setBgColor(Color.parseColor(\"#aaaaaa\"));\n  chargingView.setChargingColor(Color.YELLOW);\n  chargingView.setTextColor(Color.RED);\n  chargingView.setTextSize(25);\n```\n\n\u003cbr\u003e\n\nAttributes description：\n\n| attr        | description  |\n| ------------- |:-------------:|\n| bg_color      | the background color |\n| chargingColor | the charging color |\n| progress      | current progress:0-100 |\n| progressTextSize      | the progress text size|\n| progressTextColor      | the progress text color |\n\nIf you can not meet your needs, you can download the source code to modify it.\n\n\n## License\nCopyright (c) 2018 samlss\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fchargingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Fchargingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Fchargingview/lists"}