{"id":13578438,"url":"https://github.com/futuredapp/hauler","last_synced_at":"2025-04-05T02:10:12.365Z","repository":{"id":45728495,"uuid":"157873823","full_name":"futuredapp/hauler","owner":"futuredapp","description":"Library with swipe to dismiss Activity gesture implementation","archived":false,"fork":false,"pushed_at":"2022-07-17T14:10:45.000Z","size":1625,"stargazers_count":437,"open_issues_count":1,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-28T22:49:45.388Z","etag":null,"topics":["activity","android","dragtodismiss","swipetodismiss","view"],"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/futuredapp.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":"2018-11-16T13:50:59.000Z","updated_at":"2024-12-09T19:53:31.000Z","dependencies_parsed_at":"2022-08-05T14:15:45.955Z","dependency_job_id":null,"html_url":"https://github.com/futuredapp/hauler","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuredapp%2Fhauler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuredapp%2Fhauler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuredapp%2Fhauler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/futuredapp%2Fhauler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/futuredapp","download_url":"https://codeload.github.com/futuredapp/hauler/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276189,"owners_count":20912288,"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":["activity","android","dragtodismiss","swipetodismiss","view"],"created_at":"2024-08-01T15:01:30.643Z","updated_at":"2025-04-05T02:10:12.352Z","avatar_url":"https://github.com/futuredapp.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"\u003cimg align=\"right\" src=\"images/Hauler.svg\"\u003e\n\n# Hauler\n\n[![Maven Central](https://img.shields.io/maven-central/v/app.futured.hauler/hauler)](https://search.maven.org/artifact/app.futured.hauler/hauler/)\n![minSdk:21](https://img.shields.io/badge/minSDK-21-brightgreen.svg)\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-Hauler-brightgreen.svg?style=flat )]( https://android-arsenal.com/details/1/7359 )\n![Publish Snapshot](https://github.com/futuredapp/hauler/actions/workflows/publish_snapshot.yml/badge.svg)\n![License](https://img.shields.io/github/license/futuredapp/hauler?color=black)\n\nHauler is an Android library containing custom layout which enables to easily create swipe to dismiss `Activity`.\nImplementation is based on code from project [Plaid](https://github.com/nickbutcher/plaid).\n\n![Alt text](https://github.com/thefuntasty/hauler/blob/master/images/example.gif)\n\n# Installation\n\n```groovy\ndependencies {\n    implementation(\"app.futured.hauler:hauler:latestVersion\")\n\n    // optional dependency with set of Data Binding adapters\n    implementation(\"app.futured.hauler:databinding:latestVersion\")\n}\n```\n\n### Snapshot installation\n\nAdd new maven repo to your top level gradle file.\n\n```groovy\nmaven { url \"https://oss.sonatype.org/content/repositories/snapshots\" }\n```\n\nSnapshots are grouped based on major version, so for version 5.x.x use:\n\n```groovy\nimplementation \"app.futured.hauler:hauler:5.X.X-SNAPSHOT\"\n```\n\n# Features\n\nHauler library comes with highly customizable `HaulerView` which provides swipe to dismiss functionality. \nIt also ships with `databinding` module which contains Binding Adapters for smoother experience with Android Data Binding implementation.\n\n# Usage\n \n Activity which is meant to be dismissed must contain `HaulerView` as a root view and `NestedScrollView` (or other `View` what supports nested scroll) \n as its child. Make sure your `NestedScrollview`'s attribute `android:fillViewport` is set to `true` otherwise it might not behave as\n expected:\n\n```xml\n\u003capp.futured.hauler.HaulerView\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:id=\"@+id/haulerView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\u003e\n\n    \u003candroidx.core.widget.NestedScrollView\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:fillViewport=\"true\"\u003e\n            \n            \u003c!-- your layout--\u003e\n            \n    \u003c/androidx.core.widget.NestedScrollView\u003e\n\u003c/app.futured.hauler.HaulerView\u003e\n```\n\nSecondly, define translucent floating Theme and assign it to the Activity you want to give dismiss ability:\n\n ```xml\n\u003cstyle name=\"AppTheme.Draggable\" parent=\"Theme.AppCompat.Light.NoActionBar\"\u003e\n        \u003citem name=\"android:colorBackgroundCacheHint\"\u003e@null\u003c/item\u003e\n        \u003citem name=\"android:windowContentOverlay\"\u003e@null\u003c/item\u003e\n        \u003citem name=\"android:windowIsFloating\"\u003efalse\u003c/item\u003e\n        \u003citem name=\"android:windowIsTranslucent\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowNoTitle\"\u003etrue\u003c/item\u003e\n        \u003citem name=\"android:windowBackground\"\u003e@color/dark_gray\u003c/item\u003e\n\u003c/style\u003e\n```\n\n```xml\n\u003cactivity\n        android:name=\".draggable.SimpleUsageActivity\"\n        android:theme=\"@style/AppTheme.Draggable\"/\u003e\n```\nSet `onDragDismissListener` to react properly to user dismiss request. Example implementation might look like this:\n```kotlin\n    override fun onCreate(savedInstanceState: Bundle?) {\n        // ...\n\n        haulerView.setOnDragDismissedListener {\n            finish() // finish activity when dismissed\n        }\n    }\n```\n\n## Customization\n\nThere are few styleable attributes you might want to use to customize your `HaulerView`:\n\n ```xml\n\u003capp.futured.hauler.HaulerView\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        app:dragDismissDistance=\"112dp\"\n        app:dragDismissFraction=\"0.9\"\n        app:dragElasticity=\"0.7\"\n        app:dragDismissScale=\"0.95\"/\u003e\n```\n\n| Attribute name | Type | Default value | Description|\n| -------------- | ---- | ------------- | ---------- |\n| `app:dragDismissDistance` | dimen | 100dp | Distance which should be `View` swiped to consider Activity as dismissed |\n| `app:dragDismissFraction` | float | unspecified | `\u003c0;1\u003e` - Fraction of `View`'s height we should reach swiping to consider Activity as dismissed |\n| `app:dragElasticity` | float | 0.8 | `\u003c0;1\u003e` - Toughness of swipe. Higher value indicates more rigid feeling  |\n| `app:dragDismissScale` | float | 0.95 | `\u003c0;1\u003e` - Scale factor of `View` while performing swipe action |\n| `app:dragUpEnabled` | boolean | false | Flag indicating if drag up dismiss gesture is enabled |\n| `app:fadeSystemBars` | boolean | true | Flag indicating if system bars (status \u0026 navigation) fades while dismiss is in progress |\n\nAttributes `dragDismissDistance` and `dragDismissFraction` are exclusive. Do not use them together.\n\n# License\n\nHauler is available under the MIT license. See the [LICENSE file](LICENCE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturedapp%2Fhauler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuturedapp%2Fhauler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuturedapp%2Fhauler/lists"}