Android fan menu
A simple widget that can be used to display menu's which can be animated in and out. The menu's can be animated in from behind a button like a FloatingActionButton to give an effect of a submenu or can be placed on the screen to work as menus.
compile 'com.bcgdv.asia.lib:fanmenu:1.4'string-array resource.Top Stories
Sports News
Technology News
Local News
@string/menu_top_stories
@string/menu_local
@string/menu_sports
@string/menu_techinteger-array resource.#C2185B
#E91E63
#F44336
#FF5722
@color/red_1
@color/red_2
@color/red_3
@color/red_4array resource. @drawable/bg_addgoal
@drawable/ic_cashout
@drawable/ic_invest
@drawable/ic_qrcodeandroid:background (Optional) the background drawable will fade in/out as the menu opens and closes. Can be null.app:fanMenuLabels (Required) a string-array from the resources folder. See above or the sample app for more.app:fanButtonColors (Required) a integer-array of colors for the buttons. Should be the same length as labels.app:fanLeftDrawable (Optional) an array of drawables should be the same length as labels.app:fanRememberMovedPosition (Optional) true|false if true, fan will not bounce back after being moved, unless a boundary angle is crossed. false by default.app:fanMinBounceBackAngle (Optional) int lower angle boundary, if this boundary is crossed when moving the fan, the fan will reset to original position. This is measured from the lowest (horizontal) button, "Top Stories" in our example.app:fanMaxBounceBackAngle (Optional) int upper angle boundary, if this boundary is crossed when moving the fan, the fan will reset to original position. This is measured from the lowest (horizontal) button, "Top Stories" in our example.app:fanEnableTouchMovement (Optional) true|false should the fan move when dragged. true by default.app:fanButtonHeight (Optional) dp the height of the buttons in DP. 32dp by default.app:fanAngleBetweenButtons (Optional) int the angle between the buttons. 10 degrees by default.app:fanAnimationDuration (Optional) int the time taken for the open and close animation. 200ms by default.final FanMenuButtons sub = (FanMenuButtons) findViewById(R.id.myFABSubmenu);
if (sub != null) {
sub.setOnFanButtonClickListener(new FanMenuButtons.OnFanClickListener() {
@Override
public void onFanButtonClicked(int index) {
}
});
sub.setOnFanAnimationListener(new FanMenuButtons.OnFanAnimationListener() {
@Override
public void onAnimateInStarted() {
}
@Override
public void onAnimateOutStarted() {
}
@Override
public void onAnimateInFinished() {
}
@Override
public void onAnimateOutFinished() {
}
});
}Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.No open issues yet, or sync has not completed.