本文整理匯總了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);
}
}