DataBindingComponent

object DataBindingComponent

Types

OnBindListener
Link copied to clipboard
interface OnBindListener
在绑定视图时可以用于Model来处理UI, 由于破坏视图和逻辑解耦的规则不是很建议使用

Functions

finishActivity
Link copied to clipboard
fun View.finishActivity(enabled: Boolean = true)
关闭当前界面
formatCNY
Link copied to clipboard
fun TextView.formatCNY(number: String?, unit: String?)
格式化RMB
fun TextView.formatCNY(number: Double?, prefix: String?, roundingMode: RoundingMode?)
格式化RMB
fun TextView.formatCNY(number: Long?, prefix: String?, roundingMode: RoundingMode?)
设置rmb,默认看做 "分" 处理(除以100)
hit
Link copied to clipboard
fun View.hit(throttle: Boolean = true)
自动将点击事件映射到Activity上
setActivated
Link copied to clipboard
fun View.setActivated(activated: Any?)
setBackgroundRes
Link copied to clipboard
fun View.setBackgroundRes(drawableId: Int)
setDateFromMillis
Link copied to clipboard
fun TextView.setDateFromMillis(milli: Long, format: String? = "yyyy-MM-dd")
根据时间产生格式化字符串
fun TextView.setDateFromMillis(milli: String?, format: String? = "yyyy-MM-dd")
根据时间产生格式化字符串
setDateFromSecond
Link copied to clipboard
fun TextView.setDateFromSecond(second: Long, format: String? = "yyyy-MM-dd")
根据时间产生格式化字符串
fun TextView.setDateFromSecond(second: String?, format: String? = "yyyy-MM-dd")
根据时间产生格式化字符串
setDel
Link copied to clipboard
fun TextView.setDel(isAdd: Boolean)
setElevation
Link copied to clipboard
fun View.setElevation(dp: Int)
fun CardView.setElevation(dp: Int)
setEnabled
Link copied to clipboard
fun View.setEnabled(enable: Any?)
setImageDrawable
Link copied to clipboard
fun ImageView.setImageDrawable(@DrawableRes() drawableId: Int)
fun TextView.setImageDrawable(drawableLeft: Int, drawableTop: Int, drawableRight: Int, drawableBottom: Int)
setOnBindListener
Link copied to clipboard
fun View.setOnBindListener(listener: DataBindingComponent.OnBindListener)
在绑定视图时可以用于Model来处理UI, 由于破坏视图和逻辑解耦的规则不是很建议使用
setPaddingHorizontal
Link copied to clipboard
fun View.setPaddingHorizontal(start: View?, end: View?)
setSelected
Link copied to clipboard
fun View.setSelected(selected: Any?)
setTextOfNumber
Link copied to clipboard
fun TextView.setTextOfNumber(number: Double)
fun TextView.setTextOfNumber(number: Float)
fun TextView.setTextOfNumber(number: Int)
fun TextView.setTextOfNumber(number: Long)
setThrottleClickListener
Link copied to clipboard
fun View.setThrottleClickListener(onClickListener: View.OnClickListener?)
防止暴力点击
setUrl
Link copied to clipboard
fun WebView.setUrl(url: String?)
setVisibleOrGone
Link copied to clipboard
fun View.setVisibleOrGone(isVisible: Any?)
隐藏控件
fun View.setVisibleOrGone(isVisible: Boolean)
隐藏控件
setVisibleOrInvisible
Link copied to clipboard
fun View.setVisibleOrInvisible(isVisible: Any?)
隐藏控件
fun View.setVisibleOrInvisible(isVisible: Boolean)
隐藏控件