-
- All Implemented Interfaces:
-
android.content.DialogInterface,android.content.DialogInterface.OnCancelListener,android.content.DialogInterface.OnDismissListener,android.content.DialogInterface.OnShowListener,android.view.KeyEvent.Callback,android.view.View.OnCreateContextMenuListener,android.view.Window.Callback,androidx.activity.OnBackPressedDispatcherOwner,androidx.appcompat.app.AppCompatCallback,androidx.lifecycle.LifecycleOwner
public final class BaseDialog extends AppCompatDialog implements DialogInterface.OnShowListener, DialogInterface.OnCancelListener, DialogInterface.OnDismissListenerDialog基类封装
提供通用的功能和方法,用于简化子类的开发。子类可以根据需要重写这些方法来实现自定义的行为
Author: gaolei Date: 2023/11/10 周五 Version: 1.0 Contact: 1002304490@qq.com
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBaseDialog.Companionpublic interfaceBaseDialog.OnClickListenerpublic interfaceBaseDialog.OnShowListenerpublic interfaceBaseDialog.OnCancelListenerpublic interfaceBaseDialog.OnDismissListenerpublic classBaseDialog.AnimStyleDialog 动画样式
public classBaseDialog.Builderpublic final classBaseDialog.ShowListenerWrapper显示监听包装类
public final classBaseDialog.CancelListenerWrapper取消监听包装类
public final classBaseDialog.DismissListenerWrapper销毁监听包装类
-
Field Summary
Fields Modifier and Type Field Description private final OnBackPressedDispatcheronBackPressedDispatcher
-
Constructor Summary
Constructors Constructor Description BaseDialog(Context context, Integer themeResId)BaseDialog(Context context)
-
Method Summary
Modifier and Type Method Description final OnBackPressedDispatchergetOnBackPressedDispatcher()final UnitaddOnShowListener(BaseDialog.OnShowListener listener)添加一个取消监听器 final UnitaddOnCancelListener(BaseDialog.OnCancelListener listener)添加一个取消监听器 final UnitaddOnDismissListener(BaseDialog.OnDismissListener listener)添加一个销毁监听器 UnitonShow(DialogInterface dialog)DialogInterface.OnShowListener UnitonCancel(DialogInterface dialog)DialogInterface.OnCancelListener UnitonDismiss(DialogInterface dialog)DialogInterface.OnDismissListener final Booleanpost(Runnable r)延迟执行 final BooleanpostDelayed(Runnable r, Long delayMillis)延迟一段时间执行 final BooleanpostAtTime(Runnable r, Long uptimeMillis)在指定的时间执行 -
Methods inherited from class com.liecoder.framework.dialog.BaseDialog
addContentView, dismiss, dispatchKeyEvent, findViewById, getDelegate, getSupportActionBar, invalidateOptionsMenu, onCreate, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onWindowStartingSupportActionMode, setContentView, setContentView, setContentView, setTitle, setTitle, superDispatchKeyEvent, supportRequestWindowFeature -
Methods inherited from class androidx.appcompat.app.AppCompatDialog
getLifecycle, onBackPressed -
Methods inherited from class androidx.activity.ComponentDialog
cancel, closeOptionsMenu, create, dispatchGenericMotionEvent, dispatchKeyShortcutEvent, dispatchPopulateAccessibilityEvent, dispatchTouchEvent, dispatchTrackballEvent, getActionBar, getContext, getCurrentFocus, getLayoutInflater, getOnBackInvokedDispatcher, getOwnerActivity, getSearchEvent, getVolumeControlStream, getWindow, hide, isShowing, onActionModeFinished, onActionModeStarted, onAttachedToWindow, onContentChanged, onContextItemSelected, onContextMenuClosed, onCreateContextMenu, onCreateOptionsMenu, onCreatePanelMenu, onCreatePanelView, onDetachedFromWindow, onGenericMotionEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyShortcut, onKeyUp, onMenuItemSelected, onMenuOpened, onOptionsItemSelected, onOptionsMenuClosed, onPanelClosed, onPrepareOptionsMenu, onPreparePanel, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onTouchEvent, onTrackballEvent, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, openOptionsMenu, registerForContextMenu, requestWindowFeature, requireViewById, setCancelMessage, setCancelable, setCanceledOnTouchOutside, setDismissMessage, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setOnCancelListener, setOnDismissListener, setOnKeyListener, setOnShowListener, setOwnerActivity, setVolumeControlStream, show, takeKeyEvents, unregisterForContextMenu -
Methods inherited from class android.app.Dialog
onPointerCaptureChanged, onProvideKeyboardShortcuts -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
BaseDialog
BaseDialog(Context context, Integer themeResId)
-
BaseDialog
BaseDialog(Context context)
-
-
Method Detail
-
getOnBackPressedDispatcher
final OnBackPressedDispatcher getOnBackPressedDispatcher()
-
addOnShowListener
final Unit addOnShowListener(BaseDialog.OnShowListener listener)
添加一个取消监听器
- Parameters:
listener- 监听器对象
-
addOnCancelListener
final Unit addOnCancelListener(BaseDialog.OnCancelListener listener)
添加一个取消监听器
- Parameters:
listener- 监听器对象
-
addOnDismissListener
final Unit addOnDismissListener(BaseDialog.OnDismissListener listener)
添加一个销毁监听器
- Parameters:
listener- 监听器对象
-
postDelayed
final Boolean postDelayed(Runnable r, Long delayMillis)
延迟一段时间执行
-
postAtTime
final Boolean postAtTime(Runnable r, Long uptimeMillis)
在指定的时间执行
-
-
-
-