{"id":26844972,"url":"https://github.com/chinalwb/slidetoconfirm","last_synced_at":"2025-04-30T20:23:51.436Z","repository":{"id":112078925,"uuid":"250598457","full_name":"chinalwb/slidetoconfirm","owner":"chinalwb","description":"Slide to confirm component on Android","archived":false,"fork":false,"pushed_at":"2025-01-06T02:45:24.000Z","size":465,"stargazers_count":41,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T19:37:12.728Z","etag":null,"topics":["android","resets","slide","slide-button","slide-to","slide-to-cancel","slide-to-delete","slide-to-do","slide-to-unlock","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/chinalwb.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":"2020-03-27T17:22:37.000Z","updated_at":"2025-01-06T02:45:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"f18ec589-12c1-4b14-9857-87210e8dceff","html_url":"https://github.com/chinalwb/slidetoconfirm","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinalwb%2Fslidetoconfirm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinalwb%2Fslidetoconfirm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinalwb%2Fslidetoconfirm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinalwb%2Fslidetoconfirm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinalwb","download_url":"https://codeload.github.com/chinalwb/slidetoconfirm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251775857,"owners_count":21641898,"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","resets","slide","slide-button","slide-to","slide-to-cancel","slide-to-delete","slide-to-do","slide-to-unlock","slider","slideview"],"created_at":"2025-03-30T19:33:59.097Z","updated_at":"2025-04-30T20:23:51.400Z","avatar_url":"https://github.com/chinalwb.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg align=\"center\" src=\"./slide_to_confirm.gif\" /\u003e\n\u003c/p\u003e\n\n\n# Slide to confirm  [ ![Download](https://api.bintray.com/packages/chinalwb/slidetoconfirm/slidetoconfirm/images/download.svg) ](https://bintray.com/chinalwb/slidetoconfirm/slidetoconfirm/_latestVersion)\n\n\nI am open to work. Feel free to contact me at chinalwb168@gmail.com if you have an opening. Thank you!\n\n\n\n\n### [中文说明](./README_ch.md)\n\n### Congrats!\n- This library has been successfully used in:\n1. Insurance App\n2. [Maps \u0026 Navigation](https://play.google.com/store/apps/category/MAPS_AND_NAVIGATION?hl=en\u0026gl=US) App\n3. Financial App\n\n### What's this?\n- It is a component that requires user slide to confirm for some proceeding actions\n- Works on Android\n\n### What does it look like?\n![Sharp corners](https://user-images.githubusercontent.com/1758864/78349273-efce9b00-75d5-11ea-9a10-8022db9ade5a.png)\n\n![Round corners](https://user-images.githubusercontent.com/1758864/78349279-f230f500-75d5-11ea-9679-d3f400cd7135.png)\n\n![Circle](https://user-images.githubusercontent.com/1758864/78349282-f52be580-75d5-11ea-8ca7-26531129b171.png)\n\n![UI_4](https://user-images.githubusercontent.com/1758864/78350196-5dc79200-75d7-11ea-9971-6f0a0799d21b.png)\n\n![UI_5](https://user-images.githubusercontent.com/1758864/78350204-6029ec00-75d7-11ea-8f1c-4da0558f5337.png)\n\n![samples](https://user-images.githubusercontent.com/1758864/86143658-4b51eb80-bb27-11ea-9873-e3d00209ce6d.gif)\n\n\n\n### How is it implemented?\n- It extends the Android `RelativeLayout`\n- It adds necessary children at runtime\n- It detects user drags on the slider\n- It detects the user drags the slider to the end, and vibrate according to configuration\n- It resets its status when user releases but the slider is not at the end\n\n### Highlights\n- Easy to use, one line code for all configurations\n- Perfect performance\n- Deal with conflicts between vertical scroll gestures on out container perfectly\n- Flexible for customizing the slider (either LOTTIE or image) / border radius / background colors / animate duration / vibrate duration / ...\n- Allow resetting status, this UNLOCKs the feature of multi-steps action!\n\n### How to use?\n- Two steps:\n1. Add `implementation 'com.github.chinalwb:slidetoconfirm:1.0.3'` in your build.gradle\n2. Include `com.chinalwb.slidetoconfirmlib.SlideToConfirm` whenever necessary, for example:\n```\n\n\u003ccom.chinalwb.slidetoconfirmlib.SlideToConfirm xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    android:id=\"@+id/slide_to_confirm\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"60dp\"\n    android:layout_gravity=\"center_vertical\"\n    android:layout_margin=\"20dp\"\n\n    app:border_radius=\"30dp\"\n    app:border_width=\"2dp\"\n    app:slider_background_color=\"@color/purple\"\n    app:slider_color=\"@color/colorAccent\"\n    app:slider_lottie=\"lottie_x.json\"\n    app:slider_image=\"@drawable/slider\"\n    app:slider_width=\"100dp\"\n    app:slider_reset_duration=\"1000\"\n    app:slider_vibration_duration=\"50\"\n    app:slider_threshold=\"1dp\"\n    app:engage_text=\"Your action text\"\n    app:engage_text_size=\"17sp\"\n    app:engage_text_color=\"@android:color/white\"\n    app:engaged_text_font=\"@font/solid\"\n    app:completed_text=\"Unlocked!\"\n    app:completed_text_color=\"@android:color/white\"\n    app:completed_text_size=\"30sp\"\n\n    tools:context=\".MainActivity\" \u003e\n\u003c/com.chinalwb.slidetoconfirmlib.SlideToConfirm\u003e\n```\n\n### How do I customize?\n|   Attribute Name   |   Description   |  Sample Value    |\n| ---- | ---- | ---- |\n|   border_radius   |  The border radius of the entire layout    |   0dp / 2dp / any other dp   |\n|   border_width   |   The width of the border    |   1dp   |\n|   slider_background_color   |  The color of the entire layout    |  any color reference    |\n|   slider_color   |   The color of the slider  |   any color referrence    |\n|   slider_lottie   |   The lottie file to be shown as slider    |   lottie_x.json -- needs to be in `assets` folder    |\n|   slider_image   |   If you don't want to use lottie, you can use image, when both this and `slider_lottie` are provided, this wins    |   any drawable reference   |\n|   slider_width   |  Specify what the size of the slider   |  100dp    |\n|   slider_reset_duration   |  How long it takes for the reset animation when releasing the slider if not at end, in `ms`    |   300   |\n|   slider_vibration_duration   |  How long for the vibration when triggering unlocked, in `ms`   |  100    |\n|   slider_threshold   |  How far you'd regard the user has reached the end, for example 0dp means user has to explicit reaches the right end    |  1dp    |\n|   engage_text   |  To customize `Slide to unlock`    |  any string, like `slide to xxx`    |\n|   engage_text_size   |  The text size of the engage text `Slide to unlock`    |  17sp    |\n|   engage_text_color   |  The text color of the engage text `Slide to unlock`    |  any color reference     |\n|   engaged_text_font   |  The text font of the engage text, in `res/font` folder    |  @font/your_font    |\n|   completed_text   |  To customize the text after unlocked. e.g.: `Unlocked!`    |   any string you want  |\n|   completed_text_size   |   The text size of the completed text   |  17sp    |\n|   completed_text_color   |  The text color of the completed text    |  any color referrence    |\n|   completed_text_font   |   The text font of the completed text, in `res/font` folder      |  @font/your_font    |\n\n\n### APIs I may need\n\n1. `SlideToConfirm.setSlideListener(new ISlideListener() { ... })`; Use this when you want to detect the slider is start dragging (action down) / in dragging (action move) / cancel (action up) / done (action up when at the right end)\n2. `SlideToConfirm.reset()`; Use this when you want to reset the slider to initial state after it has been in completed state\n3. `SlideToConfirm.setEngageText(...)`; Use this when you want to update the engage text programmatically \n4. `SlideToConfirm.setCompletedText(...)`; Use this when you want to update the completed text programmatically \n\n------\nLicense: MIT\n\nIf you find my work is helpful to you or you are start using my code, you don't need to buy me a coffee, just could you please send me a \"✨\"? Your * encourages me to make more features open source, thanks for your support. You can contact me at 329055754@qq.com if you need any customization or any suggestion.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinalwb%2Fslidetoconfirm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinalwb%2Fslidetoconfirm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinalwb%2Fslidetoconfirm/lists"}