{"id":18019914,"url":"https://github.com/vpaliy/expandable-action-button","last_synced_at":"2025-03-26T20:31:38.441Z","repository":{"id":37428119,"uuid":"87753622","full_name":"vpaliy/Expandable-Action-Button","owner":"vpaliy","description":"Contains an implementation of a button which transforms into a toolbar upon scroll. Based on Google's Material Design guidelines","archived":false,"fork":false,"pushed_at":"2017-07-27T16:33:05.000Z","size":32418,"stargazers_count":29,"open_issues_count":0,"forks_count":17,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-22T10:42:58.126Z","etag":null,"topics":["button-animation","button-widget","menu","toolbar-button"],"latest_commit_sha":null,"homepage":"","language":"Java","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/vpaliy.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":"2017-04-10T01:37:43.000Z","updated_at":"2024-05-14T08:54:01.000Z","dependencies_parsed_at":"2022-08-19T17:00:23.264Z","dependency_job_id":null,"html_url":"https://github.com/vpaliy/Expandable-Action-Button","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpaliy%2FExpandable-Action-Button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpaliy%2FExpandable-Action-Button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpaliy%2FExpandable-Action-Button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpaliy%2FExpandable-Action-Button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpaliy","download_url":"https://codeload.github.com/vpaliy/Expandable-Action-Button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245731489,"owners_count":20663198,"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":["button-animation","button-widget","menu","toolbar-button"],"created_at":"2024-10-30T05:12:57.258Z","updated_at":"2025-03-26T20:31:33.432Z","avatar_url":"https://github.com/vpaliy.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Expandable Action Button\n\n# How does it work? #\n\nThis sample shows transforming of floating action button into a toolbar upon press or from a toolbar upon scroll. The toolbar can contain different items, such as text, buttons, search fields, or any other items that would be useful at hand.\n\nMoreover, this sample has implmentation of FAB animation(fading in and out) when the user scrolls down or upwards.\n\nWhen the user presses the button, it goes down and inflates another layout which contains all important stuff. You can add listeners and work with the inflated layout as with plain `ViewGroup`.\n\n# Screenshot #\n![](https://github.com/vpaliyX/Expandable-Action-Button/blob/master/gifs/ezgif.com-video-to-gif.gif)\n\n## Video [example](https://www.youtube.com/watch?v=rfXL3zzjkHg\u0026feature=youtu.be) ##\n\n## This is based on Google's  Material Design guidelines:##\n\n![](https://github.com/vpaliyX/Expandable-Action-Button/blob/master/gifs/ezgif.com-video-to-gif%20(1).gif)\n![](https://github.com/vpaliyX/Expandable-Action-Button/blob/master/gifs/ezgif.com-video-to-gif%20(2).gif)\n\n\nIn order to imitate motion of the button, when it goes down or up, I used a curved motion concept, you can check it out in this [video](https://www.youtube.com/watch?v=JVGg4zPRHNE).\n\n## How to use the ExpandableButtonView? ##\n\nFirst of all, import the expandable-button module into your project, then follow these steps:\n\n1. Specify the view in your XML file:\n    ```xml\n     `\u003ccom.popularmovies.vpaliy.bottomtoolbar.ExpandableButtonView\n        android:id=\"@+id/expandableButton\"\n        android:layout_alignParentBottom=\"true\"\n        android:layout_alignParentRight=\"true\"\n        app:button_icon=\"@android:drawable/ic_menu_share\"\n        android:layout_alignParentEnd=\"true\"\n        android:layout_marginEnd=\"16dp\"\n        android:layout_marginRight=\"16dp\"\n        android:layout_marginBottom=\"16dp\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\u003e\n    \u003c/com.popularmovies.vpaliy.bottomtoolbar.ExpandableButtonView\u003e\n    ```\n    You need to specify the margins of the button.\n    Also note that `layout_width` and `layout_height` should be `wrap_content`.\u003cbr\u003e\n    You can specify the width and height of the button by using:\n     `app:button_width` and `app:button_height`\n    \n2. Then go ahead and add some buttons, for example:\n  ```java\n  \n     ButtomItem item=new ButtonItem.Builder(context)\n                        .setImageResource(R.id.image)\n                        .setClickListener(listener).build();\n     expandableButtonView.addItem(item);\n     \n  ```\n  Or \n \n  ```java\n    \n     expandableButtonView.addItem(new ButtonItem(context)\n                                  .setImageResource(R.id.image)\n                                  .setClickListener(listener));\n  ```\n  \n  The items which have been added to the `ExpandableButtonView` will always be in the center.\n  \n3. So far I have written only a listener for a `RecyclerView` so it works only with that.\n  \n  ```java\n     recyclerView.addOnScrollListener(new ScrollListener(expandableButtonView));\n  ```\n  However, there is a method `removeBottomToolbar` which folds the toolbar back, \n  so you use that every time you need to return to the button view.\n  \n  \n## How to download? ##\n\n### Step 1 ###  \n\nAdd it in your root build.gradle at the end of repositories:\n\n``` gradle\nallprojects {\n  repositories {\n     maven { url 'https://jitpack.io' }\n  }\n}\n  \n```\n### Step 2 ###\n\nAdd the dependency\n\n``` gradle\ndependencies {\n\tcompile 'com.github.vpaliyX:Expandable-Action-Button:v1.0'\n}\n\n```\nYou're good to go!\n\n\n## License ##\n\n``````\nMIT License\n\nCopyright (c) 2017 Vasyl Paliy\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%2Fvpaliy%2Fexpandable-action-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpaliy%2Fexpandable-action-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpaliy%2Fexpandable-action-button/lists"}