Android 菜单BoomMenu(悬浮按钮弹出菜单)
2016-05-06 10:10
537 查看
本文只用来做技术收藏具体内容请访问github。
https://github.com/Nightonke/BoomMenu
![](http://img.blog.csdn.net/20160506095203438)
![](http://img.blog.csdn.net/20160506095228415)
![](http://img.blog.csdn.net/20160506095411658)
BoomMenu实现
一、导入jar
dependencies {
…
compile ‘com.nightonke:boommenu:x.y.z’
…
}
二、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);
}
以上属性详细参数请查看源码
https://github.com/Nightonke/BoomMenu
部分参数设置demo图展示
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图展示
相关文章推荐
- Unsupported major.minor version
- Android Studio 代码混淆
- AndroidLinearLayout:添加阴影边界LinearLayout - Android LinearLayout : Add border with shadow around a line
- Android运行的时候请求权限
- android程序---->android五子棋的实现
- Android中的Drawable资源
- android 保存文件的各种目录列表
- Android深入浅出之Audio第三部分Audio Policy[1]
- android第三方---->android智能机器人的使用
- Android深入浅出之Audio 第二部分 AudioFlinger分析
- Android深入浅出之Audio 第一部分 AudioTrack分析
- android图片轮播效果,RollViewPager的简单使用
- Android 彻底征服 ListView 一 (实用篇)
- Android之Handler探索
- Android Studio找不到R文件解决方法
- Android性能测试工具:Emmagee
- Android Performance Case Study
- android 基础 HashMap,TreeMap排序
- android studio下Maven管理android的库
- Android AutoLayout全新的适配方式 堪称适配终结者