0
我在RecyclerView上實現了自動滾動,使用smoothScrollToPosition顯示運行文本。它正在工作。如何禁用用戶在recyclerview(autoscroll)Android上觸摸或滾動?
public void autoScroll() {
final int speedScroll = 1000;
runnableRunningAds = new Runnable() {
@Override
public void run() {
rcRunningTextAds.smoothScrollToPosition(runningTextAdsAdapter.getItemCount());
blnRunningAdsIsRunning = true;
handlerRunningAds.postDelayed(this, speedScroll);
}
};
handlerRunningAds.postDelayed(runnableRunningAds, speedScroll);
}
問題是當用戶觸摸RecyclerView時,它停止滾動。我已經嘗試this,但它仍然無法正常工作。 RecyclerView仍停止滾動。
有什麼想法嗎? 謝謝。