Android 悬浮菜单(按钮) BoomMenu(样式大合集) - Go语言中文社区

Android 悬浮菜单(按钮) BoomMenu(样式大合集)


Android 悬浮菜单 BoomMenu(样式大合集)

 

一、样式大集合:(总有一款适合你)

 

 

BoomMenu 使用

一、Demo 效果演示:


二、导入引用

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

 

 

版权声明:本文来源CSDN,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/MLQ8087/article/details/106946848
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-06-28 02:11:10
  • 阅读 ( 1123 )
  • 分类:

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