{"id":13786835,"url":"https://github.com/robertlevonyan/custom-floating-action-button","last_synced_at":"2025-04-05T18:10:51.115Z","repository":{"id":44870815,"uuid":"84539275","full_name":"robertlevonyan/custom-floating-action-button","owner":"robertlevonyan","description":"This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button","archived":false,"fork":false,"pushed_at":"2023-10-30T14:27:27.000Z","size":1317,"stargazers_count":395,"open_issues_count":2,"forks_count":52,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-05-18T23:01:57.568Z","etag":null,"topics":["android","android-development","android-library","android-ui","button","floating-action-button","floating-button","floatingactionbutton","floatingactionmenu","floatingmenu","gradle","java","material-design","view"],"latest_commit_sha":null,"homepage":null,"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/robertlevonyan.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-03-10T08:48:36.000Z","updated_at":"2024-04-29T07:44:35.000Z","dependencies_parsed_at":"2024-01-31T16:36:34.062Z","dependency_job_id":"84d542a7-b35b-444f-8836-f24490ca16c7","html_url":"https://github.com/robertlevonyan/custom-floating-action-button","commit_stats":null,"previous_names":["robertlevonyan/customfloatingactionbutton"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fcustom-floating-action-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fcustom-floating-action-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fcustom-floating-action-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertlevonyan%2Fcustom-floating-action-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertlevonyan","download_url":"https://codeload.github.com/robertlevonyan/custom-floating-action-button/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247378149,"owners_count":20929297,"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-development","android-library","android-ui","button","floating-action-button","floating-button","floatingactionbutton","floatingactionmenu","floatingmenu","gradle","java","material-design","view"],"created_at":"2024-08-03T20:00:19.502Z","updated_at":"2025-04-05T18:10:51.089Z","avatar_url":"https://github.com/robertlevonyan.png","language":"Kotlin","readme":"# This library is no more supported!\n\n# Custom Floating Action Button\n\n|This view is for replacement of standard Floating Action Button from Google Support Library. It is easy to use, customizable and you can also add text to button|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab.png\"  width=\"900\" /\u003e|\n|----------------------------------------------------------------------------------------------|-----------|\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Custom%20Floating%20Action%20Button-yellow.svg?style=flat-square)](https://android-arsenal.com/details/1/6570) [![API](https://img.shields.io/badge/API-17%2B-yellow.svg?style=flat-square)](https://android-arsenal.com/api?level=14) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.robertlevonyan.view/CustomFloatingActionButton/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.robertlevonyan.view/CustomFloatingActionButton)\n## Setup\n\nAdd following line of code to your project level gradle file\n\n```kotlin\n  repositories {\n    mavenCentral()\n  }\n```\n\n#### Gradle:\n\nAdd following line of code to your module(app) level gradle file\n\n```groovy\n    implementation 'com.robertlevonyan.view:CustomFloatingActionButton:\u003cLATEST_VERSION\u003e'\n```\n\n#### Kotlin:\n\n```kotlin\n    implementation(\"com.robertlevonyan.view:CustomFloatingActionButton:$LATEST_VERSION\")\n```\n\n#### Maven:\n\n```xml\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.robertlevonyan.view\u003c/groupId\u003e\n    \u003cartifactId\u003eCustomFloatingActionButton\u003c/artifactId\u003e\n    \u003cversion\u003eLATEST_VERSION\u003c/version\u003e\n    \u003ctype\u003epom\u003c/type\u003e\n  \u003c/dependency\u003e\n```\n\n## Usage\n\n```xml\n  \u003ccom.robertlevonyan.views.customfloatingactionbutton.FloatingActionButton\n    android:id=\"@+id/custom_fab\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:layout_gravity=\"bottom|end\" /\u003e\n```\n\n|![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab_circle_2.jpg)|![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab_circle_text_2.jpg)|\n|----------------------|-----------------------------------------------------------------------------------------|\n|![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab_rounded_square_2.jpg)|![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab_rounded_square_text_2.jpg)|\n|![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab_square_2.jpg)|![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fab_square_text_2.jpg)|\n\n```xml\n\u003ccom.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionLayout\n        android:id=\"@+id/customFABL\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center_horizontal\"\u003e\n        \n        \u003c!--Add any layout here--\u003e\n        \n\u003c/com.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionLayout\u003e        \n```\n\n|Circle layout                          |Rounded square layout                   |Square layout                         |\n|---------------------------------------|----------------------------------------|--------------------------------------|\n|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fal_circle_2.jpg\" width=\"270\"\u003e|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fal_rounded_square_2.jpg\" width=\"270\"\u003e|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fal_square_2.jpg\" width=\"270\"\u003e|\n\n```xml\n\u003ccom.robertlevonyan.examples.customfloatingactionbutton.view.FloatingLayout\n        android:id=\"@+id/floating_layout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"\u003e\n        \n        \u003c!--\n        Add here only \n        com.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionButton \n        or android.support.design.widget.FloatingActionButton,\n        other views will be neglected by the layout\n        --\u003e\n        \n        \u003c!--Top view will be selected as a toggle for menu--\u003e\n        \u003ccom.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionButton \n        ... /\u003e\n        \n        \u003ccom.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionButton \n        ... /\u003e\n        \n        \u003ccom.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionButton \n        ... /\u003e\n        \n        \u003ccom.robertlevonyan.examples.customfloatingactionbutton.view.FloatingActionButton \n        ... /\u003e\n        \n        \u003candroid.support.design.widget.FloatingActionButton\n        ... /\u003e\n        \n\u003c/com.robertlevonyan.examples.customfloatingactionbutton.view.FloatingLayout\u003e\n```\n\n|Up                          |Down                   |Right                         |Left                         |\n|----------------------------|-----------------------|------------------------------|-----------------------------|\n|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fl_up_2.jpg\" width=\"200\"\u003e|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fl_down_2.jpg\" width=\"200\"\u003e|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fl_right_2.jpg\" width=\"200\"\u003e|\u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fl_left_2.jpg\" width=\"200\"\u003e|\n\n![](https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/fl_expand_collapse_2.gif)\n\n### Attributes\n\n|Custom Atributes        |Description                                                                              |\n|------------------------|-----------------------------------------------------------------------------------------|\n|`app:fabType`           |Visual style of Floating Action Button (values: circle (default), square, roundedSquare) |\n|`app:fabSizes`          |Sizes of Floating Action Button (values: normal (default), mini)                         |\n|`app:fabElevation`      |Change the elevation of view                                                             |\n|`app:fabColor`          |Custom color for Floating Action Button (default value is accent color)                  |\n|`app:fabIcon`           |Custom icon for Floating Action Button                                                   |\n|`app:fabIconColor`      |Custom color for icon                                                                    |\n|`app:fabRippleColor`    |Custom ripple color for button                                                           |\n|`app:fabIconPosition`   |Icon position for icon (values: start (default), top, end, bottom)                       |\n|`app:fabMenuStyle`      |Animation style for items appearing (values: popUp (default), popDown, popRight, popLeft)|\n|`android:gravity`       |Gravity of menu and items                                                                |\n|`app:fabAnimateMenu`    |Flag to animate menu toggle                                                              |\n|`app:fabAnimateDuration`|Flag to animate menu toggle                                                              |\n\nYou can set a text and customize it using 'android' namespace like on a normal Button or TextView.\n\n### Customizing from code\n\n```kotlin\n    floatingActionButton.fabType = FabType.FAB_TYPE_CIRCLE  /* Set button type FabType.FAB_TYPE_CIRCLE, \n                                                                               FabType.FAB_TYPE_SQUARE, \n                                                                               FabType.FAB_TYPE_ROUNDED_SQUARE */                           \n    floatingActionButton.fabSize = FabSize.FAB_SIZE_MINI    /* Set button size FabSize.FAB_SIZE_NORMAL, \n                                                                               FabSize.FAB_SIZE_MINI */\n    \n    floatingActionButton.fabElevation = 7f                  // Change elevation\n    floatingActionButton.fabColor = myFabColor              // Change background color\n    floatingActionButton.fabIcon = myFabIconDrawable        // Change icon\n    floatingActionButton.fabIconColor = myFabIconColor      // Change icon color\n    floatingActionButton.fabRippleColor = myFabRippleColor  // Change ripple color\n    floatingActionButton.fabIconPosition = FabIconPosition.FAB_ICON_START /* Change icon position                   \n                                                                               FabIconPosition.FAB_ICON_START, \n                                                                               FabIconPosition.FAB_ICON_TOP,\n                                                                               FabIconPosition.FAB_ICON_END, \n                                                                               FabIconPosition.FAB_ICON_BOTTOM */\n```\n\n```kotlin\n    floatingActionLayout.fabType = FabType.FAB_TYPE_CIRCLE  /* Set button type FabType.FAB_TYPE_CIRCLE, \n                                                                               FabType.FAB_TYPE_SQUARE, \n                                                                               FabType.FAB_TYPE_ROUNDED_SQUARE */     \n    floatingActionLayout.fabElevation = 7f                  // Change elevation\n    floatingActionLayout.fabColor = myFabColor              // Change background color\n    floatingActionButton.fabRippleColor = myFabRippleColor  // Change ripple color\n```\n\n```kotlin\n        floatingLayout.fabAnimationStyle = FabMenuAnimation.ANIMATION_POP_UP /* Set the pop animation of items \n                                                                               FabMenuAnimation.ANIMATION_POP_UP, \n                                                                               FabMenuAnimation.ANIMATION_POP_DOWN,\n                                                                               FabMenuAnimation.ANIMATION_POP_RIGHT,\n                                                                               FabMenuAnimation.ANIMATION_POP_LEFT */\n```\n### Setting Listeners\n\n```java\n    //Java\n    floatingLayout.setOnMenuExpandedListener(new FloatingLayout.OnMenuExpandedListener() {\n            @Override\n            public void onMenuExpanded() {\n                // Do stuff when expanded...\n            }\n\n            @Override\n            public void onMenuCollapsed() {\n                // Do stuff when collapsed...\n            }\n        });\n```\n\n```kotlin\n    //Kotlin\n    floatingLayout.doOnExpand {\n        // Do stuff when expanded...\n    }\n    \n    floatingLayout.doOnCollapse {\n        // Do stuff when collapsed...\n    }\n```\n## Versions\n\n### 3.1.1 - 3.1.4\n\nUpdate to Java 11\nSDK 31 ready\nMinor updates\n\n#### 3.1.0\n\nMigration to mavenCentral\n\n####  3.0.1 - 3.0.6\n\nSmall updates\n\n###  3.0.0\n\nNew version fully rewritten in Kotlin with several bugfixes\n\n####  2.1.0\n\nSome bug fixing\n\n###  2.0.0 - 2.0.4\n\nSecond version of library.\nTotaly rewritten.\nAdded Floating action layout and Floating layout\n\n###  1.0.0 - 1.0.3\n\nFirst version of library with some bugfixes\n\n## Contact\n\n- **Email**: me@robertlevonyan.com\n- **Website**: https://robertlevonyan.com/\n- **Medium**: https://medium.com/@RobertLevonyan\n- **Twitter**: https://twitter.com/@RobertLevonyan\n- **Facebook**: https://facebook.com/robert.levonyan\n- **Google Play**: https://play.google.com/store/apps/dev?id=5477562049350283357\n\n\u003ca href=\"https://www.buymeacoffee.com/robertlevonyan\"\u003e\n  \u003cimg src=\"https://github.com/robertlevonyan/custom-floating-action-button/blob/master/Images/coffee.jpeg\"  width=\"300\" /\u003e\n\u003c/a\u003e\n\n## Licence\n\n```\n    Custom Floating Action Button©\n    Copyright 2017 Robert Levonyan\n    Url: https://github.com/robertlevonyan/materialChipView\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    \n","funding_links":["https://www.buymeacoffee.com/robertlevonyan"],"categories":["Library"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertlevonyan%2Fcustom-floating-action-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertlevonyan%2Fcustom-floating-action-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertlevonyan%2Fcustom-floating-action-button/lists"}