// implementation 'com.google.android.material:material:1.2.0'
implementation this.rootProject.depsLibs.material
implementation 'me.luzhuo.java.android:lib_core:1.0.28-SNAPSHOT'
1. show(View)
private BottomSheetDialog dialog;
public void OnClick(View _) {
if(dialog != null) {
dialog.show();
return;
}
View view = LayoutInflater.from(this).inflate(R.layout.bottom_dialog_fragment, null, false);
dialog = BottomDialog.instance().show(this, view);
}
2. showMenu(String[])
private BottomSheetDialog dialog;
public void OnClick(View _) {
if(dialog != null) {
dialog.show();
return;
}
String[] menus = new String[]{"设置备注", "加入黑名单", "删除", "取消"};
String[] colors = new String[]{"#111111", "#111111", "#111111", "#F24343"};
dialog = BottomDialog.instance().showMenu(this, menus, colors, new BottomDialog.OnMenuItemClick() {
@Override
public void onItemClick(String[] menus, int position, String menu) {
dialog.dismiss();
Log.e(TAG, "" + Arrays.toString(menus) + " : " + position + " : " + menu);
}
});
}