{"id":20373115,"url":"https://github.com/st235/swipetoactionlayout","last_synced_at":"2025-09-11T17:08:18.851Z","repository":{"id":47431687,"uuid":"196595936","full_name":"st235/SwipeToActionLayout","owner":"st235","description":"Layout,  which provides swipe to reveal behaviour 🎭","archived":false,"fork":false,"pushed_at":"2023-10-01T21:28:59.000Z","size":5259,"stargazers_count":110,"open_issues_count":4,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-21T17:18:01.865Z","etag":null,"topics":["android","android-library","hacktoberfest","hacktoberfest2023","kotlin","menu","swipe-to-reveal"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/st235.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,"zenodo":null}},"created_at":"2019-07-12T14:44:51.000Z","updated_at":"2025-06-10T05:14:15.000Z","dependencies_parsed_at":"2023-10-01T23:28:44.035Z","dependency_job_id":null,"html_url":"https://github.com/st235/SwipeToActionLayout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/st235/SwipeToActionLayout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FSwipeToActionLayout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FSwipeToActionLayout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FSwipeToActionLayout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FSwipeToActionLayout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/st235","download_url":"https://codeload.github.com/st235/SwipeToActionLayout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/st235%2FSwipeToActionLayout/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261304255,"owners_count":23138298,"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","hacktoberfest","hacktoberfest2023","kotlin","menu","swipe-to-reveal"],"created_at":"2024-11-15T01:16:38.475Z","updated_at":"2025-06-22T14:07:21.110Z","avatar_url":"https://github.com/st235.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"images/showcase.gif\" width=\"540\" height=\"105\"\u003e\n\n# SwipeToActionLayout\n\n![Min Android Sdk](https://img.shields.io/badge/minSdkVersion-16-1976D2.svg)\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.st235/swipetoactionlayout.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.st235%22%20AND%20a:%22swipetoactionlayout%22)\n\nSwipeToActionLayout is a layout which helps to implement swipe to reveal behaviour. It is really easy to setup and maintain.\n\nFirst of all, you need to download it, don't you? 🙂\n\n## Download from ...\n\n__Important: library was migrated from JCenter to MavenCentral__ \n\nIt means that it may be necessary to add __mavenCentral__ repository to your repositories list\n\n```groovy\nallprojects {\n    repositories {\n        // your repositories\n\n        mavenCentral()\n    }\n}\n```\n\n- Maven\n\n```text\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.st235\u003c/groupId\u003e\n  \u003cartifactId\u003eswipetoactionlayout\u003c/artifactId\u003e\n  \u003cversion\u003eX.X\u003c/version\u003e\n  \u003ctype\u003epom\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\n- Gradle\n\n```text\nimplementation 'com.github.st235:swipetoactionlayout:X.X'\n```\n\n- Ivy\n\n```text\n\u003cdependency org='com.github.st235' name='swipetoactionlayout' rev='X.X'\u003e\n  \u003cartifact name='swipetoactionlayout' ext='pom' \u003e\u003c/artifact\u003e\n\u003c/dependency\u003e\n```\n\nP.S.: The latest code version is mentioned at the version badge at the top of this page.\n\n## Usage\n\nAfter you have downloaded the library, you need to integrate it. You should declare layout at your xml.\n\n```xml\n\u003cgithub.com.st235.lib_swipetoactionlayout.SwipeToActionLayout\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    app:sal_gravity=\"right\"\n    app:sal_isFullActionSupported=\"false\"\n    app:sal_items=\"@menu/swipe_to_action_menu\"\n    app:sal_shouldVibrateOnQuickAction=\"false\"\u003e\n\n    ... draggable child ...\n\n\u003c/github.com.st235.lib_swipetoactionlayout.SwipeToActionLayout\u003e\n```\n\nXml declaration supports the following attributes:\n\n| property | type | description |\n| ----- | ----- | ----- |\n| **sal_gravity** | enum | gravity of your action menu. could be without rtl support, ie left or right, and with rtl support, ie start and end |\n| **sal_isFullActionSupported** | boolean | allows you to add support of quick action, which will be revealed on full swipe |\n| **sal_shouldVibrateOnQuickAction** | boolean | when quick action will be applied view can perform haptic feedback. set this flag as true if you want to support it. |\n| **sal_items** | reference | reference to your xml menu file |\n\nIf you decided to use xml-declared menu then you should create menu file by the next rules:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cmenu xmlns:app=\"http://schemas.android.com/apk/res-auto\" xmlns:android=\"http://schemas.android.com/apk/res/android\"\u003e\n    \u003citem\n        android:id=\"@+id/call\"\n        android:icon=\"@drawable/ic_call_black_18dp\"\n        android:background=\"@drawable/action_background\"\n        android:iconTint=\"@color/iconTint\"/\u003e\n\n    \u003citem\n        android:id=\"@+id/email\"\n        android:icon=\"@drawable/ic_email_black_18dp\"\n        android:background=\"@drawable/action_background\"\n        android:iconTint=\"@color/iconTint\" /\u003e\n\n    \u003citem\n        android:id=\"@+id/delete\"\n        android:icon=\"@drawable/ic_delete_black_18dp\"\n        android:background=\"@drawable/action_background\"\n        android:iconTint=\"@color/colorAccent\" /\u003e\n\u003c/menu\u003e\n```\n\nAn item supports the following attributes:\n\n| property | type | description |\n| ----- | ----- | ----- |\n| **id** | id | an id of your action |\n| **title** | text | a supporting text, will be shown under icon |\n| **icon** | reference | a reference to drawable |\n| **titleTextColor** | color | a color of your title |\n| **background** | reference | a reference to your background resource |\n| **iconTint** | color | tint to your icon, allows to change color of it |\n\nPS: all these properties are start with `android` prefix, for example `android:background`\n\nIs is also possible to apply actions programmatically\n\n```kotlin\n        swipeToActionLayout.actions =\n                listOf(\n                        SwipeAction(0xFFFBDAEE.toInt(), R.drawable.baseline_call_24, getString(R.string.action_call), Color.BLACK, Color.BLACK),\n                        SwipeAction(0xFFFFF7A4.toInt(), R.drawable.baseline_email_24, getString(R.string.action_email), Color.BLACK, Color.BLACK),\n                        SwipeAction(0xFFC0E7F6.toInt(), R.drawable.baseline_duo_24, getString(R.string.action_duo), Color.BLACK, Color.BLACK)\n                )\n```\n\nTo listen lifecycle callbacks from `SwipeToActionLayout` you should implement `SwipeMenuListener`\n\n```Kotlin\n\nswipeToActionLayout.menuListener = MenuListener()\n\nprivate inner class MenuListener: SwipeMenuListener {\n\n        override fun onClosed(view: View) {\n            // empty on purpose\n        }\n\n        override fun onOpened(view: View) {\n            // empty on purpose\n        }\n\n        override fun onFullyOpened(view: View, quickAction: SwipeAction) {\n            // empty on purpose\n        }\n\n     override fun onActionClicked(view: View, action: SwipeAction) {\n         Toast.makeText(this@MainActivity, \"On clicked on: ${action.text}\", Toast.LENGTH_SHORT).show()\n         swipeToActionLayout.close()\n     }\n }\n\n```\n\nAnd that is it. Enjoy it!\n\n### License\n\n```text\nMIT License\n\nCopyright (c) 2019 Alexander Dadukin\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst235%2Fswipetoactionlayout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fst235%2Fswipetoactionlayout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fst235%2Fswipetoactionlayout/lists"}