// Path: ext-material/src/main/java/me/dkzwm/widget/srl/MaterialSmoothRefreshLayout.java
// public class MaterialSmoothRefreshLayout extends SmoothRefreshLayout {
//     protected OnUIPositionChangedListener mOnUIPositionChangedListener =
//             new OnUIPositionChangedListener() {
//                 int mLastMovingStatus = Constants.MOVING_CONTENT;
// 
//                 @Override
//                 public void onChanged(byte status, IIndicator indicator) {
//                     int movingStatus = indicator.getMovingStatus();
//                     if (movingStatus == Constants.MOVING_HEADER) {
//                         if (movingStatus != mLastMovingStatus) {
//                             setEnablePinRefreshViewWhileLoading(true);
//                         }
//                     } else {
//                         if (movingStatus != mLastMovingStatus) {
//                             setEnablePinContentView(false);
//                         }
//                     }
//                     mLastMovingStatus = movingStatus;
//                 }
//             };
// 
//     public MaterialSmoothRefreshLayout(Context context) {
//         super(context);
//     }
// 
//     public MaterialSmoothRefreshLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public MaterialSmoothRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
//         super(context, attrs, defStyle);
//     }
// 
//     @Override
//     protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
//         super.init(context, attrs, defStyleAttr, defStyleRes);
//         MaterialHeader header = new MaterialHeader(context);
//         header.setColorSchemeColors(new int[] {Color.RED, Color.BLUE, Color.GREEN, Color.BLACK});
//         header.setPadding(0, PixelUtl.dp2px(context, 25), 0, PixelUtl.dp2px(context, 20));
//         setHeaderView(header);
//         MaterialFooter footer = new MaterialFooter(context);
//         setFooterView(footer);
//     }
// 
//     /**
//      * Quickly set to material style. Before you change the configuration, you must know which
//      * parameters have been configured
//      */
//     public void materialStyle() {
//         setRatioOfFooterToRefresh(.95f);
//         setMaxMoveRatioOfFooter(1f);
//         setRatioToKeep(1f);
//         setMaxMoveRatioOfHeader(1.5f);
//         setEnablePinContentView(true);
//         setEnableKeepRefreshView(true);
//         if (mHeaderView instanceof MaterialHeader)
//             ((MaterialHeader) mHeaderView).doHookUIRefreshComplete(this);
//         if (!isDisabledLoadMore()) {
//             addOnUIPositionChangedListener(mOnUIPositionChangedListener);
//         }
//     }
// }
// 
// Path: core/src/main/java/me/dkzwm/widget/srl/RefreshingListenerAdapter.java
// public abstract class RefreshingListenerAdapter implements SmoothRefreshLayout.OnRefreshListener {
//     @Override
//     public void onRefreshing() {}
// 
//     @Override
//     public void onLoadingMore() {}
// }


import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import me.dkzwm.widget.srl.MaterialSmoothRefreshLayout;
import me.dkzwm.widget.srl.RefreshingListenerAdapter;
import me.dkzwm.widget.srl.sample.R;
package me.dkzwm.widget.srl.sample.ui;


/**
 * Created by dkzwm on 2017/6/1.
 *
 * @author dkzwm
 */
