{"id":22535950,"url":"https://github.com/rosenpin/custom-analog-clock-view","last_synced_at":"2025-04-09T19:08:15.647Z","repository":{"id":51739823,"uuid":"63741602","full_name":"rosenpin/custom-analog-clock-view","owner":"rosenpin","description":"A customizable analog clock widget for Android","archived":false,"fork":false,"pushed_at":"2024-02-26T09:21:05.000Z","size":152,"stargazers_count":71,"open_issues_count":5,"forks_count":23,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-09T19:08:07.049Z","etag":null,"topics":["analog-clock","android-clock","android-library","android-widget"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rosenpin.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":"2016-07-20T01:56:30.000Z","updated_at":"2025-03-17T19:55:45.000Z","dependencies_parsed_at":"2022-08-23T04:00:28.486Z","dependency_job_id":null,"html_url":"https://github.com/rosenpin/custom-analog-clock-view","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenpin%2Fcustom-analog-clock-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenpin%2Fcustom-analog-clock-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenpin%2Fcustom-analog-clock-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosenpin%2Fcustom-analog-clock-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosenpin","download_url":"https://codeload.github.com/rosenpin/custom-analog-clock-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094993,"owners_count":21046770,"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":["analog-clock","android-clock","android-library","android-widget"],"created_at":"2024-12-07T10:09:08.072Z","updated_at":"2025-04-09T19:08:15.608Z","avatar_url":"https://github.com/rosenpin.png","language":"Java","funding_links":["https://www.paypal.me/rosenfeldtomer"],"categories":[],"sub_categories":[],"readme":"# Custom Analog Clock View\n\n[![JitPack](https://jitpack.io/v/rosenpin/custom-analog-clock-view.svg)](https://jitpack.io/#rosenpin/custom-analog-clock-view)\n[![Download](https://api.bintray.com/packages/rosenpin/maven/custom-analog-clock-view/images/download.svg) ](https://bintray.com/rosenpin/maven/custom-analog-clock-view/_latestVersion)\n\u003ca target=\"_blank\" href=\"https://www.paypal.me/rosenfeldtomer\" title=\"Donate using PayPal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" /\u003e\u003c/a\u003e\n\nBased on [xxv](https://github.com/xxv)/[24AnalogWidget](https://github.com/xxv/24hAnalogWidget)\n\nThis is a super easy to implement and highly customizable analog clock library\n\n## Dependency\nAdd this to your app build.gradle file\n```` gradle\ndependencies {\n    compile 'com.tomerrosenfeld.customanalogclockview:custom-analog-clock-view:1.1'\n}\n````\n\n\n## How to use\nIn your layout:\n```xml\n\u003ccom.tomerrosenfeld.customanalogclockview.CustomAnalogClock\n        android:id=\"@+id/analog_clock\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" \n        app:default_watchface=\"true\" /\u003e\n````\n\nIn your activity:\n```java\nCustomAnalogClock customAnalogClock = (CustomAnalogClock) findViewById(R.id.analog_clock);\ncustomAnalogClock.setAutoUpdate(true);\n````\n\n#### And you're basically done!\n\n Default clock \n\u003cimg src=\"http://i.imgur.com/mb08zMF.png\" alt=\"Drawing\" width=\"400\" /\u003e\n\n# Customization\nTo adjust the size of the clock\n```java \nsetScale(float scale)\n``` \nSo for example\n```java \nsetScale(0.5f) //to make the clock smaller\nsetScale(2f) //to make the clock larger\n``` \n\nYou can completely change the look of the widget by using the init function:\n```java \ninit(Context context, @DrawableRes int watchFace, @DrawableRes int hourHand, @DrawableRes int minuteHand, int alpha, boolean is24, boolean hourOnTop)\n``` \nSo for example:\n````java \ncustomAnalogClock.init(MainActivity.this, R.drawable.default_face, R.drawable.default_hour_hand, R.drawable.default_minute_hand, 0, false, false);\n````\n\nIn this example, we are creating an analog clock with custom drawables, the background is `R.drawable.default_face`, the hour hand is `R.drawable.default_hour_hand` and the minute hand is `R.drawable.default_minute_hand`.\n\nIn addition to that, we chose to keep the clock 12H, like a standard clock, if you want to make it 24H, pass `true` for is24.\n\nThe alpha parameter sets the opacity of the hour hand, set it to 0 to make it completely visible (alpha can vary between 1-254).\n\nThe hourOnTop parameter determines the hour hand placement. If set to true, the hour hand will appear on top of the minutes hand, otherwise, the minute hand will show up on top.\n\nI suggest that you base your clock drawables on my default ones:\n\n[The Face](/custom-analog-clock-view/src/main/res/drawable-xhdpi/default_face.png)\n\n[The Hour Hand](/custom-analog-clock-view/src/main/res/drawable-xhdpi/default_hour_hand.png)\n\n[The Minute Hand](/custom-analog-clock-view/src/main/res/drawable-xhdpi/default_minute_hand.png)\n\nUsing this library I was easily able to create these analog clock widgets:\n\n| Pebble Theme | S7 Theme | Default |\n|:-:|:-:|:-:|\n| ![Pebble Theme](http://i.imgur.com/w3jfrsT.png) | ![S7 Theme](http://i.imgur.com/1vjYhFd.png) | ![Flat style](http://i.imgur.com/AB2EIAD.png) |\n\n## Licensing\nCustom Analog Clock View is licensed under the [GNU v3 Public License.](LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosenpin%2Fcustom-analog-clock-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosenpin%2Fcustom-analog-clock-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosenpin%2Fcustom-analog-clock-view/lists"}