本文整理了Java中android.support.v4.widget.SwipeRefreshLayout.onInterceptTouchEvent()
方法的一些代码示例,展示了SwipeRefreshLayout.onInterceptTouchEvent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。SwipeRefreshLayout.onInterceptTouchEvent()
方法的具体详情如下:
包路径:android.support.v4.widget.SwipeRefreshLayout
类名称:SwipeRefreshLayout
方法名:onInterceptTouchEvent
暂无
代码示例来源:origin: TheFinestArtist/FinestWebView-Android
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
return webView.getScrollY() <= scrollBuffer && super.onInterceptTouchEvent(event);
}
}
代码示例来源:origin: chentao0707/SimplifyReader
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
xDistance = yDistance = 0f;
xLast = ev.getX();
yLast = ev.getY();
break;
case MotionEvent.ACTION_MOVE:
final float curX = ev.getX();
final float curY = ev.getY();
xDistance += Math.abs(curX - xLast);
yDistance += Math.abs(curY - yLast);
xLast = curX;
yLast = curY;
if (xDistance > yDistance) {
return false;
}
}
return super.onInterceptTouchEvent(ev);
}
代码示例来源:origin: douban/rexxar-android
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mPrevX = MotionEvent.obtain(event)
.getX();
break;
case MotionEvent.ACTION_MOVE:
final float eventX = event.getX();
float xDiff = Math.abs(eventX - mPrevX);
if (xDiff > mTouchSlop) {
return false;
}
}
return super.onInterceptTouchEvent(event);
}
代码示例来源:origin: xiangzhihong/zhihu
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if(!isEnabled()) {
return false;
}
return super.onInterceptTouchEvent(ev);
}
代码示例来源:origin: gizwits/GOpenSource_AppKit_Android_AS
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mPrevX = event.getX();
break;
case MotionEvent.ACTION_MOVE:
final float eventX = event.getX();
float xDiff = Math.abs(eventX - mPrevX);
// Log.d("refresh" ,"move----" + eventX + " " + mPrevX + " " +
// mTouchSlop);
// 增加60的容差,让下拉刷新在竖直滑动时就可以触发
if (xDiff > mTouchSlop + 60) {
return false;
}
}
return super.onInterceptTouchEvent(event);
}
}
代码示例来源:origin: ShonLin/QuickDevFramework
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (listener != null && !listener.onInterceptTouchEvent(event)) {
return false;
}
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
mPrevX = MotionEvent.obtain(event).getX();
break;
case MotionEvent.ACTION_MOVE:
final float eventX = event.getX();
float xDiff = Math.abs(eventX - mPrevX);
if (xDiff > mTouchSlop) {
return false;
}
}
return super.onInterceptTouchEvent(event);
}
代码示例来源:origin: WangDaYeeeeee/GeometricWeather
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
boolean result = super.onInterceptTouchEvent(ev);
switch (ev.getAction()) {
case MotionEvent.ACTION_DOWN:
代码示例来源:origin: xkzh/yduoduo
return super.onInterceptTouchEvent(ev);
内容来源于网络,如有侵权,请联系作者删除!