本文整理汇总了Java中android.support.v4.app.DialogFragment.getDialog方法的典型用法代码示例。如果您正苦于以下问题:Java DialogFragment.getDialog方法的具体用法?Java DialogFragment.getDialog怎么用?Java DialogFragment.getDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.app.DialogFragment
的用法示例。
在下文中一共展示了DialogFragment.getDialog方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dismissDialog
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@UiThread public static void dismissDialog(@NonNull DialogFragment dialogFragment, int duration, AnimatorListenerAdapter listenerAdapter) {
Dialog dialog = dialogFragment.getDialog();
if (dialog != null) {
if (dialog.getWindow() != null) {
View view = dialog.getWindow().getDecorView();
if (view != null) {
int centerX = view.getWidth() / 2;
int centerY = view.getHeight() / 2;
float radius = (float) Math.sqrt(view.getWidth() * view.getWidth() / 4 + view.getHeight() * view.getHeight() / 4);
view.post(() -> {
if (ViewCompat.isAttachedToWindow(view)) {
Animator animator = ViewAnimationUtils.createCircularReveal(view, centerX, centerY, radius, 0);
animator.setDuration(duration);
animator.addListener(listenerAdapter);
animator.start();
} else {
listenerAdapter.onAnimationEnd(null);
}
});
}
}
} else {
listenerAdapter.onAnimationEnd(null);
}
}
示例2: onDialogPositiveClick
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void onDialogPositiveClick(DialogFragment dialog) {
Dialog dialogView = dialog.getDialog();
EditText etTodoName = (EditText) dialogView.findViewById(R.id.etTodoName);
EditText etTodoDescription = (EditText) dialogView.findViewById(R.id.etTodoDescription);
ToDo toDo = new ToDo(etTodoName.getText().toString(), etTodoDescription.getText().toString());
if(toDo.getName().equals("")){
}
else {
toDos.add(toDo);
todoRecyclerAdapter.notifyDataSetChanged();
}
}
示例3: applyAfterShowing
import android.support.v4.app.DialogFragment; //导入方法依赖的package包/类
@Override
public void applyAfterShowing(DialogFragment dialogFragment) {
if (dialogFragment.getDialog() != null && dialogFragment.getDialog().getWindow() != null) {
dialogFragment.getDialog().getWindow().setWindowAnimations(mWindowAnimationsStyleRes);
}
}