{"id":13428006,"url":"https://github.com/zagum/Android-SwitchIcon","last_synced_at":"2025-03-16T00:32:45.791Z","repository":{"id":45289983,"uuid":"78366987","full_name":"zagum/Android-SwitchIcon","owner":"zagum","description":"Google launcher-style implementation of switch (enable/disable) icon","archived":false,"fork":false,"pushed_at":"2024-04-16T11:55:35.000Z","size":536,"stargazers_count":2327,"open_issues_count":0,"forks_count":222,"subscribers_count":45,"default_branch":"master","last_synced_at":"2024-10-15T10:42:17.735Z","etag":null,"topics":["android","icons","material","material-ui","switch"],"latest_commit_sha":null,"homepage":null,"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/zagum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-01-08T19:56:28.000Z","updated_at":"2024-09-27T17:18:20.000Z","dependencies_parsed_at":"2022-07-13T15:31:05.106Z","dependency_job_id":"a9b369ad-3c06-4cd6-b064-6ce6f40a7d6f","html_url":"https://github.com/zagum/Android-SwitchIcon","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zagum%2FAndroid-SwitchIcon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zagum%2FAndroid-SwitchIcon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zagum%2FAndroid-SwitchIcon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zagum%2FAndroid-SwitchIcon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zagum","download_url":"https://codeload.github.com/zagum/Android-SwitchIcon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221631837,"owners_count":16855016,"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","icons","material","material-ui","switch"],"created_at":"2024-07-31T01:00:44.180Z","updated_at":"2024-10-27T05:30:37.361Z","avatar_url":"https://github.com/zagum.png","language":"Kotlin","readme":"Android-SwitchIcon\n================\n\n[![](https://jitpack.io/v/zagum/Android-SwitchIcon.svg)](https://jitpack.io/#zagum/Android-SwitchIcon)\n[![API](https://img.shields.io/badge/API-15%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=15)\n\nGoogle launcher-style implementation of switch (enable/disable) icon\n\n![image](https://github.com/zagum/Android-SwitchIcon/blob/master/art/sample.gif)\n\nCompatibility\n-------------\n\nThis library is compatible from API 15 (Android 4.0.3).\n\nDownload\n--------\n\nAdd it in your root build.gradle at the end of repositories:\n\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url \"https://jitpack.io\" }\n    }\n}\n```\n\nAdd the dependency\n\n```groovy\ndependencies {\n    implementation 'com.github.zagum:Android-SwitchIcon:1.4.2'\n}\n```\n\nUsage\n-----\n\nSwitchIconView extends from AppCompatImageView so you can set icon with  ```app:srcCompat```\n\nSet any icon (vector or image) to SwitchIconView and enjoy switchable icon in your app :)\n\nUse ```app:si_tint_color``` to set color to icon. Default color is black;\n\nUse ```app:si_disabled_color``` to set color when icon disabled. Default color is equals with ```app:si_tint_color```;\n\nUse ```app:si_disabled_alpha``` to set alpha when icon disabled. Default alpha is ```.5```;\n\nUse ```app:si_no_dash``` if you don't want to draw dash, when icon disabled;\n\nUse ```app:si_animation_duration``` if you want to change switching state animation duration;\n\nUse ```app:si_enabled``` to set initial icon state;\n\nFully customized implementation:\n\n```xml\n    \u003ccom.github.zagum.switchicon.SwitchIconView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:padding=\"8dp\"\n        app:si_animation_duration=\"500\"\n        app:si_disabled_alpha=\".3\"\n        app:si_disabled_color=\"#b7b7b7\"\n        app:si_tint_color=\"#ff3c00\"\n        app:si_enabled=\"false\"\n        app:si_no_dash=\"true\"\n        app:srcCompat=\"@drawable/ic_cloud\"/\u003e\n```\n\nPublic methods and fields: \n\n```kotlin\n\n  var isIconEnabled: Boolean\n\n  fun setIconEnabled(enabled: Boolean, animate: Boolean = true)\n\n  fun switchState(animate: Boolean = true)\n  \n```\n\nSee [sample](https://github.com/zagum/Android-SwitchIcon/tree/master/switchicon-sample) project for more information.\n\nLicense\n-------\n\n    Copyright 2017 Evgenii Zagumennyi\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n    http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","funding_links":[],"categories":["Libraries","SwitchButton","Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzagum%2FAndroid-SwitchIcon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzagum%2FAndroid-SwitchIcon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzagum%2FAndroid-SwitchIcon/lists"}