Android

ScrollView PullToRefreshLayout

그란. 2019. 4. 19. 16:47

 

 

gradle

implementation 'com.navercorp.pulltorefresh:library:3.2.0@aar'

 

ScrollView 를 

<com.handmark.pulltorefresh.library.PullToRefreshScrollView> 로 감싸기

 

 

binding.swipeRefresh.setOnRefreshListener(refreshView -> new Handler().postDelayed(() -> {
            getData();
            resetView();
            productAdapter.calTotal();
            hideKeyboard();
            refreshView.onRefreshComplete();
 }, 2000));