Package com.secoo.coobox.library.ktx.android.view

Functions

doOnClick
Link copied to clipboard
fun View?.doOnClick(onClickAction: ViewToUnit?)
在视图被点击时 执行操作
doOnDetachedFromWindow
Link copied to clipboard
fun View?.doOnDetachedFromWindow(runnable: KRunnable?)
在视图从 Window 分离时 执行操作
doOnViewAttachedToWindow
Link copied to clipboard
fun View?.doOnViewAttachedToWindow(runnable: KRunnable?)
在视图添加到 Window 时, 执行操作
getVisibleRect
Link copied to clipboard
fun View.getVisibleRect(): Rect
获取视图在全局的可见矩形
isActionCancel
Link copied to clipboard
fun MotionEvent?.isActionCancel(): Boolean
isActionDown
Link copied to clipboard
fun MotionEvent?.isActionDown(): Boolean
isActionUp
Link copied to clipboard
fun MotionEvent?.isActionUp(): Boolean
makeGone
Link copied to clipboard
fun View.makeGone()
视图变为gone
makeInvisible
Link copied to clipboard
fun View.makeInvisible()
视图变为不可见
makeVisible
Link copied to clipboard
fun View.makeVisible()
视图变为可见
removeSelf
Link copied to clipboard
fun View?.removeSelf()
将自己从父容器中移除
simulateClick
Link copied to clipboard
fun View?.simulateClick()
模拟视图的点击事件
fun View?.simulateClick(x: Float, y: Float)
模拟视图的点击事件(可以设置 x 和 y 坐标)

Properties

hostActivity
Link copied to clipboard
val View.hostActivity: Activity?
获取当前view所在的activity
hostFragmentActivity
Link copied to clipboard
val View.hostFragmentActivity: FragmentActivity?
获取当前View所在的FragmentActivity