Description:

The PullToRefreshView is based on the animation that was modified on SwipeRefreshLayout of the v4 library. SwipeRefreshLayout also has the PullToRefreshView method.Copy the code

Usage:

  1. XML add

        
    
            
    
        Copy the code

  2. Java Settings

  • Initialize the
 mRefreshView = (PullToRefreshView) findViewById(R.id.refreshView); mRefreshView.setColorSchemeColors(Color.RED,Color.BLUE); / / color mRefreshView setSmileStrokeWidth (8); / / set to draw the width of the smiling face of mRefreshView. SetSmileInterpolator (new LinearInterpolator ()); . / / smiling face animation rotation interpolator mRefreshView setSmileAnimationDuration (2000); / / set the smiling face of rotating animation time. / / set the drop-down refresh to monitor mRefreshView setOnRefreshListener (new PullToRefreshView. OnRefreshListener () {@ Override public  void onRefresh() { requestData(); // request data}});Copy the code

  • Refresh to complete
/ / request data complete mRefreshView setRefreshing (false);Copy the code

Blog: blog.csdn.net/qq_32464809…