지원 라이브러리에서 BottomSheetDialogFragment을 사용하고 있으며 라이브러리 그룹 내에서만 setupDialog()
함수를 사용해야한다고 경고합니다. 하지만이 함수는 대화 상자를 초기화하는 곳입니다 :BottomSheetDialogFragment setup 라이브러리 그룹에 대한 제한된 다이얼
@Override
public void setupDialog(final Dialog dialog, int style) {
super.setupDialog(dialog, style);
FragmentArgs.inject(this);
dialog.setOnShowListener(dialogINterface -> {
if(dialog.getWindow() != null) {
dialog.getWindow().setLayout(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.MATCH_PARENT);
}
});
BottomSheetStatisticsExportBinding binding = DataBindingUtil.inflate(
LayoutInflater.from(getContext()),
R.layout.bottom_sheet_statistics_export,
null,
false
);
View contentView = binding.getRoot();
dialog.setContentView(contentView);
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = params.getBehavior();
if(behavior != null && behavior instanceof BottomSheetBehavior)
((BottomSheetBehavior) behavior).setBottomSheetCallback(bottomSheetBehaviorCallback);
for (Export export : exports)
binding.flexbox.addView(new ExportItemView(getContext(), export));
}
경고는 내가 super 메서드를 사용하고 있기 때문입니다. 하지만 대신 내가 어떻게해야합니까? 내 코드를 다른 함수 (onCreateDialog()
, onResume()
...?)로 옮겨야합니까? super에 대한 호출을 제거해야합니까?
누구든지 알고 계십니까?