Package 

Class BaseDialog

  • 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.OnDismissListener
                        

    Dialog基类封装

    提供通用的功能和方法,用于简化子类的开发。子类可以根据需要重写这些方法来实现自定义的行为

    Author: gaolei Date: 2023/11/10 周五 Version: 1.0 Contact: 1002304490@qq.com

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private final OnBackPressedDispatcher onBackPressedDispatcher
    • Method Summary

      Modifier and Type Method Description
      final OnBackPressedDispatcher getOnBackPressedDispatcher()
      final Unit addOnShowListener(BaseDialog.OnShowListener listener) 添加一个取消监听器
      final Unit addOnCancelListener(BaseDialog.OnCancelListener listener) 添加一个取消监听器
      final Unit addOnDismissListener(BaseDialog.OnDismissListener listener) 添加一个销毁监听器
      Unit onShow(DialogInterface dialog) DialogInterface.OnShowListener
      Unit onCancel(DialogInterface dialog) DialogInterface.OnCancelListener
      Unit onDismiss(DialogInterface dialog) DialogInterface.OnDismissListener
      final Boolean post(Runnable r) 延迟执行
      final Boolean postDelayed(Runnable r, Long delayMillis) 延迟一段时间执行
      final Boolean postAtTime(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