晶圆厂似乎有麻烦被测量两次(motionLayout需要这样做)
一个简单的解决方法是将fab包装在一个容器中
就像线性布局
在MotionLayout中放置LinearLayout
<LinearLayout
android:id="@+id/fabwrap"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="hello"
android:textColor="@color/white"
app:backgroundTint="#F00"
app:icon="@drawable/ic_battery"/>
</LinearLayout>