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


Java AccessibilityNodeInfoCompat.setCollectionItemInfo方法代碼示例

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


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

示例1: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
        RecyclerView.State state, View host, AccessibilityNodeInfoCompat info) {
    super.onInitializeAccessibilityNodeInfoForItem(recycler, state, host, info);

    ViewGroup.LayoutParams lp = host.getLayoutParams();
    AccessibilityNodeInfoCompat.CollectionItemInfoCompat cic = info.getCollectionItemInfo();
    if (!(lp instanceof LayoutParams) || (cic == null)) {
        return;
    }
    LayoutParams glp = (LayoutParams) lp;
    info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
            cic.getRowIndex() - getRowsNotForAccessibility(glp.getViewAdapterPosition()),
            cic.getRowSpan(),
            cic.getColumnIndex(),
            cic.getColumnSpan(),
            cic.isHeading(),
            cic.isSelected()));
}
 
開發者ID:enricocid,項目名稱:LaunchEnr,代碼行數:20,代碼來源:AllAppsGridAdapter.java

示例2: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
        RecyclerView.State state, View host, AccessibilityNodeInfoCompat info) {
    ViewGroup.LayoutParams lp = host.getLayoutParams();
    if (!(lp instanceof LayoutParams)) {
        super.onInitializeAccessibilityNodeInfoForItem(host, info);
        return;
    }
    LayoutParams glp = (LayoutParams) lp;
    int spanGroupIndex = getSpanGroupIndex(recycler, state, glp.getViewLayoutPosition());
    if (mOrientation == HORIZONTAL) {
        info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
                glp.getSpanIndex(), glp.getSpanSize(),
                spanGroupIndex, 1,
                mSpanCount > 1 && glp.getSpanSize() == mSpanCount, false));
    } else { // VERTICAL
        info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
                spanGroupIndex , 1,
                glp.getSpanIndex(), glp.getSpanSize(),
                mSpanCount > 1 && glp.getSpanSize() == mSpanCount, false));
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:23,代碼來源:GridLayoutManager.java

示例3: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
        RecyclerView.State state, View host, AccessibilityNodeInfoCompat info) {
    ViewGroup.LayoutParams lp = host.getLayoutParams();
    if (!(lp instanceof LayoutParams)) {
        super.onInitializeAccessibilityNodeInfoForItem(host, info);
        return;
    }
    LayoutParams sglp = (LayoutParams) lp;
    if (mOrientation == HORIZONTAL) {
        info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
                sglp.getSpanIndex(), sglp.mFullSpan ? mSpanCount : 1,
                -1, -1,
                sglp.mFullSpan, false));
    } else { // VERTICAL
        info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
                -1, -1,
                sglp.getSpanIndex(), sglp.mFullSpan ? mSpanCount : 1,
                sglp.mFullSpan, false));
    }
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:22,代碼來源:StaggeredGridLayoutManager.java

示例4: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfoForItem(Recycler recycler, State state, View host, AccessibilityNodeInfoCompat info) {
    android.view.ViewGroup.LayoutParams lp = host.getLayoutParams();
    if (lp instanceof LayoutParams) {
        LayoutParams glp = (LayoutParams) lp;
        int spanGroupIndex = getSpanGroupIndex(recycler, state, glp.getViewLayoutPosition());
        if (this.mOrientation == 0) {
            int spanIndex = glp.getSpanIndex();
            int spanSize = glp.getSpanSize();
            boolean z = this.mSpanCount > 1 && glp.getSpanSize() == this.mSpanCount;
            info.setCollectionItemInfo(CollectionItemInfoCompat.obtain(spanIndex, spanSize, spanGroupIndex, 1, z, false));
            return;
        }
        int spanIndex2 = glp.getSpanIndex();
        int spanSize2 = glp.getSpanSize();
        boolean z2 = this.mSpanCount > 1 && glp.getSpanSize() == this.mSpanCount;
        info.setCollectionItemInfo(CollectionItemInfoCompat.obtain(spanGroupIndex, 1, spanIndex2, spanSize2, z2, false));
        return;
    }
    super.onInitializeAccessibilityNodeInfoForItem(host, info);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:21,代碼來源:GridLayoutManager.java

示例5: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityNodeInfoForItem(RecyclerView.Recycler recycler,
                                                     RecyclerView.State state, View host, AccessibilityNodeInfoCompat info) {
    ViewGroup.LayoutParams lp = host.getLayoutParams();
    if (!(lp instanceof StrongGridLayoutManager.LayoutParams)) {
        super.onInitializeAccessibilityNodeInfoForItem(host, info);
        return;
    }
    StrongGridLayoutManager.LayoutParams glp = (StrongGridLayoutManager.LayoutParams) lp;
    int spanGroupIndex = getSpanGroupIndex(recycler, state, glp.getViewLayoutPosition());
    if (mOrientation == HORIZONTAL) {
        info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
                glp.getSpanIndex(), glp.getSpanSize(),
                spanGroupIndex, 1,
                mSpanCount > 1 && glp.getSpanSize() == mSpanCount, false));
    } else { // VERTICAL
        info.setCollectionItemInfo(AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
                spanGroupIndex , 1,
                glp.getSpanIndex(), glp.getSpanSize(),
                mSpanCount > 1 && glp.getSpanSize() == mSpanCount, false));
    }
}
 
