SatelliteMenu
介绍:
一行代码搞定Android弧形卫星动画菜单,支持上下左右四个方向展开,支持自定义菜单图标大小,支持是否显示子菜单文字,支持不确定个数的菜单,可扩展性强
运行效果:
使用说明:
特性:
-
支持上下左右四个方向展开弧形菜单
-
支持扩展菜单,理论上多少个子菜单都可以
-
支持自定义菜单图标和子菜单图标
-
支持自定义菜单弹出的圆弧半径
-
支持设置菜单按钮和子菜单按钮大小
-
支持是否显示子菜单文字
使用
compile 'csy.menu.satellitemenulib:SatelliteMenu:1.0.3'
使用介绍:
xml属性 | 描述 | 值 |
---|---|---|
radius | 圆弧直径 | dimension |
menu_image_width | 菜单大小 | dimension |
menu_item_image_width | 子菜单大小 | dimension |
menu_item_text_size | 子菜单文字大小 | dimension |
menu_item_text_color | 子菜单文字颜色 | color |
menu_postion | 菜单展开方向 | left_top,right_top,left_bottom,right_bottom |
布局中使用
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvTitle"
android:background="@color/colorPrimary"
android:textColor="#Ffffff"
android:textSize="18sp"
android:gravity="center"
android:text="弧形动画菜单"
android:layout_width="match_parent"
android:layout_height="45dp" />
<Button
android:background="@color/colorPrimary"
android:padding="10dp"
android:layout_centerInParent="true"
android:textColor="#ffffff"
android:id="@+id/btText"
android:onClick="myOnclick"
android:gravity="center"
android:text="项目Github地址,喜欢就给个Star吧"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!--左上-->
<csy.menu.satellitemenulib.view.SatelliteMenu
android:layout_marginTop="45dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:menu_postion="left_top"
app:radius="150dp"
app:menu_item_image_width="50dp"
app:menu_image_width="45dp"
app:menu_item_text_size="4sp"
app:menu_item_text_color="@color/colorPrimary"
android:id="@+id/mSatelliteMenuLeftTop"/>
<!--右上-->
<csy.menu.satellitemenulib.view.SatelliteMenu
android:layout_marginTop="45dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:menu_postion="right_top"
app:radius="130dp"
app:menu_image_width="45dp"
app:menu_item_image_width="35dp"
android:id="@+id/mSatelliteMenuRightTop"/>
<!--左下-->
<csy.menu.satellitemenulib.view.SatelliteMenu
android:layout_width="match_parent"
android:layout_height="match_parent"
app:menu_postion="left_bottom"
app:radius="150dp"
app:menu_image_width="35dp"
app:menu_item_image_width="30dp"
android:id="@+id/mSatelliteMenuLeftBottom"/>
<!--右下-->
<csy.menu.satellitemenulib.view.SatelliteMenu
android:layout_width="match_parent"
android:layout_height="match_parent"
app:menu_postion="right_bottom"
app:radius="150dp"
app:menu_image_width="30dp"
app:menu_item_image_width="25dp"
android:id="@+id/mSatelliteMenuRightBottom"/>
</RelativeLayout>
已下载
0