{"id":17311942,"url":"https://github.com/sfyc23/counttimeprogressview","last_synced_at":"2025-04-14T14:21:46.301Z","repository":{"id":118190326,"uuid":"76950834","full_name":"sfyc23/CountTimeProgressView","owner":"sfyc23","description":"An Android library that provides a count time circular progress view effect.","archived":false,"fork":false,"pushed_at":"2017-11-11T15:48:48.000Z","size":9357,"stargazers_count":44,"open_issues_count":1,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-28T03:22:32.890Z","etag":null,"topics":["android","circle","counttime","kotlin-android","kotlin-library","progressview"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sfyc23.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-20T11:27:33.000Z","updated_at":"2024-10-09T08:10:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"890f2da2-eb09-436a-bcae-9920d6a431a0","html_url":"https://github.com/sfyc23/CountTimeProgressView","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfyc23%2FCountTimeProgressView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfyc23%2FCountTimeProgressView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfyc23%2FCountTimeProgressView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfyc23%2FCountTimeProgressView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sfyc23","download_url":"https://codeload.github.com/sfyc23/CountTimeProgressView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248894948,"owners_count":21179154,"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","circle","counttime","kotlin-android","kotlin-library","progressview"],"created_at":"2024-10-15T12:41:54.796Z","updated_at":"2025-04-14T14:21:46.271Z","avatar_url":"https://github.com/sfyc23.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![twitter](https://img.shields.io/badge/twitter-sfyc23-blue.svg)](https://twitter.com/sfyc23)\n[![微博](https://img.shields.io/badge/%E5%BE%AE%E5%8D%9A-sfyc23-blue.svg)](https://weibo.com/sfyc23)\n[![API](https://img.shields.io/badge/API-%2B14-green.svg)](https://android-arsenal.com/api?level=14)\n[![Maven Central](https://img.shields.io/badge/Maven%20Central-1.1.3-green.svg)]()\n[![License](https://img.shields.io/badge/License-Apache%202.0-red.svg)]()\n# CountTimeProgressView\n\n**CountTimeProgressView** - 一个用 Kotlin 实现的有倒计时功能的，并能显现进度的 Android 库。\n\n\n## Sample\n![页面动图][1]\n\n\n## 用法\n\n**关于这个项目的实现功能，你可以通过 lib 包下的 [CountTimeProgressView][2] 查看实现**\n\n### step 1\n\n你可以将该库作为本地库项目加入，或者在 build.gradle 中添加依赖项。\n\n```groovy\ndependencies {\n    compile 'com.sfyc.ctpv:library:1.1.3'\n}\n```\n\n### Step 2\n\n在你的 layout 中添加 CountTimeProgressView 控件，也可以添加自定义nttInclude the CountTimeProgressView widget in your layout. And you can customize it like this.\n\n```xml\n\u003ccom.sfyc.ctpv.CountTimeProgressView\n    android:id=\"@+id/countTimeProgressView\"\n    android:layout_width=\"84dp\"\n    android:layout_height=\"84dp\"\n    android:layout_alignParentRight=\"true\"\n    app:backgroundColorCenter=\"#FF7F00\"\n    app:borderWidth=\"3dp\"\n    app:borderBottomColor=\"#D60000\"\n    app:borderDrawColor=\"#CDC8EA\"\n    app:markBallColor=\"#002FFF\"\n    app:markBallFlag=\"true\"\n    app:markBallWidth=\"3dp\"\n    app:titleCenterColor=\"#000000\"\n    app:titleCenterText=\"点击跳过\"\n    app:titleCenterSize=\"14sp\"\n    app:countTime=\"5000\"\n    app:startAngle=\"0\"\n    app:textStyle=\"jump\"\n    app:clockwise=\"true\"\n    /\u003e\n```\n### Step 3\n\n你可以在代码中改变 CountTimeProgress 属性，并添加回调 『addOnEndListener』。例如：\n\nby Java:\n```java\ncountTimeProgressView.setBackgroundColorCenter(Color.WHITE);\ncountTimeProgressView.setBorderWidth(3);\ncountTimeProgressView.setBorderBottomColor(Color.GRAY);\ncountTimeProgressView.setBorderDrawColor(Color.RED);\ncountTimeProgressView.setMarkBallColor(Color.GREEN);\n\ncountTimeProgressView.setMarkBallFlag(true);\ncountTimeProgressView.setMarkBallWidth(4);\ncountTimeProgressView.setTitleCenterText(\"\");\ncountTimeProgressView.setTitleCenterTextSize(16);\ncountTimeProgressView.setTitleCenterTextColor(Color.BLACK);\n\ncountTimeProgressView.setCountTime(5000L);\ncountTimeProgressView.setStartAngle(0);\ncountTimeProgressView.setTextStyle(CountTimeProgressView.TextStyle.INSTANCE.getCLOCK());\ncountTimeProgressView.setClockwise(true);\n\ncountTimeProgressView.addOnEndListener(new CountTimeProgressView.OnEndListener() {\n    @Override\n    public void onAnimationEnd() {\n        Toast.makeText(SimpleActivity.this, \"时间到\", Toast.LENGTH_SHORT).show();\n    }\n    @Override\n    public void onClick(long overageTime) {\n        if (countTimeProgressView.isRunning()) {\n            countTimeProgressView.cancelCountTimeAnimation();\n        } else {\n            countTimeProgressView.startCountTimeAnimation();\n        }\n    }\n});\n\ncountTimeProgressView.startCountTimeAnimation();\n```\n\nby Kotlin:\n```\nwith(countTimeProgressView){\n    startAngle = 0f\n    countTime = 6000L\n    textStyle = CountTimeProgressView.TextStyle.SECOND\n    borderWidth = 4f\n    borderBottomColor = Color.GRAY\n    borderDrawColor = Color.RED\n    backgroundColorCenter = Color.WHITE\n    markBallFlag = true\n    markBallWidth = 6f\n    markBallColor = Color.GREEN\n    titleCenterText = \"跳过（%s）s\"\n    titleCenterTextColor = Color.BLACK\n    titleCenterTextSize = 16f\n    addOnEndListener(object : CountTimeProgressView.OnEndListener {\n        override fun onAnimationEnd() {\n            Toast.makeText(this@SimpleActivity, \"时间到\", Toast.LENGTH_SHORT).show()\n        }\n\n        override fun onClick(overageTime: Long) {\n            if (countTimeProgressView.isRunning) {\n                countTimeProgressView.cancelCountTimeAnimation()\n                Log.e(\"overageTime\", \"overageTime = \" + overageTime)\n            } else {\n                countTimeProgressView.startCountTimeAnimation()\n            }\n        }\n    })\n}\ncountTimeProgressView.startCountTimeAnimation()\n```\n\n## 自定义属性说明\n\n可自由灵活定制 :)\n\n| 名称 | 格式 | 说明 |\n| :---: | :---: | :---: |\n| backgroundColorCenter | color | 圆环背景颜色，默认为 #00BCD4\n| borderWidth | dimension | 圆形轨迹边框宽度, 默认为 3dp\n| borderDrawColor | color | Draw color，默认为 #4dd0e1\n| borderBottomColor | color | Bottom Color，默认为 #D32F2F\n| markBallWidth | dimension | Ball width , 默认为 6dp\n| markBallColor | color | Ball Color , 默认为 #536DFE\n| markBallFlag | boolean | Ball isDisplay，默认为 true\n| startAngle | float | Ball start angle , 默认为 0f\n| clockwise | boolean | Clockwise or Counter-clockwise , 默认为 true\n| countTime | integer | Count time , 默认为 5\n| textStyle | enum | 中心文字显示风格 , 默认为 『jump』，其他可选项为： 『second』，『clock』，『none』\n| titleCenterText | string | 中心文字显示内容 , 仅仅 TextStyle 当『 jump 』显示|\n| titleCenterColor | color | 中心文字显示内容 , 默认为 #FFFFFF.\n| titleCenterSize | dimension | 中心文字字体大小 , 默认为 16sp.\n\n## Change Log\n\n1.1.3(2017-11-11)\nRuBuild Code by Kotlin\n\n1.1.1(2017-3-27)\nupdate Stop running when exiting\n\n1.1.0 (2017-2-7)\nupdate anim colckWise\n\n1.0.0 (2016-12-20)\nFirst commit\n\n## Demo\n[Download][3]\n\n\n## Thanks\n\nInspired by\n\n[tangqi92][4] created by [WaveLoadingView][5]\n\n\n  [1]: https://github.com/sfyc23/CountTimeProgressView/blob/master/screenshot/ctpv-video-to-gif.gif\n  [2]: https://github.com/sfyc23/CountTimeProgressView/blob/master/library/src/main/java/com/sfyc/ctpv/CountTimeProgressView.kt\n  [3]: http://fir.im/ctpv58\n  [4]: https://github.com/tangqi92\n  [5]: https://github.com/tangqi92/WaveLoadingView","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfyc23%2Fcounttimeprogressview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsfyc23%2Fcounttimeprogressview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfyc23%2Fcounttimeprogressview/lists"}