Created
September 26, 2018 02:38
-
-
Save kelvinc1024/e59ca62c41af71ec3781c7d1afe3ed5f to your computer and use it in GitHub Desktop.
CustomTargetScrollSwipeRefreshLayout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.support.v4.view.ViewCompat; | |
import android.util.AttributeSet; | |
import android.view.View; | |
public class CustomSwipeRefreshLayout extends SwipeRefreshLayout { | |
private View mScrollView; | |
public CustomSwipeRefreshLayout(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public void setScrollView(View view) { | |
this.mScrollView = view; | |
} | |
@Override | |
public boolean canChildScrollUp() { | |
if (mScrollView != null) { | |
return ViewCompat.canScrollVertically(mScrollView, -1); | |
} | |
return super.canChildScrollUp(); | |
} | |
public interface onEmbededScrollView { | |
void setScrollView(View view); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment