本文整理汇总了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()));
}
示例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));
}
}
示例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));
}
}
示例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);
}
示例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));
}
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}