{"id":13642162,"url":"https://github.com/rjsvieira/floatingMenu","last_synced_at":"2025-04-20T16:30:25.624Z","repository":{"id":123814419,"uuid":"90240970","full_name":"rjsvieira/floatingMenu","owner":"rjsvieira","description":"An orbit-like action button","archived":false,"fork":false,"pushed_at":"2018-03-04T14:19:20.000Z","size":1805,"stargazers_count":305,"open_issues_count":8,"forks_count":42,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-08-03T01:25:51.232Z","etag":null,"topics":[],"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/rjsvieira.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}},"created_at":"2017-05-04T08:42:01.000Z","updated_at":"2024-05-09T02:24:09.000Z","dependencies_parsed_at":"2024-01-14T11:08:26.442Z","dependency_job_id":"57f90b0f-818c-48f2-89dc-906aedc6802a","html_url":"https://github.com/rjsvieira/floatingMenu","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsvieira%2FfloatingMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsvieira%2FfloatingMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsvieira%2FfloatingMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rjsvieira%2FfloatingMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rjsvieira","download_url":"https://codeload.github.com/rjsvieira/floatingMenu/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223832826,"owners_count":17210723,"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":[],"created_at":"2024-08-02T01:01:28.107Z","updated_at":"2024-11-09T13:30:35.979Z","avatar_url":"https://github.com/rjsvieira.png","language":"Java","readme":"# FloatingMenu\n\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-FloatingMenu-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/5697)\n![Current Version](https://img.shields.io/badge/Current%20Version-1.3.0-brightgreen.svg)\n[![](https://jitpack.io/v/rjsvieira/floatingMenu.svg)](https://jitpack.io/#rjsvieira/floatingMenu)\n![Minimum SDK](https://img.shields.io/badge/minSdkVersion%20-15-blue.svg)\n\n\u003cimg src=\"images/banner.png\"\u003e\n\n\u003ckbd\u003e\u003cimg src=\"https://github.com/rjsvieira/FloatingMenu/blob/master/images/radial_open_close.gif\" width=\"24%\" height=\"200px\"\u003e  \u003cimg src=\"https://github.com/rjsvieira/FloatingMenu/blob/master/images/radial_adapt.gif\" width=\"24%\" height=\"200px\"\u003e  \u003cimg src=\"https://github.com/rjsvieira/FloatingMenu/blob/master/images/expand_open_close.gif\" width=\"24%\" height=\"200px\"\u003e  \u003cimg src=\"https://github.com/rjsvieira/FloatingMenu/blob/master/images/expand_adapt.gif\" width=\"25%\" height=\"200px\"\u003e\u003c/kbd\u003e\n\n\n\u003ch2\u003eInclude in your project\u003c/h2\u003e\n\n\u003ch4\u003e In your root/build.gradle\u003c/h4\u003e\n\n```groovy\nallprojects {\n  repositories {\n  ...\n  maven { url 'https://jitpack.io' }\n  }\n}  \n```\n\n\u003ch4\u003e In your app/build.gradle\u003c/h4\u003e\n\n```groovy\ndependencies {\n  compile 'com.github.rjsvieira:floatingMenu:1.3.0'\n}\n```\n\n\n\u003ch2\u003eCustomization\u003c/h2\u003e\n\nThe FloatingMenuButton central image allows the user to give it any appearance he desires.\u003cbr\u003e\nThe user can also specify a ClickListener and add it to it. Thanks to the FloatingMenuButton's composite clickListener, it \u003cb\u003ewill not\u003c/b\u003e override the animation toggling.\u003cbr\u003e\u003cbr\u003e\nThe FloatingMenuButton \u003cb\u003eonly accepts FloatingSubButton children.\u003c/b\u003e \u003cbr\u003e\nLike the FloatingMenuButton, the FloatingSubButton can be configured to have a specific background and a ClickListener for interaction.\nThe following XML file specifies the example on the radial gifs : \n\u003cbr\u003e\n\u003cbr\u003e\n\n```xml\n\u003crjsv.floatingmenu.floatingmenubutton.FloatingMenuButton\n  android:id=\"@+id/my_floating_button\"\n  android:layout_width=\"40dp\"\n  android:layout_height=\"40dp\"\n  android:scaleType=\"centerInside\"\n  app:layout_constraintBottom_toBottomOf=\"parent\"\n  app:layout_constraintLeft_toLeftOf=\"parent\"\n  app:layout_constraintRight_toRightOf=\"parent\"\n  app:layout_constraintTop_toTopOf=\"parent\"\n  floatingMenuActionButton:animationType=\"radial\"\n  floatingMenuActionButton:dispositionEndAngle=\"360\"\n  floatingMenuActionButton:dispositionStartAngle=\"0\"\n  floatingMenuActionButton:subActionButtonRadius=\"100\"\u003e\n\n  \u003crjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton\n    android:id=\"@+id/sub_button_1\"\n    android:layout_width=\"50dp\"\n    android:layout_height=\"50dp\"\n    android:background=\"@drawable/one\" /\u003e\n\n  \u003crjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton\n    android:id=\"@+id/sub_button_2\"\n    android:layout_width=\"50dp\"\n    android:layout_height=\"50dp\"\n    android:background=\"@drawable/two\" /\u003e\n\n  \u003crjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton\n    android:id=\"@+id/sub_button_3\"\n    android:layout_width=\"50dp\"\n    android:layout_height=\"50dp\"\n    android:background=\"@drawable/three\" /\u003e\n\n  \u003crjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton\n    android:id=\"@+id/sub_button_4\"\n    android:layout_width=\"50dp\"\n    android:layout_height=\"50dp\"\n    android:background=\"@drawable/four\" /\u003e\n\n  \u003crjsv.floatingmenu.floatingmenubutton.subbutton.FloatingSubButton\n    android:id=\"@+id/sub_button_5\"\n    android:layout_width=\"50dp\"\n    android:layout_height=\"50dp\"\n    android:background=\"@drawable/five\" /\u003e\n\n\u003c/rjsv.floatingmenu.floatingmenubutton.FloatingMenuButton\u003e\n ```\n \n\n\u003ch2\u003e Adding a FloatingSubButton programmatically\u003c/h2\u003e\n\nYou can add a FloatingSubButton programmatically using the following lines of code. \n\n```java\nFloatingSubButton floatingSubButton = new FloatingSubButton(this); // create the button\nfloatingSubButton.setBackground(getDrawable(R.drawable.four)); // specify a custom background\n```\nAnd add it to the parent FloatingButton by either specifying layout parameters or assuming default parameters (as default, the layoutParameters for the first button on the list will be considered)\n```java\nfloatingButton.addFloatingSubButton(floatingSubButton, customLayoutParameters); \n```\nor \n```java\nfloatingButton.addFloatingSubButton(floatingSubButton); \n```\n \n \n\u003ch2\u003eAttribute configuration list\u003c/h2\u003e\n\n| Attribute        | Type           | Default  | Default |\n| ------------- |:-------------:| :-----| :------ |\n| startAngle           | int | The starting angle for button disposition | 0 |\n| endAngle             | int | The ending angle for button disposition   | 180 |\n| radius               | int | The distance between the central button and its children | 100(dp) |\n| movementStyle        | MovementStyle (Enumerator) | Configures whether the user can or not drag the FloatingMenu around | MovementStyle.FREE |\n| animationType        | AnimationType (Enumerator) | The open/close animation for FloatingMenuButton | AnimationType.EXPAND |\n| openingDuration      | int | The opening duration, in milliseconds, of the animation | 500 |\n| closingDuration      | int | The closing duration, in milliseconds, of the animation | 500 |\n| lagBetweenItems      | int | The lag duration between animating items. Affects only AnimationType.EXPAND | 100 |\n| openingInterpolator  | Interpolator | The opening interpolator. Allows different rythms on the animations| OvershootInterpolator |\n| closingInterpolator  | Interpolator | The closing interpolator. Allows different rythms on the animations | AccelerateDecelerateInterpolator |\n| shouldRotate         | boolean | Specify whether the items should rotate while animating. Available only in AnimationType.EXPAND | true |\n| shouldFade           | boolean | Specify whether the items should fade while animating. Available only in AnimationType.EXPAND | true |\n| shouldScale          | boolean | Specify whether the items should scale while animating. Available only in AnimationType.EXPAND | true |\n\n\u003ch2\u003eFloatingMenuButton State Change Listener\u003c/h2\u003e\n\nYou can track whether the FloatingMenuButton is in open or closed status\n\n```java\npublic interface FloatingMenuButtonStateChangeListener {\n\n    void onMenuOpened(FloatingMenuButton menu);\n\n    void onMenuClosed(FloatingMenuButton menu);\n\n}\n```\n\n\u003ch2\u003eFloatingMenuButton Animation Handler (Wrapper)\u003c/h2\u003e\n\nYou can configure the FloatingMenuButton programmatically rather than xml, specifying and settings its variables.\nConsider the following example :\n\n```java\nfloatingButton = (FloatingMenuButton) findViewById(R.id.my_floating_button);\nfloatingButton.setStartAngle(0)\n        .setEndAngle(360)\n        .setAnimationType(AnimationType.EXPAND)\n        .setMovementStyle(MovementStyle.STICKED_TO_SIDES);\nfloatingButton.getAnimationHandler()\n        .setOpeningAnimationDuration(500)\n        .setClosingAnimationDuration(200)\n        .setLagBetweenItems(0)\n        .setOpeningInterpolator(new FastOutSlowInInterpolator())\n        .setClosingInterpolator(new FastOutLinearInInterpolator())\n        .shouldFade(true)\n        .shouldScale(true)\n        .shouldRotate(false);\n```\n","funding_links":[],"categories":["浮动菜单"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjsvieira%2FfloatingMenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frjsvieira%2FfloatingMenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frjsvieira%2FfloatingMenu/lists"}