当前位置: 首页>>代码示例>>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;未经允许,请勿转载。