Activity中配置
val expands = ArrayList<ExpandIcon>()
expands.add(ExpandIcon().setIcon(icon).setBackgroundTint(color).setTextLabel("text"))
ExpandManager.newBuilder()
.setSlide(Builder.Slide.BOTTOM)//Builder.Slide.TOP
.setExpandIcons(expands)
.motion(color,MainFloatActionIcon)
.bindTarget(target).build()
xml需要配置相应如下
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab"
android:layout_marginBottom="30dp"
android:layout_marginEnd="30dp"
android:layout_gravity="bottom|end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:tint = "@color/white"
app:srcCompat="@mipmap/baseline_home_white_24dp"
app:fabSize="auto"
android:tint="@color/white"
android:tintMode="src_in"
app:rippleColor="@color/colorAccent"
app:backgroundTintMode="src_in"
app:backgroundTint="@color/colorAccent"
/>
<com.showmethe.speeddiallib.expand.ExpandMenuChildLayout
android:id="@+id/crl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_behavior="com.showmethe.speeddiallib.expand.ExpandBottomBehavior"
app:layout_anchor="@id/fab"
>
</com.showmethe.speeddiallib.expand.ExpandMenuChildLayout>
implementation 'com.github.ShowMeThe:SpeedDial:0.03'
1、尚未优化使用方法
2、未添加非FloatActionButton的Beahavior
3、未添加右上角向下显示的功能
4、多个FloatActionButton适配
5、存在多次点击重复设置点击事件问题