當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessibilityNodeInfoCompat.setScrollable方法代碼示例

本文整理匯總了Java中android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.setScrollable方法的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityNodeInfoCompat.setScrollable方法的具體用法?Java AccessibilityNodeInfoCompat.setScrollable怎麽用?Java AccessibilityNodeInfoCompat.setScrollable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.view.accessibility.AccessibilityNodeInfoCompat的用法示例。


在下文中一共展示了AccessibilityNodeInfoCompat.setScrollable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(DirectionalViewpager.class.getName());
    info.setScrollable(canScroll());
    if (isHorizontal()) {
        if (canScrollHorizontally(1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
        if (canScrollHorizontally(-1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }
    } else {
        if (internalCanScrollVertically(1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
        if (internalCanScrollVertically(-1)) {
            info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:22,代碼來源:DirectionalViewpager.java

示例2: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    NestedScrollView nsvHost = (NestedScrollView) host;
    info.setClassName(ScrollView.class.getName());
    if (nsvHost.isEnabled()) {
        int scrollRange = nsvHost.getScrollRange();
        if (scrollRange > 0) {
            info.setScrollable(true);
            if (nsvHost.getScrollY() > 0) {
                info.addAction(8192);
            }
            if (nsvHost.getScrollY() < scrollRange) {
                info.addAction(4096);
            }
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:18,代碼來源:NestedScrollView.java

示例3: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(ViewPager.class.getName());
    info.setScrollable(canScroll());
    if (internalCanScrollVertically(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (internalCanScrollVertically(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:13,代碼來源:VerticalViewPager.java

示例4: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(VelocityViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:reyanshmishra,項目名稱:Rey-MusicPlayer,代碼行數:13,代碼來源:VelocityViewPager.java

示例5: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(XCCycleViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:ruiqiao2017,項目名稱:Renrentou,代碼行數:13,代碼來源:XCCycleViewPager.java

示例6: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(ViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:smallsilver,項目名稱:VerticalWebView,代碼行數:13,代碼來源:VerticalParentViewPager.java

示例7: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(YViewPager.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:12,代碼來源:YViewPager.java

示例8: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(YViewPagerNew.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:13,代碼來源:YViewPagerNew.java

示例9: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(YViewPagerOrigin.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:youngkaaa,項目名稱:YViewPagerDemo,代碼行數:13,代碼來源:YViewPagerOrigin.java

示例10: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(Recycler recycler, State state, AccessibilityNodeInfoCompat info) {
    if (ViewCompat.canScrollVertically(this.mRecyclerView, -1) || ViewCompat.canScrollHorizontally(this.mRecyclerView, -1)) {
        info.addAction(8192);
        info.setScrollable(true);
    }
    if (ViewCompat.canScrollVertically(this.mRecyclerView, 1) || ViewCompat.canScrollHorizontally(this.mRecyclerView, 1)) {
        info.addAction(4096);
        info.setScrollable(true);
    }
    info.setCollectionInfo(CollectionInfoCompat.obtain(getRowCountForAccessibility(recycler, state), getColumnCountForAccessibility(recycler, state), isLayoutHierarchical(recycler, state), getSelectionModeForAccessibility(recycler, state)));
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:12,代碼來源:RecyclerView.java

示例11: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
	super.onInitializeAccessibilityNodeInfo(host, info);
	info.setClassName(CustomViewPager.class.getName());
	info.setScrollable(canScroll());
	if (canScrollHorizontally(1)) {
		info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
	}
	if (canScrollHorizontally(-1)) {
		info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
	}
}
 
開發者ID:fengshihao,項目名稱:WebPager,代碼行數:13,代碼來源:CustomViewPager.java

示例12: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@SuppressLint("NewApi")
@Override
      public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
          super.onInitializeAccessibilityNodeInfo(host, info);
          info.setClassName(ViewPager.class.getName());
          info.setScrollable(canScroll());
          if (canScrollHorizontally(1)) {
              info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
          }
          if (canScrollHorizontally(-1)) {
              info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
          }
      }
 
開發者ID:benniaobuguai,項目名稱:android-project-gallery,代碼行數:14,代碼來源:ViewPagerCompat.java

示例13: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(ViewPagerEx.class.getName());
    info.setScrollable(canScroll());
    if (canScrollHorizontally(1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
    }
    if (canScrollHorizontally(-1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
    }
}
 
開發者ID:sega4revenge,項目名稱:Sega,代碼行數:13,代碼來源:ViewPagerEx.java

示例14: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfo(host, info);
    info.setClassName(ViewPager.class.getName());
    info.setScrollable(canScroll());
    if (ViewPager.this.canScrollHorizontally(1)) {
        info.addAction(4096);
    }
    if (ViewPager.this.canScrollHorizontally(-1)) {
        info.addAction(8192);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:12,代碼來源:ViewPager.java

示例15: onInitializeAccessibilityNodeInfo

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
/**
 * Called by the AccessibilityDelegate when the information about the current layout should
 * be populated.
 * <p>
 * Default implementation adds a {@link
 * android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat}.
 * <p>
 * You should override
 * {@link #getRowCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)},
 * {@link #getColumnCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)},
 * {@link #isLayoutHierarchical(RecyclerView.Recycler, RecyclerView.State)} and
 * {@link #getSelectionModeForAccessibility(RecyclerView.Recycler, RecyclerView.State)} for
 * more accurate accessibility information.
 *
 * @param recycler The Recycler that can be used to convert view positions into adapter
 *                 positions
 * @param state    The current state of RecyclerView
 * @param info     The info that should be filled by the LayoutManager
 * @see View#onInitializeAccessibilityNodeInfo(
 *android.view.accessibility.AccessibilityNodeInfo)
 * @see #getRowCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)
 * @see #getColumnCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)
 * @see #isLayoutHierarchical(RecyclerView.Recycler, RecyclerView.State)
 * @see #getSelectionModeForAccessibility(RecyclerView.Recycler, RecyclerView.State)
 */
public void onInitializeAccessibilityNodeInfo(Recycler recycler, State state,
        AccessibilityNodeInfoCompat info) {
    if (ViewCompat.canScrollVertically(mRecyclerView, -1) ||
            ViewCompat.canScrollHorizontally(mRecyclerView, -1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        info.setScrollable(true);
    }
    if (ViewCompat.canScrollVertically(mRecyclerView, 1) ||
            ViewCompat.canScrollHorizontally(mRecyclerView, 1)) {
        info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        info.setScrollable(true);
    }
    final AccessibilityNodeInfoCompat.CollectionInfoCompat collectionInfo
            = AccessibilityNodeInfoCompat.CollectionInfoCompat
            .obtain(getRowCountForAccessibility(recycler, state),
                    getColumnCountForAccessibility(recycler, state),
                    isLayoutHierarchical(recycler, state),
                    getSelectionModeForAccessibility(recycler, state));
    info.setCollectionInfo(collectionInfo);
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:46,代碼來源:RecyclerView.java


注:本文中的android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.setScrollable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。