{"id":21888506,"url":"https://github.com/pythoncat1024/slideswitch","last_synced_at":"2025-07-23T23:03:39.224Z","repository":{"id":107255611,"uuid":"89825872","full_name":"pythoncat1024/SlideSwitch","owner":"pythoncat1024","description":"android 自定义控件 滑动开关","archived":false,"fork":false,"pushed_at":"2017-04-30T04:03:55.000Z","size":162,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T20:32:15.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pythoncat1024.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":"2017-04-30T02:58:34.000Z","updated_at":"2017-04-30T02:58:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"8c581b3d-6efc-4014-b05f-64e7b46a27e3","html_url":"https://github.com/pythoncat1024/SlideSwitch","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/pythoncat1024%2FSlideSwitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoncat1024%2FSlideSwitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoncat1024%2FSlideSwitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pythoncat1024%2FSlideSwitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pythoncat1024","download_url":"https://codeload.github.com/pythoncat1024/SlideSwitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244895509,"owners_count":20527902,"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-28T11:15:53.133Z","updated_at":"2025-03-22T02:23:54.732Z","avatar_url":"https://github.com/pythoncat1024.png","language":"Java","readme":"# SlideSwitch\nandroid 自定义控件 滑动开关\n\n* 滑动开关\n  类似于`CheckBox`,有开和关两种状态；与之不同之处在于，不仅可以通过点击切换开关状态，还可以通过手指滑动的方式切换状态。\n  \n* How To 参照[jitpack.io仓库](https://jitpack.io/#pythoncat1024/SlideSwitch/1.0.0)\n  * gradle\n    * Step 1. Add the JitPack repository to your build file\n \n\t    ```gradle\n\t    allprojects {\n\t\t\trepositories {\n\t        ...\n\t        maven { url 'https://jitpack.io' }\n\t      }\n\t    }\n\t    ```\n\n    * Step 2. Add the dependency\n\n\t    ```gradle\n\t    dependencies {\n\t\t         compile 'com.github.pythoncat1024:SlideSwitch:1.0.2'\n\t\t  }\n\t    ```\n    * Step 3. use in xml\n    ```xml\n    \u003ccom.python.cat.slideswitchlib.SlideSwitch\n        android:id=\"@+id/slide_switch\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"#0000\" /\u003e\n    ```\n    * Step 4. use in Activity\n    ```java\n    SlideSwitch ss = (SlideSwitch) findViewById(R.id.slide_switch);\n        ss.setSwitchState(SlideSwitch.State.OPEN);\n\n        ss.setOnCheckedChangeListener(new SlideSwitch.OnCheckedChangeListener() {\n            @Override\n            public void onCheckedChanged(SlideSwitch buttonView, boolean isOpened) {\n                Toast.makeText(getApplication(), \"isOpened? \" + isOpened, Toast.LENGTH_SHORT).show();\n            }\n        });\n    ```\n* 使用步骤结束。\n\n* 关于实现:参照源码...\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythoncat1024%2Fslideswitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpythoncat1024%2Fslideswitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpythoncat1024%2Fslideswitch/lists"}