SwipeRefreshLayout trigger programmatically

前端 未结 7 2141
独厮守ぢ
独厮守ぢ 2020-12-04 16:40

Is there any way to trigger the SwipeRefreshLayout programmatically? The animation should start and the onRefresh method from the OnRefreshLi

7条回答
  •  生来不讨喜
    2020-12-04 16:55

    binding.swipeRefreshLayout.setRefreshing(true); // show loading 
    binding.swipeRefreshLayout.post(this::updateUI); // call method
    binding.swipeRefreshLayout.setOnRefreshListener(this::updateUI); // call method
    

提交回复
热议问题