{"id":13643422,"url":"https://github.com/iwgang/CountdownView","last_synced_at":"2025-04-21T01:32:43.616Z","repository":{"id":39749234,"uuid":"44092178","full_name":"iwgang/CountdownView","owner":"iwgang","description":"Android Countdown View","archived":false,"fork":false,"pushed_at":"2021-10-08T13:46:25.000Z","size":10604,"stargazers_count":2910,"open_issues_count":27,"forks_count":595,"subscribers_count":57,"default_branch":"master","last_synced_at":"2025-04-12T14:53:17.875Z","etag":null,"topics":["android-library","countdown"],"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/iwgang.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}},"created_at":"2015-10-12T07:46:28.000Z","updated_at":"2025-03-21T06:29:49.000Z","dependencies_parsed_at":"2022-07-16T01:00:52.915Z","dependency_job_id":null,"html_url":"https://github.com/iwgang/CountdownView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwgang%2FCountdownView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwgang%2FCountdownView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwgang%2FCountdownView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwgang%2FCountdownView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwgang","download_url":"https://codeload.github.com/iwgang/CountdownView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982637,"owners_count":21355735,"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-library","countdown"],"created_at":"2024-08-02T01:01:47.322Z","updated_at":"2025-04-21T01:32:38.608Z","avatar_url":"https://github.com/iwgang.png","language":"Java","funding_links":[],"categories":["日历时间","Java","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"[![Android Gems](http://www.android-gems.com/badge/iwgang/CountdownView.svg?branch=master)](http://www.android-gems.com/lib/iwgang/CountdownView)\r\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CountdownView-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/2641) \r\n[![@iwgang](https://img.shields.io/badge/weibo-%40iwgang-blue.svg)](http://weibo.com/iwgang)\r\n\r\n#### [中文](https://github.com/iwgang/CountdownView/blob/master/README_CN.md)\r\n\r\n\r\n# CountdownView\r\nAndroid countdown view，use canvas draw，supports multiple styles\r\n\r\n[Download demo apk](https://raw.githubusercontent.com/iwgang/CountdownView/master/demoapk/Demo_2.1.apk)\r\n\r\n### Screenshot\r\n\u003cimg src=\"https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/s_main.png\" width=\"400px\" height=\"650px\"/\u003e\r\n\r\n![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_config.gif) \r\n![](https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/g_config2.gif)  \r\n\r\n\u003cimg src=\"https://raw.githubusercontent.com/iwgang/CountdownView/master/screenshot/s_list.jpg\" width=\"400px\" height=\"650px\"/\u003e\r\n\r\n### Gradle\r\n    compile 'com.github.iwgang:countdownview:2.1.6'\r\n\r\n### Code\r\n```\r\nCountdownView mCvCountdownView = (CountdownView)findViewById(R.id.cv_countdownViewTest1);\r\nmCvCountdownView.start(995550000); // Millisecond\r\n\r\n// or\r\nfor (int time=0; time\u003c1000; time++) {\r\n    mCvCountdownView.updateShow(time);\r\n}\r\n```\r\n\r\n### Layout\r\n``` xml\r\n\u003ccn.iwgang.countdownview.CountdownView\r\n    android:layout_width=\"wrap_content\"\r\n    android:layout_height=\"wrap_content\"\r\n    app:isHideTimeBackground=\"true\"\r\n    app:isShowDay=\"true\"\r\n    app:isShowHour=\"true\"\r\n    app:isShowMinute=\"true\"\r\n    app:isShowSecond=\"true\"\r\n    app:isShowMillisecond=\"true\"\r\n    app:timeTextColor=\"#000000\"\r\n    app:timeTextSize=\"22sp\"\r\n    app:isTimeTextBold=\"true\"\r\n    app:suffixGravity=\"bottom\"\r\n    app:suffixTextColor=\"#000000\"\r\n    app:suffixTextSize=\"12sp\"\r\n    app:suffixHour=\"时\"\r\n    app:suffixMinute=\"分\"\r\n    app:suffixSecond=\"秒\"\r\n    app:suffixMillisecond=\"毫秒\" /\u003e\r\n```\r\n\r\n### Customization\r\n| attr | type | default|\r\n| --------   | :-----:  | :----: |\r\n|isHideTimeBackground | boolean | true|\r\n|timeBgColor  | color      | #444444|\r\n|timeBgSize   | dimension  | timeSize + 2dp * 4|\r\n|timeBgRadius | dimension  | 0|\r\n|isShowTimeBgDivisionLine | boolean  | true|\r\n|timeBgDivisionLineColor | color | #30FFFFFF|\r\n|timeBgDivisionLineSize  | dimension | 0.5dp|\r\n|timeTextSize   | dimension | 12sp | \r\n|timeTextColor  | color | #000000|\r\n|isTimeTextBold | boolean | false|\r\n|isShowDay  | boolean | auto show (has value show if not hide)|\r\n|isShowHour  | boolean | auto show (has value show if not hide)|\r\n|isShowMinute  | boolean | true|\r\n|isShowSecond  | boolean | true|\r\n|isShowMillisecond  | boolean | false|\r\n|isConvertDaysToHours | boolean | false|\r\n|suffixTextSize | dimension | 12sp|\r\n|suffixTextColor  | color | #000000|\r\n|isSuffixTextBold  | boolean | false|\r\n|suffixGravity | 'top' or 'center' or 'bottom' | 'center'|\r\n|suffix | string | ':'|\r\n|suffixDay  | string | null|\r\n|suffixHour  | string | null|\r\n|suffixMinute  | string | null|\r\n|suffixSecond  | string | null|\r\n|suffixMillisecond  | string | null|\r\n|suffixLRMargin  | dimension | left 3dp right 3dp|\r\n|suffixDayLeftMargin | dimension | 0|\r\n|suffixDayRightMargin  | dimension | 0|\r\n|suffixHourLeftMargin  | dimension | 0|\r\n|suffixHourRightMargin  | dimension | 0|\r\n|suffixMinuteLeftMargin | dimension | 0|\r\n|suffixMinuteRightMargin  | dimension | 0|\r\n|suffixSecondLeftMargin  | dimension | 0|\r\n|suffixSecondRightMargin  | dimension | 0|\r\n|suffixMillisecondLeftMargin | dimension | 0|\r\n|isShowTimeBgBorder | boolean | false|\r\n|timeBgBorderColor  | color | #000000|\r\n|timeBgBorderSize  | dimension | 1dp|\r\n|timeBgBorderRadius  | dimension | 0|\r\n\r\n### Other\r\n* **Multiple countdownView specified value**\r\n```\r\n    // step 1\r\n    mCvCountdownView.setTag(R.id.name, uid);\r\n    // step 2\r\n    @Override\r\n    public void onEnd(CountdownView cv) {\r\n        Object nameTag = cv.getTag(R.id.uid);\r\n        if (null != nameTag) {\r\n            Log.i(TAG, \"name = \" + nameTag.toString());\r\n        }\r\n    }\r\n```\r\n* **Dynamic show**\r\n```\r\n    dynamicShow(DynamicConfig dynamicConfig)\r\n```\r\n* **Countdown complete callback**\r\n```\r\n    setOnCountdownEndListener(OnCountdownEndListener onCountdownEndListener);\r\n```\r\n* **Interval callback**\r\n```\r\n    setOnCountdownIntervalListener(long interval, OnCountdownIntervalListener onCountdownIntervalListener);\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwgang%2FCountdownView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwgang%2FCountdownView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwgang%2FCountdownView/lists"}