如何在点击浮动按钮后应用材质设计动画来显示自定义页脚菜单?
答案 0 :(得分:0)
首先创建一个类扩展BottomSheetDialogFragment
public class FooterSheetDialogFragment extends BottomSheetDialogFragment {
public static FooterSheetDialogFragment newInstance() {
return new FooterSheetDialogFragment();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.footer_al_dia, container, false);
return v;
}
}
第二:`
mFloatingButton = (FloatingActionButton) view.findViewById(R.id.floatingButtonAlDia);`
mFloatingButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
BottomSheetDialogFragment bsdFragment = FooterSheetDialogFragment.newInstance();
bsdFragment.show(FragmentAlDia.this.getFragmentManager(), "BSDialog");
}
}
);