{"id":13589213,"url":"https://github.com/HeyAlex/CornerSheet","last_synced_at":"2025-04-08T09:32:11.635Z","repository":{"id":44148703,"uuid":"231829305","full_name":"HeyAlex/CornerSheet","owner":"HeyAlex","description":"Behavior to expand view from corner","archived":false,"fork":false,"pushed_at":"2024-06-06T13:38:20.000Z","size":5802,"stargazers_count":300,"open_issues_count":1,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-06T09:39:17.170Z","etag":null,"topics":["android-ui","animation","bottom-sheets","bottom-sheets-slide","bottomsheet","bottomsheet-android","corner-sheet"],"latest_commit_sha":null,"homepage":"https://m2.material.io/components/sheets-bottom#expanding-bottom-sheet","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/HeyAlex.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-04T21:13:57.000Z","updated_at":"2024-10-25T13:51:52.000Z","dependencies_parsed_at":"2024-11-06T09:41:42.471Z","dependency_job_id":null,"html_url":"https://github.com/HeyAlex/CornerSheet","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/HeyAlex%2FCornerSheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyAlex%2FCornerSheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyAlex%2FCornerSheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HeyAlex%2FCornerSheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HeyAlex","download_url":"https://codeload.github.com/HeyAlex/CornerSheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247814072,"owners_count":21000496,"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-ui","animation","bottom-sheets","bottom-sheets-slide","bottomsheet","bottomsheet-android","corner-sheet"],"created_at":"2024-08-01T16:00:25.651Z","updated_at":"2025-04-08T09:32:11.055Z","avatar_url":"https://github.com/HeyAlex.png","language":"Kotlin","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003ch1 align=\"center\"\u003eCorner Sheet\u003c/h1\u003e\n\u003cp align=\"center\"\u003eBehavior to make a view expands from corner\u003c/p\u003e\n\u003cp align=\"center\"\u003e\u003ca href=\"https://github.com/heyalex/CornerSheet\" target=\"_blank\"\u003e\u003cimg width=\"250\"src=\"raw/shop_sample.gif\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Usage\n\nThe usage is similar to [BottomSheetBehavior](https://developer.android.com/reference/com/google/android/material/bottomsheet/BottomSheetBehavior)\nCorner Sheet - behavior that allow you expand a view from corner.\n\n![](https://github.com/HeyAlex/CornerSheet/blob/master/raw/corner_sample_pic.png)\nA simple view with behavior in xml will be look like:\n\n```xml\n\u003candroidx.coordinatorlayout.widget.CoordinatorLayout\n    android:id=\"@+id/coordinator\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n\n        \u003cFrameLayout\n            android:id=\"@+id/corner_behavior_container\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            app:backgroundTint=\"@color/colorPrimary\"\n            app:behavior_expanded_width=\"175dp\"\n            app:behavior_horizontal_peekHeight=\"94dp\"\n            app:behavior_peekHeight=\"60dp\"\n            app:layout_behavior=\"com.github.heyalex.cornersheet.behavior.CornerSheetBehavior\"\n            app:shapeAppearanceOverlay=\"@style/ShapeAppearanceOverlay.CornerShape\"\n            tools:ignore=\"MissingPrefix\"\u003e\n\n            \u003candroidx.appcompat.widget.Toolbar\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"wrap_content\"\n                android:background=\"@android:color/transparent\"\n                app:title=\"Corner Sample\"\n                app:titleTextColor=\"@android:color/white\" /\u003e\n\n        \u003c/FrameLayout\u003e\n\n\u003c/androidx.coordinatorlayout.widget.CoordinatorLayout\u003e\n\n```\n\nYou can use the following attributes on view with CornerSheetBehavior.\n\n| Properties                                 | Type                  | Default |\n| -------------------------------------------| --------------------- | ------- |\n| `behavior_horizontalExpandingRatio`        | float                 | 0.2f    |\n| `behavior_expanded_width`                  | dimension             | 0dp     |\n| `behavior_horizontal_peekHeight`           | dimension             | 0dp     |\n\nCustomize corner shape with `shapeAppearanceOverlay` attribute:\n```xml\n \u003cstyle name=\"ShapeAppearanceOverlay.CornerShape\" parent=\"\"\u003e\n        \u003citem name=\"cornerSizeTopLeft\"\u003e30dp\u003c/item\u003e\n        \u003citem name=\"cornerFamily\"\u003erounded\u003c/item\u003e\n \u003c/style\u003e\n```\n\nThere are 3 state of CornerSheetBehavior:\n\n| State                                 | Description                                                      |\n| --------------------------------------| -------------------------------------------------------------------- |\n| `CornerSheetBehavior.STATE_EXPANDED`  | expanded horizontally on `behavior_expanded_width` value         |\n| `CornerSheetBehavior.STATE_COLLAPSED` | expanded horizontally on `behavior_horizontal_peekHeight` value  |\n| `CornerSheetBehavior.STATE_HIDDEN`    | hide horizontally                                                |\n\n![](/raw/behavior_states_sample.png)\n\nThere are following api that can be used on `CornerSheetBehavior`:\n```kotlin\nbehavior.expandingRatio = 0.5f\nbehavior.horizontalState = CornerSheetBehavior.STATE_EXPANDED\nbehavior.expandedWidth = 170.dp()\nbehavior.setHorizontalPeekHeight(60.dp(), animate = true) //will be animated if horizontal state is CornerSheetBehavior.STATE_COLLAPSED\n```\n\nJust check app module with \"Behavior Sample\":\n\n![](/raw/corner_behavior_sample.gif)\n\n\nThere is also an option to use a view that can contain a header and content:\n\n```xml\n\u003candroidx.coordinatorlayout.widget.CoordinatorLayout\n    android:id=\"@+id/coordinator\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\u003e\n\n    \u003ccom.github.heyalex.CornerDrawer\n        android:id=\"@+id/corner_drawer\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\n        android:clickable=\"true\"\n        app:behavior_horizontal_peekHeight=\"58dp\"\n        app:content_color=\"@color/corner_drawer_content_color\"\n        app:content_view=\"@layout/content_layout\"\n        app:header_color=\"@color/corner_drawer_header_color\"\n        app:header_view=\"@layout/header_layout\"\n        app:layout_behavior=\"com.github.heyalex.cornersheet.behavior.CornerSheetHeaderBehavior\"\n        app:shapeAppearanceOverlay=\"@style/ShapeAppearanceOverlay.CornerShape\" /\u003e\n\u003c/androidx.coordinatorlayout.widget.CoordinatorLayout\u003e\n```\n\nWith CornerDrawer you don't need to set `behavior_peekHeight` and `behavior_expanded_width`, they will be assigned automatically when `header_view` will be inflated.\n\nYou can use an attributes on behavior that described below and a following attributes on CornerDrawer\n\n| Properties          | Type         | Default |\n| ------------------- | ------------ | ------- |\n| `header_view`       | reference    | -1      |\n| `header_color`      | reference    | #FFF    |\n| `content_view`      | reference    | -1      |\n| `content_color`     | reference    | #FFF    |\n\nThe main preview is done with `CornerDrawer`, just check app module with \"Support Sample\"\n\n## Integration\n\nThis library is available on **mavenCentral**, so you need to add this repository to your root build.gradle:\n\n```groovy\nallprojects {\n    repositories {\n        ...\n        mavenCentral()\n    }\n}\n```\n\nAdd one of the following dependency:\n\n```groovy\ndependencies {\n\n    //only CornerSheetBehavior\n    implementation 'com.github.heyalex.cornersheet:core:v1.0.1'\n\n    //CornerSheetBehavior and CornerDrawer\n    implementation 'com.github.heyalex.cornersheet:drawer:v1.0.1'\n}\n```\n\n## Samples\nYou can find sample in app module, to understand functionality of library or just get an APK [here](https://github.com/HeyAlex/CornerSheet/raw/master/raw/app-debug.apk)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeyAlex%2FCornerSheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHeyAlex%2FCornerSheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHeyAlex%2FCornerSheet/lists"}