@@ -0,0 +1,1580 @@
+package com.masacre.components;%0A%0Aimport android.content.Context;%0Aimport android.support.annotation.NonNull;%0Aimport android.support.annotation.Nullable;%0Aimport android.support.v4.widget.SwipeRefreshLayout;%0Aimport android.util.AttributeSet;%0Aimport android.view.MotionEvent;%0A%0Apublic class PullDownSwipeRefreshLayout extends SwipeRefreshLayout %7B%0A%0A%09private PullDownListener pullDownListener;%0A%0A%09/**%0A%09 *%0A%09 * Inherited from %7B@link SwipeRefreshLayout#SwipeRefreshLayout(Context, AttributeSet)%7D%0A%09 *%0A%09 * @param context The Context the view is running in, through which it can%0A%09 *        access the current theme, resources, etc.%0A%09 * @param attrs The attributes of the XML tag that is inflating the view.%0A%09 */%0A%09public PullDownSwipeRefreshLayout(@NonNull final Context context, @Nullable final AttributeSet attrs) %7B%0A%09%09super(context, attrs);%0A%09%7D%0A%0A%09/**%0A%09 * Register a callback to be invoked when you pull down the swipe refresh layout%0A%09 * before calling %7B@link OnRefreshListener#onRefresh()%7D%0A%09 *%0A%09 * @param pullDownListener The callback that will run%0A%09 */%0A%09public void setPullDownListener(@Nullable final PullDownListener pullDownListener) %7B%0A%09%09this.pullDownListener = pullDownListener;%0A%09%7D%0A%0A%09@Override%0A%09public boolean onTouchEvent(final MotionEvent ev) %7B%0A%09%09if (ev.getAction() == ev.ACTION_UP && pullDownListener != null) %7B%0A%09%09%09pullDownListener.onPullDown();%0A%09%09%7D%0A%09%09return super.onTouchEvent(ev);%0A%09%7D%0A%0A%09public interface PullDownListener %7B%0A%09%09/**%0A%09%09 *%0A%09%09 * Called when you pull down the swipe refresh layout%0A%09%09 * before calling %7B@link OnRefreshListener#onRefresh()%7D%0A%09%09 *%0A%09%09 */%0A%09%09void onPullDown();%0A%09%7D%0A%7D%0A

Implement PullDownSwipeRefreshLayout