{"id":13611497,"url":"https://github.com/sidhuparas/TickingTimer","last_synced_at":"2025-04-13T04:34:42.082Z","repository":{"id":217531514,"uuid":"298608059","full_name":"sidhuparas/TickingTimer","owner":"sidhuparas","description":"Android Library to implement visual timer quickly, easily and effortlessly","archived":false,"fork":false,"pushed_at":"2021-01-25T06:52:46.000Z","size":3794,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-01T19:57:41.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/sidhuparas.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-25T15:15:12.000Z","updated_at":"2021-10-18T11:28:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"769f7a00-aed9-40c2-80b1-5fce9498f298","html_url":"https://github.com/sidhuparas/TickingTimer","commit_stats":null,"previous_names":["sidhuparas/tickingtimer"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidhuparas%2FTickingTimer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidhuparas%2FTickingTimer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidhuparas%2FTickingTimer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidhuparas%2FTickingTimer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidhuparas","download_url":"https://codeload.github.com/sidhuparas/TickingTimer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223568234,"owners_count":17166623,"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":[],"created_at":"2024-08-01T19:01:56.376Z","updated_at":"2024-11-07T18:30:35.279Z","avatar_url":"https://github.com/sidhuparas.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Introduction [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/sidhuparas1234%40gmail.com)\n\nTicking Timer is an Android library to implement a visual timer quickly, easily and effortlessly. It's developed to be Kotlin-first and you can implement the features in a very small amount of code.\n\n\u003cimg src=\"screenshots/poster.jpeg\"/\u003e\n\n### **Star :star:  this repo to show your support and it really does matter!** :clap:\n\n# Integration\n\n1. In the project-level `build.gradle`:\n\n```\nallprojects {\n   repositories {\n      ...\n      maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n2. In app-level `build.gradle`: [![](https://jitpack.io/v/sidhuparas/TickingTimer.svg)](https://jitpack.io/#sidhuparas/TickingTimer)\n\n```\ndependencies {\n     implementation 'com.github.sidhuparas:TickingTimer:\u003clatest-version\u003e'\n}\n```\n\n\u003cimg src=\"screenshots/TickingTimer.gif\"/\u003e\n\n# How To Use?\n\n1. Add the timer in XML and specify width and height. TickingTimer currently doesn't support feature-specific XML attributes.\n\n```\n\u003ccom.parassidhu.tickingtimer.TickingTimer\n        android:id=\"@+id/timerView\"\n        android:layout_width=\"250dp\"\n        android:layout_height=\"250dp\" /\u003e\n```\n\n2. Start the timer in Java/Kotlin code:\n\n```\n    timerView.start() // Without any customization\n```\nor\n```\n    timerView.start {\n        textSize(20)\n        shape(Shape.CIRCLE)\n        backgroundTint(Color.parseColor(Color.BLACK))\n    }\n```\n# Customizations\n\n| Function | Parameter(s) | Description |\n| ------ | ------- |------ |\n| timerDuration() | duration (Int) | Duration for which timer should run\n| backgroundTint() | color (Int?) | Colored tint for the background. If null is passed, tint is removed\n| customBackground() | resource (@DrawableRes res: Int)  | Custom background for the background provided as a drawable\n| shape() | shape (Shape) | Set background shape from predefined: CIRCLE, ROUNDED and CIRCLE. Doesn't apply if customBackground is applied after calling this function\n| textSize() | size (Int) | Timer duration text size in sp (scaled-pixels)\n| textColor() | color (Int) | Timer duration text color\n| textAppearance() | resId (Int) | Use for custom styling of the text. Pass the style resource Id\n| onFinished() | lambda () | Lambda callback executed when timer finishes\n| onTick() | lambda (Int) | Lambda executed on every second elapsed and provides remaining time\n| timerAnimation() | animation (Animation) | Custom timer animation\n| timerEndAnimation() | lambda (View) | Lambda exposes View and is executed on timer end. Perform end animation on the view here\n| applyConfig() | config (Config?) | Pass a config object to apply above properties in one go|\n| cancel() | N/A | Cancels the timer. Automatically gets called on onDestroy() of the activity/fragment\n\n# Saving Properties\n\nTo save the properties of the timer to reuse, you can use a Config object. Create config like this:\n\n```\n   val config = TickingTimer.defaultConfig().apply {\n        timerDuration = 10\n        textSize = 50\n        textColor = Color.BLACK\n        shape = Shape.ROUNDED\n        customBackground = R.drawable.bg_grad_blue\n   }\n```\n\nand then apply to the timer while starting:\n\n`timerView.start(config)`\n\nAnother way to use the config is to use `applyConfig()` function:\n\n```\n   timerView.start {\n        applyConfig(config)\n        shape(Shape.CIRCLE)\n        timerAnimation(ScaleAnimation(this@MainActivity, null))\n        customBackground(R.drawable.bg_grad_orange)\n   }\n```\n\nRemember that the properties defined after `applyConfig()` overrides the config's properties for the specific timer.\n\n# Contributions\n\n- Fork the repo\n- Create a new branch and make changes\n- Push the code to the branch and make a PR! :thumbsup:\n\n# License\n\nMIT License\n\nCopyright (c) 2020 Paras Sidhu\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%2Fsidhuparas%2FTickingTimer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidhuparas%2FTickingTimer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidhuparas%2FTickingTimer/lists"}