public class TestMaterialStyleActivity extends AppCompatActivity {
    private MaterialSmoothRefreshLayout mRefreshLayout;
    private TextView mTextView;
    private Handler mHandler = new Handler();
    private int mCount = 0;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_refresh);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setTitle(R.string.test_material_style);
        mTextView = findViewById(R.id.textView_test_refresh_desc);
        mRefreshLayout = findViewById(R.id.smoothRefreshLayout_test_refresh);
        mRefreshLayout.materialStyle();
        mRefreshLayout.setOnRefreshListener(
// Path: ext-material/src/main/java/me/dkzwm/widget/srl/MaterialSmoothRefreshLayout.java
// public class MaterialSmoothRefreshLayout extends SmoothRefreshLayout {
//     protected OnUIPositionChangedListener mOnUIPositionChangedListener =
//             new OnUIPositionChangedListener() {
//                 int mLastMovingStatus = Constants.MOVING_CONTENT;
// 
//                 @Override
//                 public void onChanged(byte status, IIndicator indicator) {
//                     int movingStatus = indicator.getMovingStatus();
//                     if (movingStatus == Constants.MOVING_HEADER) {
//                         if (movingStatus != mLastMovingStatus) {
//                             setEnablePinRefreshViewWhileLoading(true);
//                         }
//                     } else {
//                         if (movingStatus != mLastMovingStatus) {
//                             setEnablePinContentView(false);
//                         }
//                     }
//                     mLastMovingStatus = movingStatus;
//                 }
//             };
// 
//     public MaterialSmoothRefreshLayout(Context context) {
//         super(context);
//     }
// 
//     public MaterialSmoothRefreshLayout(Context context, AttributeSet attrs) {
//         super(context, attrs);
//     }
// 
//     public MaterialSmoothRefreshLayout(Context context, AttributeSet attrs, int defStyle) {
//         super(context, attrs, defStyle);
//     }
// 
//     @Override
//     protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
//         super.init(context, attrs, defStyleAttr, defStyleRes);
//         MaterialHeader header = new MaterialHeader(context);
//         header.setColorSchemeColors(new int[] {Color.RED, Color.BLUE, Color.GREEN, Color.BLACK});
//         header.setPadding(0, PixelUtl.dp2px(context, 25), 0, PixelUtl.dp2px(context, 20));
//         setHeaderView(header);
//         MaterialFooter footer = new MaterialFooter(context);
//         setFooterView(footer);
//     }
// 
//     /**
//      * Quickly set to material style. Before you change the configuration, you must know which
//      * parameters have been configured
//      */
//     public void materialStyle() {
//         setRatioOfFooterToRefresh(.95f);
//         setMaxMoveRatioOfFooter(1f);
//         setRatioToKeep(1f);
//         setMaxMoveRatioOfHeader(1.5f);
//         setEnablePinContentView(true);
//         setEnableKeepRefreshView(true);
//         if (mHeaderView instanceof MaterialHeader)
//             ((MaterialHeader) mHeaderView).doHookUIRefreshComplete(this);
//         if (!isDisabledLoadMore()) {
//             addOnUIPositionChangedListener(mOnUIPositionChangedListener);
//         }
//     }
// }
// 
// Path: core/src/main/java/me/dkzwm/widget/srl/RefreshingListenerAdapter.java
// public abstract class RefreshingListenerAdapter implements SmoothRefreshLayout.OnRefreshListener {
//     @Override
//     public void onRefreshing() {}
// 
//     @Override
//     public void onLoadingMore() {}
// }


// Path: app/src/main/java/me/dkzwm/widget/srl/sample/ui/TestMaterialStyleActivity.java
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.MenuItem;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import me.dkzwm.widget.srl.MaterialSmoothRefreshLayout;
import me.dkzwm.widget.srl.RefreshingListenerAdapter;
import me.dkzwm.widget.srl.sample.R;

package me.dkzwm.widget.srl.sample.ui;


/**
 * Created by dkzwm on 2017/6/1.
 *
 * @author dkzwm
 */
public class TestMaterialStyleActivity extends AppCompatActivity {
    private MaterialSmoothRefreshLayout mRefreshLayout;
    private TextView mTextView;
    private Handler mHandler = new Handler();
    private int mCount = 0;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test_refresh);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setDisplayShowHomeEnabled(true);
        getSupportActionBar().setTitle(R.string.test_material_style);
        mTextView = findViewById(R.id.textView_test_refresh_desc);
        mRefreshLayout = findViewById(R.id.smoothRefreshLayout_test_refresh);
        mRefreshLayout.materialStyle();
        mRefreshLayout.setOnRefreshListener(
                new RefreshingListenerAdapter() {