Android 菜单BoomMenu(悬浮按钮弹出菜单)

本文只用来做技术收藏具体内容请访问github。
https://github.com/Nightonke/BoomMenu

这里写图片描述

这里写图片描述

这里写图片描述

BoomMenu实现
一、导入jar
dependencies {

compile ‘com.nightonke:boommenu:x.y.z’

}

//x.y.z 为最新jar版本 
// https://github.com/Nightonke/BoomMenu

二、xml中添加布局

<
com.nightonke.boommenu.BoomMenuButton
android:id=”@+id/boom”
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentBottom=”true”
android:layout_alignParentRight=”true”
android:layout_alignParentEnd=”true”
android:layout_margin=”20dp”
app:boom_inActionBar=”false”
app:boom_button_color=”@color/colorPrimary”
app:boom_button_pressed_color=”@color/colorPrimary”
/>

三、代码逻辑

boomMenuButton = (BoomMenuButton)findViewById(R.id.boom);

@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);

boomMenuButton.init(
        subButtonDrawables, // 子按钮图片数组。不能空。
        subButtonTexts,     // 子按钮的文本数组,可以为空。
        subButtonColors,    // 子按钮的颜色数组,包括按下状态和正常状态。
        ButtonType.HAM,     // 按钮类型。
        BoomType.PARABOLA,  // The boom type.
        PlaceType.HAM_3_1,  // The place type.
        null,               // Ease type to move the sub buttons when showing.
        null,               // Ease type to scale the sub buttons when showing.
        null,               // Ease type to rotate the sub buttons when showing.
        null,               // Ease type to move the sub buttons when dismissing.
        null,               // Ease type to scale the sub buttons when dismissing.
        null,               // Ease type to rotate the sub buttons when dismissing.
        null                // Rotation degree.
); 

}

以上属性详细参数请查看源码
https://github.com/Nightonke/BoomMenu

部分参数设置demo图展示
这里写图片描述

  • 5
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

魑魅魍魉9527

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值