
* DataBinding E.G
*/
GlassExpandPopup(mContext, instructManager).apply {
contentWidth = 640
direction = GlassExpandPopup.Companion.Direction.RIGHT
val expandPopupBinding = DataBindingUtil.inflate<LayoutExpandPopupBinding>(
LayoutInflater.from(mContext),
R.layout.layout_expand_popup,
null, false
).apply {
btnTest.text = "测试按钮"
}
tipsText = "您可以通过“语音”或者“物理按键”进行选择"
show<LayoutExpandPopupBinding>(R.layout.layout_expand_popup).let {
it.btnTest.focus()
}
}
GlassExpandPopup DSL {
...
contentWidth = 640
...
}
GlassExpandPopup DSL {
...
contentHeight = 640
...
}
GlassExpandPopup DSL {
...
direction = GlassExpandPopup.Companion.Direction.CENTER
...
}
enum class Direction {
LEFT,
RIGHT,
CENTER,
TOP,
BOTTOM
}
GlassExpandPopup DSL {
...
tipsText = "您可以通过“语音”或者“物理按键”进行选择"
...
}
GlassExpandPopup DSL {
...
val expandPopupBinding = DataBindingUtil.inflate<LayoutExpandPopupBinding>(
LayoutInflater.from(mContext),
R.layout.layout_expand_popup,
null, false
).apply {
btnTest.text = "测试按钮"
}
...
}
GlassExpandPopup DSL {
...
show<LayoutExpandPopupBinding>(R.layout.layout_expand_popup).let {
it.btnTest.focus()
}
}