recyclerView.addOnLayoutChangeListener(object : View.OnLayoutChangeListener {
override fun onLayoutChange(
v: View?,
left: Int,
top: Int,
right: Int,
bottom: Int,
oldLeft: Int,
oldTop: Int,
oldRight: Int,
oldBottom: Int
) {
// 当RecyclerView加载完毕时,移除监听器并自动点击第一个item
recyclerView.removeOnLayoutChangeListener(this)
recyclerView.findViewHolderForAdapterPosition(0)?.itemView?.performClick()
}
})