Teach you how to simply implement automatic scrolling in RecyclerView

When RecyclerView has too much content and exceeds the screen, you need to let it scroll and display the data on its own. Especially if some Android devices are at a high place or cannot be touched and clicked. In this case, it is particularly important to let it scroll and display the data on its own. There
are many solutions for automatic scrolling. The most common and simplest one at present is: inherit to RecyclerView, and implement the runnable method, and execute the scrollby (x, y) method every 10ms (delayTime), where delayTime and x ,The value of y determines the scrolling speed.

class AutoPollRecyclerView : RecyclerView {
   
    
    
    var autoPollTask //滚动线程
            : AutoPollTask? = null
    private var</

Guess you like

Origin blog.csdn.net/qq_25749749/article/details/131867512