-
Notifications
You must be signed in to change notification settings - Fork 80
clicked list dialog API for Kotlin
vincent(朱志强) edited this page Sep 15, 2023
·
9 revisions
- 快速上手
- 详细API
SmartDialog.builderOfClickedList()
.items(listOf("回复", "转发", "私信回复", "复制", "举报"))
.itemClickedListener { dialog, clickedItem ->
dialog.dismiss()
SmartToast.classic().showInCenter(clickedItem.value)
}
.build(activity)
.show()
val handle = SmartDialog.builderOfClickedList()
.items(listOf("回复", "转发", "私信回复", "复制", "举报"))
.itemClickedListener { dialog, clickedItem ->
dialog.dismiss()
SmartToast.classic().showInCenter(clickedItem.value)
}
.build(activity)
//显示
handle.show()
//隐藏
handle.dismiss()
//是否正在显示
handle.isShowing()
SmartDialog.builderOfClickedList()
.title("title")
.build(activity)
.show()
或者,
SmartDialog.builderOfClickedList()
.titleResource(R.string.clicked_list_title)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
//颜色,大小(单位sp),是否加粗
.titleStyle(Color.BLUE,18f,false)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
.items(listOf("回复", "转发", "私信回复", "复制", "举报"))
.build(activity)
.show()
或者,
SmartDialog.builderOfClickedList()
.itemsResource(R.array.clicked_list_items)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
//颜色,大小(sp),是否加粗
.itemStyle(Color.parseColor("#333333"), 14f, false)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
.itemClickedListener { dialog, clickedItem ->
dialog.dismiss()
//do something with clickedItem
}
.build(activity)
.show()
SmartDialog.builderOfClickedList()
//默认为true,也就是常见的配置,dialog显示时,周围背景是灰色蒙层
.dimBehind(true)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
//默认为true
.cancelable(true)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
//默认false
.cancelOnTouchOutside(false)
.build(activity)
.show()
SmartDialog.builderOfClickedList()
.dialogShowListener {
//do something
}
.build(activity)
.show()
SmartDialog.builderOfClickedList()
.dialogDismissListener {
//do something
}
.build(activity)
.show()
SmartDialog.builderOfClickedList()
.dialogCancelListener {
//do something
}
.build(activity)
.show()
1