{"id":13611528,"url":"https://github.com/skydoves/DoubleLift","last_synced_at":"2025-04-13T04:34:49.759Z","repository":{"id":45022402,"uuid":"217547746","full_name":"skydoves/DoubleLift","owner":"skydoves","description":"🦋 Expands and collapses a layout horizontally and vertically sequentially.","archived":false,"fork":false,"pushed_at":"2021-02-05T15:03:59.000Z","size":317,"stargazers_count":360,"open_issues_count":1,"forks_count":22,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-08T03:11:11.386Z","etag":null,"topics":["android","android-library","android-ui","collapse","doublelift","expand","expandable","kotlin","skydoves"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skydoves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null},"funding":{"github":"skydoves","custom":["https://www.paypal.me/skydoves","https://www.buymeacoffee.com/skydoves"]}},"created_at":"2019-10-25T14:08:10.000Z","updated_at":"2025-03-02T07:57:29.000Z","dependencies_parsed_at":"2022-09-26T21:50:15.126Z","dependency_job_id":null,"html_url":"https://github.com/skydoves/DoubleLift","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/skydoves%2FDoubleLift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FDoubleLift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FDoubleLift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skydoves%2FDoubleLift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skydoves","download_url":"https://codeload.github.com/skydoves/DoubleLift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665157,"owners_count":21142118,"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","android-ui","collapse","doublelift","expand","expandable","kotlin","skydoves"],"created_at":"2024-08-01T19:01:57.059Z","updated_at":"2025-04-13T04:34:49.487Z","avatar_url":"https://github.com/skydoves.png","language":"Kotlin","readme":"# DoubleLift\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://opensource.org/licenses/Apache-2.0\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache%202.0-blue.svg\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://android-arsenal.com/api?level=16\"\u003e\u003cimg alt=\"API\" src=\"https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://travis-ci.com/skydoves/DoubleLift\"\u003e\u003cimg alt=\"Build Status\" src=\"https://travis-ci.com/skydoves/DoubleLift.svg?branch=master\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://androidweekly.net/issues/issue-397\"\u003e\u003cimg alt=\"Build Status\" src=\"https://img.shields.io/badge/Android%20Weekly-%23397-orange\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://skydoves.github.io/libraries/doublelift/javadoc/doublelift/com.skydoves.doublelift/index.html\"\u003e\u003cimg alt=\"Javadoc\" src=\"https://img.shields.io/badge/Javadoc-DoubleLift-yellow\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n🦋 Expands and collapses a layout horizontally and vertically sequentially.\u003cbr\u003e\nInspired by \"Viewing Labels\" from the Trello.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24237865/67579148-dbf95000-f77e-11e9-8e90-20fd64304f66.gif\" width=\"32%\"/\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/24237865/67660029-22c69000-f9a1-11e9-9de3-31cfe026bf5a.gif\" width=\"32%\"/\u003e\n\u003c/p\u003e\n\n## Including in your project\n[![Maven Central](https://img.shields.io/maven-central/v/com.github.skydoves/doublelift.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.github.skydoves%22%20AND%20a:%22doublelift%22)\n[![Jitpack](https://jitpack.io/v/skydoves/DoubleLift.svg)](https://jitpack.io/#skydoves/DoubleLift)\n### Gradle \nAdd below codes to your **root** `build.gradle` file (not your module build.gradle file).\n```gradle\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\nAnd add a dependency code to your **module**'s `build.gradle` file.\n```gradle\ndependencies {\n    implementation \"com.github.skydoves:doublelift:1.0.4\"\n}\n```\n\n## Usage\nAdd following XML namespace inside your XML layout file.\n\n```gradle\nxmlns:app=\"http://schemas.android.com/apk/res-auto\"\n```\n\n### DoubleLiftLayout\nHere is a basic example of implementing `DoubleLiftLayout`.\n\n```gradle\n\u003ccom.skydoves.doublelift.DoubleLiftLayout\n  android:layout_width=\"wrap_content\"\n  android:layout_height=\"wrap_content\"\n  app:doubleLift_foldedWidth=\"50dp\" // sets the width size when collapsed.\n  app:doubleLift_foldedHeight=\"10dp\" // sets the height size when collapsed.\n  app:doubleLift_horizontalDuration=\"400\" // sets the duration of horizontal lifting.\n  app:doubleLift_verticalDuration=\"300\" // sets the duration of vertical lifting.\n  app:doubleLift_cornerRadius=\"4dp\" // sets the corner radius.\n  app:doubleLift_autoExpand=\"false\" // expand initially or not.\n  app:doubleLift_startOrientation=\"horizontal\"\n  app:doubleLift_animation=\"bounce\" // sets the lifting animation when expanding and collapsing\n  \u003e\n\n  \u003cTextView\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:layout_gravity=\"center\"\n    android:text=\"Feature\"\n    android:textColor=\"@color/white_87\"\n    android:textStyle=\"bold\" /\u003e\n    \n  // something complicated views or layouts\n  \n\u003c/com.skydoves.doublelift.DoubleLiftLayout\u003e\n```\n\n### Create using builder class\nWe can create an instance of `DoubleLiftLayout` using the `DoubleLiftLayout.Builder` class.\n#### Java\n```java\nDoubleLiftLayout doubleLiftLayout = new DoubleLiftLayout.Builder(context)\n    .setFoldedWidth(200)\n    .setFoldedHeight(100)\n    .setCornerRadius(6)\n    .setLiftHorizontalDuration(400)\n    .setLiftVerticalDuration(200)\n    .setOnExpandListener(new OnExpandListener() {\n      @Override public void onExpand(boolean isExpanded) {\n        toast(\"expanded: \" + isExpanded);\n      }\n    }).build();\n```\n\n#### Kotlin\n```kotlin\nval myDoubleLiftLayout = DoubleLiftLayout.Builder(context)\n  .setFoldedWidth(200)\n  .setFoldedHeight(100)\n  .setCornerRadius(6)\n  .setLiftHorizontalDuration(400)\n  .setLiftVerticalDuration(200)\n  .setOnExpandListener { toast(\"expanded: $it\") }\n  .build()\n```\nOr we can create using the kotlin-dsl.\n```kotlin\nval myDoubleLiftLayout = doubleLiftLayout(this) {\n  setFoldedWidth(200)\n  setFoldedHeight(100)\n  setCornerRadius(6)\n  setLiftHorizontalDuration(400)\n  setLiftVerticalDuration(200)\n  setOnExpandListener { toast(\"expanded: $it\") }\n}\n```\n\n### Expand and Collapse\nWe can expand and collapse using the below methods.\n```kotlin\ndoubleLiftLayout.expand(); // expand the width and height size sequentially.\ndoubleLiftLayout.collapse(); // collapse the width and height size sequentially.\n```\n\nor we can do something after expanded using lambda in Kotlin.\n\n```kotlin\ndoubleLiftLayout.expand { toast(\"expanded!\") }\ndoubleLiftLayout.collapse { toast(\"collapsed!\") }\n```\n\n### OnExpandListener\nWe can listen to the `DoubleLiftLayout` is expanded or collapsed.\n#### Java\n```java\n.setOnExpandListener(new OnExpandListener() {\n  @Override public void onExpand(boolean isExpanded) {\n    toast(\"expanded: \" + isExpanded);\n  }\n}\n```\n#### Kotlin\n```kotlin\ndoubleLiftLayout.onExpandListener = object : OnExpandListener {\n  override fun onExpand(isExpanded: Boolean) {\n    toast(\"Expanded : $it\")\n  }\n}\n\n// or we can listen using a lambda expression.\ndoubleLiftLayout.setOnExpandListener {\n  if (it) {\n    toast(\"expanded\")\n  } else {\n    toast(\"collapse\")\n  }\n}\n```\n\n### LiftAnimation\nWe can customize the expanding and collapsing animation.\u003cbr\u003e\n```kotlin\nLiftAnimation.NORMAL\nLiftAnimation.ACCELERATE\nLiftAnimation.BOUNCE\n```\n\nNORMAL | ACCELERATE | BOUNCE\n| :---------------: | :---------------: | :---------------: |\n| \u003cimg src=\"https://user-images.githubusercontent.com/24237865/67661136-c749d180-f9a3-11e9-82c4-48975a704412.gif\" align=\"center\" width=\"100%\"/\u003e | \u003cimg src=\"https://user-images.githubusercontent.com/24237865/67661132-c749d180-f9a3-11e9-8689-904d60a74e42.gif\" align=\"center\" width=\"100%\"/\u003e | \u003cimg src=\"https://user-images.githubusercontent.com/24237865/67661134-c749d180-f9a3-11e9-9dfe-6071936f1a30.gif\" align=\"center\" width=\"100%\"/\u003e\n\n## DoubleLiftLayout Attributes\nAttributes | Type | Default | Description\n--- | --- | --- | ---\nfoldedWidth | Dimension | 0 | sets the width size when collapsed.\nfoldedHeight | Dimension | 0 | ets the height size when collapsed.\nhorizontalDuration | Long | 500L | sets the duration of horizontal lifting.\nverticalDuration | Long | 300L | sets the duration of vertical lifting.\ncornerRadius | Dimension | 4dp | sets the corner radius.\nautoExpand | Boolean | false | invkoe expand() method initially or not.\nstartOrientation | LiftStartOrientation | LiftStartOrientation.HORIZONTAL | sets the starting orientation of the lifting.\nanimation | LiftAnimation | LiftAnimation.NORMAL | sets the lifting animation when expanding and collapsing\n\n## Find this library useful? :heart:\nSupport it by joining __[stargazers](https://github.com/skydoves/DoubleLift/stargazers)__ for this repository. :star:\u003cbr\u003e\nAnd __[follow](https://github.com/skydoves)__ me for my next creations! 🤩\n\n# License\n```xml\nCopyright 2019 skydoves (Jaewoong Eum)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":["https://github.com/sponsors/skydoves","https://www.paypal.me/skydoves","https://www.buymeacoffee.com/skydoves"],"categories":["Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskydoves%2FDoubleLift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskydoves%2FDoubleLift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskydoves%2FDoubleLift/lists"}