{"id":13644574,"url":"https://github.com/MAXDeliveryNG/slideview","last_synced_at":"2025-04-21T10:33:41.312Z","repository":{"id":143768399,"uuid":"81938816","full_name":"MAXDeliveryNG/slideview","owner":"MAXDeliveryNG","description":"An awesome sliding button library for Android.","archived":false,"fork":false,"pushed_at":"2019-02-13T18:31:46.000Z","size":1903,"stargazers_count":732,"open_issues_count":4,"forks_count":98,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-09T17:41:58.720Z","etag":null,"topics":["android","android-library","slide-button","slider","slideview"],"latest_commit_sha":null,"homepage":"","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/MAXDeliveryNG.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2017-02-14T11:31:26.000Z","updated_at":"2024-08-02T07:30:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"2814cd50-a77c-4967-bb6e-c36c5ed4c96d","html_url":"https://github.com/MAXDeliveryNG/slideview","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAXDeliveryNG%2Fslideview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAXDeliveryNG%2Fslideview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAXDeliveryNG%2Fslideview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAXDeliveryNG%2Fslideview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MAXDeliveryNG","download_url":"https://codeload.github.com/MAXDeliveryNG/slideview/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250040517,"owners_count":21365123,"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","android-library","slide-button","slider","slideview"],"created_at":"2024-08-02T01:02:08.260Z","updated_at":"2025-04-21T10:33:36.300Z","avatar_url":"https://github.com/MAXDeliveryNG.png","language":"Java","readme":"# SlideView\n\nA simple, yet awesome sliding button for Android.\n\n[![CircleCI](https://circleci.com/gh/MAXDeliveryNG/slideview/tree/master.svg?style=svg)](https://circleci.com/gh/MAXDeliveryNG/slideview/tree/master)\n[![JitPack](https://jitpack.io/v/MAXDeliveryNG/slideview.svg)](https://jitpack.io/#MAXDeliveryNG/slideview)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-SlideView-9C27B0.svg)](https://android-arsenal.com/details/1/5304)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/MAXDeliveryNG/slideview/blob/master/LICENSE.txt)\n[![Min SDK](https://img.shields.io/badge/Min%20SDK-14-e91e63.svg)](https://developer.android.com/about/versions/android-4.0.html)\n\n## Preview\n\n\u003cimg src=\"/art/screenshot_1.png\" alt=\"SlideView\" width=\"240\"\u003e \u003cimg src=\"/art/screenshot_2.png\" alt=\"SlideView2\" width=\"240\"\u003e\n\nGet the sample apk [here](https://github.com/MAXDeliveryNG/slideview/releases/download/1.0.0/sample.apk/)\n\n\n## Setup\n\n### Gradle\n\nAdd this to your project level `build.gradle`:\n\n```groovy\nallprojects {\n repositories {\n    jcenter()\n    maven { url \"https://jitpack.io\" }\n }\n}\n```\n\nAdd this to your app `build.gradle`:\n\n```groovy\ndependencies {\n\timplementation 'com.github.MAXDeliveryNG:slideview:1.1.0'\n}\n```\n\n## Usage\n\nThe SlideView is very easy to use. Just add it to your layout like any other view. \n\n\u003e From version 1.1.0, all SlideView's attributes are prefixed \"sv_\", this \nis to avoid conflicting with attributes in other libraries or attributes defined by users.\n\n##### Via XML\n\nHere's a basic implementation.\n\n```xml\n \u003cng.max.slideview.SlideView\n        android:id=\"@+id/slideView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:sv_buttonBackgroundColor=\"@color/button_bg_color\"\n        app:sv_buttonImage=\"@drawable/button_img\"\n        app:sv_slideBackgroundColor=\"@color/slide_bg_color\"\n        app:sv_slideText=\"@string/slide_text\"\n        app:sv_slideTextColor=\"@color/slide_text_color\" /\u003e\n```\n\nHere's an example with all the view attributes.\n\n```xml\n\u003cng.max.slideview.SlideView\n        android:id=\"@+id/slideView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        app:sv_buttonBackgroundColor=\"@color/button_bg_color\"\n        app:sv_buttonImage=\"@drawable/button_img\"\n        app:sv_slideBackgroundColor=\"@color/slide_bg_color\"\n        app:sv_slideText=\"@string/slide_text\"\n        app:sv_slideTextColor=\"@color/slide_text_color\"\n        app:sv_slideTextSize=\"16sp\"\n        app:sv_animateSlideText=\"true\"\n        app:sv_reverseSlide=\"false\"\n        app:sv_strokeColor=\"@color/slide_stroke_color\"\n        app:sv_buttonImageDisabled=\"@drawable/button_img_disabled\" /\u003e\n\n```\n\n### Attributes information\n\n|Attribute name|Description|Default value|\n|:-:|:-:|:-:|\n|slideBackgroundColor|The slide background color| `#3F51B5` |\n|buttonBackgroundColor|The slide button background color| `#FFFFFF`|\n|slideTextColor|The color of the slide label |`#FFFFFF`|\n|buttonImage|The drawable on the button | double chevron icon |\n|slideText|The slide label| `none` |\n|slideTextSize|The label's size| 16sp |\n|animateSlideText|If `true`, the label fades out while the slide is in progress| `true` |\n|strokeColor|If set, a stroke is drawn around the slide background | `none` |\n|reverseSlide|If `true`, the SlideView is reversed | `false` |\n|buttonImageDisabled| The drawable to be used as the button image when the SlideView is disabled| the default drawable|\n\nNote: All color attributes can be replaced with a `ColorStateList` so the SlideView can use the appropriate colors for the enabled and disabled states. See the sample module for examples. \n\n### Listening for slide actions on the SlideView\n\nYou can set a listener to be notified when the user slides across the SlideView. An example is shown below.\n\n```java\nSlideView slideView = (SlideView) findViewById(R.id.slideView);\nslideView.setOnSlideCompleteListener(new SlideView.OnSlideCompleteListener() {\n            @Override\n            public void onSlideComplete(SlideView slideView) {\n                // vibrate the device\n                Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);\n                vibrator.vibrate(100);\n\n                // go to a new activity\n                startActivity(new Intent(MainActivity.this, NewActivity.class));\n            }\n        });\n\n```\n\n\n### Setting the view attributes via code\n\nFor convenience, many of the SlideView attributes can be set via code.\n\n```java \n // set the label\n setText(CharSequence text); \n \n // set the text size\n setTextSize(int size);\n \n // set the drawable for the button\n setButtonImage(Drawable image);\n \n // set the label color\n setTextColor(@ColorInt int color) ;\n \n // set the label color with a ColorStateList\n setTextColor(ColorStateList colors);\n \n // set the button drawable for disabled state\n setButtonImageDisabled(Drawable image);\n \n // set the button background color\n setButtonBackgroundColor(ColorStateList color);\n \n // set the slide background color\n setSlideBackgroundColor(ColorStateList color);\n \n```\n\nNote: for the methods that take a `ColorStateList`, you can easily use a single color by converting it to a `ColorStateList` with the method `ColorStateList.valueOf(int color);`\n\n## Caveat \nThe view height is currently fixed so you should use `wrap_content` when defining the view height in your layout. \n\n## Author\n[Kizito Nwose](https://github.com/kizitonwose)\n\n\n## Contributing\nIf you find any bugs, please feel free to fix it and send a pull request or [open an issue.](https://github.com/MAXDeliveryNG/slideview/issues) \n\n## License\n```\nCopyright (c) 2017 MAXDeliveryNG\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```\n","funding_links":[],"categories":["Sliding"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMAXDeliveryNG%2Fslideview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMAXDeliveryNG%2Fslideview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMAXDeliveryNG%2Fslideview/lists"}