{"id":21130093,"url":"https://github.com/Leaking/SlideSwitch","last_synced_at":"2025-07-09T01:32:17.612Z","repository":{"id":25314626,"uuid":"28741373","full_name":"Leaking/SlideSwitch","owner":"Leaking","description":"A widget you can slide it to open or close something","archived":false,"fork":false,"pushed_at":"2016-08-29T03:13:50.000Z","size":3942,"stargazers_count":538,"open_issues_count":3,"forks_count":173,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-05-25T16:07:06.962Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/Leaking.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-01-03T10:54:39.000Z","updated_at":"2025-05-02T16:46:25.000Z","dependencies_parsed_at":"2022-07-07T12:54:47.265Z","dependency_job_id":null,"html_url":"https://github.com/Leaking/SlideSwitch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Leaking/SlideSwitch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leaking%2FSlideSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leaking%2FSlideSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leaking%2FSlideSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leaking%2FSlideSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Leaking","download_url":"https://codeload.github.com/Leaking/SlideSwitch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Leaking%2FSlideSwitch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264375369,"owners_count":23598364,"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-11-20T05:32:16.474Z","updated_at":"2025-07-09T01:32:17.097Z","avatar_url":"https://github.com/Leaking.png","language":"Java","funding_links":[],"categories":["Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"SlideSwitch\n===========\n\n\n## About SlideSwitch\n\nA button that you can slide on or off \n\n\n## How to import into your project\n\n### Android Studio\n\nuse gradle.\n\nGradle dependency:\n\nAdd the below codes in the module gradle file, which module use this widget.\n\n```gradle\ncompile 'com.leaking.slideswitch:slideswitch:1.0.0'\n```\n\nAdd the below codes in you project gradle file \n\n```gradle\nallprojects {\n    repositories {\n        jcenter()\n        maven {\n            url 'https://dl.bintray.com/leaking/maven'\n        }\n    }\n}\n```\n\n\n\n\n### Eclipse\n\nimport it as a library project.\n\n\n## How to use it\n\nyou can define a slideswitch in xml like the following example\n\n\n```xml\n    \u003ccom.leaking.slideswitch.SlideSwitch\n        android:layout_width=\"100dip\"\n        android:layout_height=\"120dip\"\n        slideswitch:isOpen=\"false\"\n        slideswitch:shape=\"circle\"\n        slideswitch:themeColor=\"#f200aa96\" \u003e\n    \u003c/com.leaking.slideswitch.SlideSwitch\u003e\n```\n\n\n\nyou can initial the state(on or off) in jave code in this way\n\n\n```java\n\tbulletSwitch.setState(true);\n```\n\n\nand you can listen to the change of the slideswitch like this\n\n```java\n    updateSwitch.setSlideListener(new SlideListener() {\n\n            @Override\n            public void open() {\n                // Do something ,,,\n            }\n\n            @Override\n            public void close() {\n                // Do something ,,,\n            }\n        });\n```\n\nyou even can forbid the widget to change its state(open or close) like this\n\n```java\n    slide.setSlideable(false);\n    slide.setSlideable(true);\n```\n\n## What does it look like \n\n\n\u003cimg src=\"https://github.com/Leaking/SlideSwitch/blob/master/Example/TestLibs/res/drawable-hdpi/slide_a.png\" width=\"340\" /\u003e\n\u003cimg src=\"https://github.com/Leaking/SlideSwitch/blob/master/Example/TestLibs/res/drawable-hdpi/slide_c.gif\" width=\"340\" /\u003e\n\n\n##Author\n\nQuinn Chen  \n\nchenhuazhaoao@gmail.com\n\n\n## LICENSE\n\n Copyright 2015 Quinn Chen\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeaking%2FSlideSwitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeaking%2FSlideSwitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeaking%2FSlideSwitch/lists"}