{"id":23265979,"url":"https://github.com/marcelpinto/anchorsheetbehavior","last_synced_at":"2025-08-20T21:32:36.283Z","repository":{"id":52950484,"uuid":"59187354","full_name":"marcelpinto/AnchorSheetBehavior","owner":"marcelpinto","description":"Modification of the BottomSheetBehavior with Anchor state","archived":false,"fork":false,"pushed_at":"2021-10-17T12:37:48.000Z","size":534,"stargazers_count":111,"open_issues_count":2,"forks_count":21,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-11-07T18:20:37.290Z","etag":null,"topics":["anchor-state","android","bottomsheetbehavior"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/marcelpinto.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":"2016-05-19T08:17:38.000Z","updated_at":"2023-09-12T05:44:09.000Z","dependencies_parsed_at":"2022-09-01T04:11:24.446Z","dependency_job_id":null,"html_url":"https://github.com/marcelpinto/AnchorSheetBehavior","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelpinto%2FAnchorSheetBehavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelpinto%2FAnchorSheetBehavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelpinto%2FAnchorSheetBehavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcelpinto%2FAnchorSheetBehavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcelpinto","download_url":"https://codeload.github.com/marcelpinto/AnchorSheetBehavior/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230459106,"owners_count":18229374,"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":["anchor-state","android","bottomsheetbehavior"],"created_at":"2024-12-19T15:38:18.655Z","updated_at":"2024-12-19T15:38:20.412Z","avatar_url":"https://github.com/marcelpinto.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e **Disclaimer:** This library is no longer maintained use at your own risk.\n\n# AnchorSheetBehavior\n[![](https://jitpack.io/v/marcelpinto/AnchorSheetBehavior.svg)](https://jitpack.io/#marcelpinto/AnchorSheetBehavior)\n\n\nModification of the BottomSheetBehavior with Anchor state.\n\nFine more about it at [the medium blog post](https://medium.com/@marxallski/from-bottomsheetbehavior-to-anchorsheetbehavior-262ad7997286#.m02n38t27).\n\n![](anchorsheetbehavior_demo.gif.gif)\n\n# Integration \n\n```groovy\nallprojects {\n    repositories {\n        ...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\nAdd AnchorSheetBehavior dependency:\n```groovy\ndependencies {\n    compile 'com.github.marcelpinto:AnchorSheetBehavior:master-SNAPSHOT'\n}\n```\n\n# Usage\n\nThe behavior is an extension of the Android support design, thus the usage is the same.\nThe only addition is two extra states:\n* STATE_ANCHOR: push the bottom sheet to an anchor state defined by Anchor offset\n* STATE_FORCE_HIDE: force the bottom sheet to hide regardless of hideable flag\n\n``` java\n/**\n* Set the offset for the anchor state. Number between 0..1\n* i.e: Anchor the panel at 1/3 of the screen: setAnchorOffset(0.25)\n*\n* @param threshold {@link Float} from 0..1\n*/\npublic void setAnchorOffset(float threshold) {\n    this.mAnchorThreshold = threshold;\n    this.mAnchorOffset = (int) Math.max(mParentHeight * mAnchorThreshold, mMinOffset);\n}\n```\n\nFor more usage see [Android docs](https://developer.android.com/reference/android/support/design/widget/BottomSheetBehavior.html)\n\nLicense\n=======\n\n    Copyright 2015 Marcel Pintó Biescas\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelpinto%2Fanchorsheetbehavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcelpinto%2Fanchorsheetbehavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcelpinto%2Fanchorsheetbehavior/lists"}