AppDialog

object AppDialog

AppDialog:是一个通用的 Dialog 和 DialogFragment 组件库,支持任意样式和交互的个性化实现,帮助开发者快速构建灵活的提示对话框。

Author

Jenly

Follow me

Properties

Link copied to clipboard
const val DEFAULT_WIDTH_RATIO: Float = 0.85f

默认对话框宽度比例(基于屏幕的宽度)

Link copied to clipboard

点击监听器 - 解散对话框

Functions

Link copied to clipboard
fun createDialog(context: Context, contentView: View, @StyleRes styleId: Int = R.style.app_dialog, gravity: Int = Gravity.NO_GRAVITY, widthRatio: Float = DEFAULT_WIDTH_RATIO, x: Int = 0, y: Int = 0, horizontalMargin: Float = 0.0f, verticalMargin: Float = 0.0f, horizontalWeight: Float = 0.0f, verticalWeight: Float = 0.0f, cancelable: Boolean = true): Dialog

创建对话框

Link copied to clipboard

获取Dialog

Link copied to clipboard
fun showDialog(config: AppDialogConfig, cancelable: Boolean = true)
fun showDialog(context: Context, config: AppDialogConfig, cancelable: Boolean = true)
fun showDialog(context: Context, contentView: View, @StyleRes styleId: Int = R.style.app_dialog, gravity: Int = Gravity.NO_GRAVITY, widthRatio: Float = DEFAULT_WIDTH_RATIO, x: Int = 0, y: Int = 0, horizontalMargin: Float = 0.0f, verticalMargin: Float = 0.0f, horizontalWeight: Float = 0.0f, verticalWeight: Float = 0.0f, cancelable: Boolean = true)

显示对话框

Link copied to clipboard
fun showDialogFragment(fragmentManager: FragmentManager, dialogFragment: DialogFragment): String
fun showDialogFragment(fragmentManager: FragmentManager, dialogFragment: DialogFragment, tag: String)

显示DialogFragment