首选实现CoordinatorLayout.AttachedBehavior
然后创建一个自己的behavior,
import com.github.clans.fab.FloatingActionMenu;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.bottomsheet.BottomSheetBehavior;
import com.google.android.material.internal.DescendantOffsetUtils;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.view.ViewCompat;
/**
* 让第三方fam 支持嵌套动画。
*/
public class MyFloatingActionMenu extends FloatingActionMenu implements CoordinatorLayout.AttachedBehavior {
public MyFloatingActionMenu(Context context) {
super(context);
}
public MyFloatingActionMenu(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyFloatingActionMenu(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public static class Behavior extend
|