開發者ID:qsyj,項目名稱:ShortcutMenu,代碼行數:23,代碼來源:StrongGridLayoutManager.java

示例6: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfoForItem(Recycler recycler, State state, View host, AccessibilityNodeInfoCompat info) {
    int rowIndexGuess;
    int columnIndexGuess;
    if (canScrollVertically()) {
        rowIndexGuess = getPosition(host);
    } else {
        rowIndexGuess = 0;
    }
    if (canScrollHorizontally()) {
        columnIndexGuess = getPosition(host);
    } else {
        columnIndexGuess = 0;
    }
    info.setCollectionItemInfo(CollectionItemInfoCompat.obtain(rowIndexGuess, 1, columnIndexGuess, 1, false, false));
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:16,代碼來源:RecyclerView.java

示例7: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityNodeInfoForItem(Recycler recycler, State state, View host, AccessibilityNodeInfoCompat info) {
    android.view.ViewGroup.LayoutParams lp = host.getLayoutParams();
    if (lp instanceof LayoutParams) {
        LayoutParams sglp = (LayoutParams) lp;
        if (this.mOrientation == 0) {
            info.setCollectionItemInfo(CollectionItemInfoCompat.obtain(sglp.getSpanIndex(), sglp.mFullSpan ? this.mSpanCount : 1, -1, -1, sglp.mFullSpan, false));
            return;
        } else {
            info.setCollectionItemInfo(CollectionItemInfoCompat.obtain(-1, -1, sglp.getSpanIndex(), sglp.mFullSpan ? this.mSpanCount : 1, sglp.mFullSpan, false));
            return;
        }
    }
    super.onInitializeAccessibilityNodeInfoForItem(host, info);
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:15,代碼來源:StaggeredGridLayoutManager.java

示例8: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
/**
 * Called by the AccessibilityDelegate when the accessibility information for a specific
 * item should be populated.
 * <p>
 * Default implementation adds basic positioning information about the item.
 *
 * @param recycler The Recycler that can be used to convert view positions into adapter
 *                 positions
 * @param state    The current state of RecyclerView
 * @param host     The child for which accessibility node info should be populated
 * @param info     The info to fill out about the item
 * @see android.widget.AbsListView#onInitializeAccessibilityNodeInfoForItem(View, int,
 * android.view.accessibility.AccessibilityNodeInfo)
 */
public void onInitializeAccessibilityNodeInfoForItem(Recycler recycler, State state,
        View host, AccessibilityNodeInfoCompat info) {
    int rowIndexGuess = canScrollVertically() ? getPosition(host) : 0;
    int columnIndexGuess = canScrollHorizontally() ? getPosition(host) : 0;
    final AccessibilityNodeInfoCompat.CollectionItemInfoCompat itemInfo
            = AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(rowIndexGuess, 1,
            columnIndexGuess, 1, false, false);
    info.setCollectionItemInfo(itemInfo);
}
 
開發者ID:MLNO,項目名稱:airgram,代碼行數:24,代碼來源:RecyclerView.java

示例9: onInitializeAccessibilityNodeInfoForItem

import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //導入方法依賴的package包/類
/**
 * Called by the AccessibilityDelegate when the accessibility information for a specific
 * item should be populated.
 * <p>
 * Default implementation adds basic positioning information about the item.
 *
 * @param recycler The Recycler that can be used to convert view positions into adapter
 *                 positions
 * @param state    The current state of RecyclerView
 * @param host     The child for which accessibility node info should be populated
 * @param info     The info to fill out about the item
 * @see android.widget.AbsListView#onInitializeAccessibilityNodeInfoForItem(View, int,
 * android.view.accessibility.AccessibilityNodeInfo)
 */
public void onInitializeAccessibilityNodeInfoForItem(Recycler recycler, State state,
                                                     View host, AccessibilityNodeInfoCompat info) {
    int rowIndexGuess = canScrollVertically() ? getPosition(host) : 0;
    int columnIndexGuess = canScrollHorizontally() ? getPosition(host) : 0;
    final AccessibilityNodeInfoCompat.CollectionItemInfoCompat itemInfo
            = AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(rowIndexGuess, 1,
            columnIndexGuess, 1, false, false);
    info.setCollectionItemInfo(itemInfo);
}
 
開發者ID:pooyafaroka,項目名稱:PlusGram,代碼行數:24,代碼來源:RecyclerView.java


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