本文整理汇总了Java中android.support.v4.view.ViewCompat.isNestedScrollingEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ViewCompat.isNestedScrollingEnabled方法的具体用法?Java ViewCompat.isNestedScrollingEnabled怎么用?Java ViewCompat.isNestedScrollingEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.ViewCompat
的用法示例。
在下文中一共展示了ViewCompat.isNestedScrollingEnabled方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findScrollingChild
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@VisibleForTesting
View findScrollingChild(View view) {
if (ViewCompat.isNestedScrollingEnabled(view)) {
return view;
}
if (view instanceof ViewGroup) {
ViewGroup group = (ViewGroup) view;
for (int i = 0, count = group.getChildCount(); i < count; i++) {
View scrollingChild = findScrollingChild(group.getChildAt(i));
if (scrollingChild != null) {
return scrollingChild;
}
}
}
return null;
}
示例2: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean b) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
View target = mRefreshContent.getScrollableView();
if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView))
&& (target == null || ViewCompat.isNestedScrollingEnabled(target))) {
super.requestDisallowInterceptTouchEvent(b);
//} else {
// Nope.
}
}
示例3: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
/**
* 这段代码来自谷歌官方的 SwipeRefreshLayout
* 应用场景已经在英文注释中解释清楚
* 大部分第三方下拉刷新库都保留了这段代码,本库也不例外
*/
@Override
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
View target = mRefreshContent.getScrollableView();
if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView))
&& (target == null || ViewCompat.isNestedScrollingEnabled(target))) {
super.requestDisallowInterceptTouchEvent(disallowIntercept);
//} else {
// Nope.
}
}
示例4: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean b) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
if ((android.os.Build.VERSION.SDK_INT < 21 && mTargetView instanceof AbsListView)
|| (mTargetView != null && !ViewCompat.isNestedScrollingEnabled(mTargetView))) {
// Nope.
} else {
super.requestDisallowInterceptTouchEvent(b);
}
}
示例5: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean b) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
if ((android.os.Build.VERSION.SDK_INT < 21 && mTarget instanceof AbsListView)
|| (mTarget != null && !ViewCompat.isNestedScrollingEnabled(mTarget))) {
// Nope.
} else {
super.requestDisallowInterceptTouchEvent(b);
}
}
示例6: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean b) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
View target = mRefreshContent.getScrollableView();
if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView))
&& (target == null || ViewCompat.isNestedScrollingEnabled(target))) {
super.requestDisallowInterceptTouchEvent(b);
//} else {
// Nope.
}
}
示例7: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
public void requestDisallowInterceptTouchEvent(boolean b) {
if (VERSION.SDK_INT < 21 && (this.mTarget instanceof AbsListView)) {
return;
}
if (this.mTarget == null || ViewCompat.isNestedScrollingEnabled(this.mTarget)) {
super.requestDisallowInterceptTouchEvent(b);
}
}
示例8: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean b) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
//noinspection StatementWithEmptyBody
if ((android.os.Build.VERSION.SDK_INT < 21 && mTargetView instanceof AbsListView)
|| (mTargetView != null && !ViewCompat.isNestedScrollingEnabled(mTargetView))) {
// Nope.
} else {
super.requestDisallowInterceptTouchEvent(b);
}
}
示例9: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
// if this is a List < L or another view that doesn't support nested
// scrolling, ignore this request so that the vertical scroll event
// isn't stolen
if ((android.os.Build.VERSION.SDK_INT < 21 && mTarget instanceof AbsListView)
|| (mTarget != null && !ViewCompat.isNestedScrollingEnabled(mTarget))) {
// Nope.
} else {
super.requestDisallowInterceptTouchEvent(disallowIntercept);
}
}
示例10: requestDisallowInterceptTouchEvent
import android.support.v4.view.ViewCompat; //导入方法依赖的package包/类
@Override
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
if (mContentView != null && ((android.os.Build.VERSION.SDK_INT < 21 && mContentView instanceof AbsListView)
|| !ViewCompat.isNestedScrollingEnabled(mContentView))) {
// Nope.
} else {
super.requestDisallowInterceptTouchEvent(disallowIntercept);
}
}