本文整理汇总了Java中com.google.samples.apps.iosched.util.UIUtils.setAccessibilityIgnore方法的典型用法代码示例。如果您正苦于以下问题:Java UIUtils.setAccessibilityIgnore方法的具体用法?Java UIUtils.setAccessibilityIgnore怎么用?Java UIUtils.setAccessibilityIgnore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.util.UIUtils
的用法示例。
在下文中一共展示了UIUtils.setAccessibilityIgnore方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newCollectionHeaderView
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
public View newCollectionHeaderView(Context context, int groupId, ViewGroup parent) {
View view = LayoutInflater.from(context)
.inflate(R.layout.explore_sessions_list_item_alt_header, parent, false);
// We do not want the divider/header to be read out by TalkBack, so
// inform the view that this is not important for accessibility.
UIUtils.setAccessibilityIgnore(view);
return view;
}
示例2: makeNavDrawerItem
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
private View makeNavDrawerItem(final int itemId, ViewGroup container) {
if (isSeparator(itemId)) {
View separator =
getLayoutInflater().inflate(R.layout.navdrawer_separator, container, false);
UIUtils.setAccessibilityIgnore(separator);
return separator;
}
NavDrawerItemView item = (NavDrawerItemView) getLayoutInflater().inflate(
R.layout.navdrawer_item, container, false);
item.setContent(NAVDRAWER_ICON_RES_ID[itemId], NAVDRAWER_TITLE_RES_ID[itemId]);
item.setActivated(getSelfNavDrawerItem() == itemId);
if (item.isActivated()) {
item.setContentDescription(getString(R.string.navdrawer_selected_menu_item_a11y_wrapper,
getString(NAVDRAWER_TITLE_RES_ID[itemId])));
} else {
item.setContentDescription(getString(R.string.navdrawer_menu_item_a11y_wrapper,
getString(NAVDRAWER_TITLE_RES_ID[itemId])));
}
item.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onNavDrawerItemClicked(itemId);
}
});
return item;
}
示例3: newCollectionItemView
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
public View newCollectionItemView(Context context, int groupId, ViewGroup parent) {
LayoutInflater inflater = LayoutInflater.from(context);
// First inflate the card container.
int containerLayoutId;
switch (groupId) {
case GROUP_ID_TOPIC_CARDS:
case GROUP_ID_THEME_CARDS:
case GROUP_ID_LIVE_STREAM_CARD:
containerLayoutId = R.layout.explore_io_topic_theme_livestream_card_container;
break;
default:
containerLayoutId = R.layout.explore_io_card_container;
break;
}
ViewGroup containerView = (ViewGroup)inflater.inflate(containerLayoutId, parent, false);
// Explicitly tell Accessibility to ignore the entire containerView since we add specific
// individual content descriptions on child Views.
UIUtils.setAccessibilityIgnore(containerView);
ViewGroup containerContents = (ViewGroup)containerView.findViewById(
R.id.explore_io_card_container_contents);
// Now inflate the header within the container cards.
int headerLayoutId = -1;
switch (groupId) {
case GROUP_ID_THEME_CARDS:
case GROUP_ID_TOPIC_CARDS:
case GROUP_ID_LIVE_STREAM_CARD:
headerLayoutId = R.layout.explore_io_card_header_with_button;
break;
}
// Inflate the specified number of items.
if (headerLayoutId > -1) {
inflater.inflate(headerLayoutId, containerContents, true);
}
// Now inflate the items within the container cards.
int itemLayoutId = -1;
int numItems = 1;
switch (groupId) {
case GROUP_ID_KEYNOTE_STREAM_CARD:
itemLayoutId = R.layout.explore_io_keynote_stream_item;
numItems = 1;
break;
case GROUP_ID_THEME_CARDS:
itemLayoutId = R.layout.explore_io_topic_theme_livestream_item;
numItems = ExploreModel.getThemeSessionLimit(getContext());
break;
case GROUP_ID_TOPIC_CARDS:
itemLayoutId = R.layout.explore_io_topic_theme_livestream_item;
numItems = ExploreModel.getTopicSessionLimit(getContext());
break;
case GROUP_ID_LIVE_STREAM_CARD:
itemLayoutId = R.layout.explore_io_topic_theme_livestream_item;
numItems = 3;
break;
case GROUP_ID_MESSAGE_CARDS:
itemLayoutId = R.layout.explore_io_message_card_item;
numItems = 1;
break;
}
// Inflate the specified number of items.
if (itemLayoutId > -1) {
for (int itemIndex = 0; itemIndex < numItems; itemIndex++) {
inflater.inflate(itemLayoutId, containerContents, true);
}
}
return containerView;
}
示例4: makeNavDrawerItem
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
private View makeNavDrawerItem(final int itemId, ViewGroup container) {
boolean selected = getSelfNavDrawerItem() == itemId;
int layoutToInflate = 0;
if (itemId == NAVDRAWER_ITEM_SEPARATOR) {
layoutToInflate = R.layout.navdrawer_separator;
} else if (itemId == NAVDRAWER_ITEM_SEPARATOR_SPECIAL) {
layoutToInflate = R.layout.navdrawer_separator;
} else {
layoutToInflate = R.layout.navdrawer_item;
}
View view = getLayoutInflater().inflate(layoutToInflate, container, false);
if (isSeparator(itemId)) {
// we are done
UIUtils.setAccessibilityIgnore(view);
return view;
}
ImageView iconView = (ImageView) view.findViewById(R.id.icon);
TextView titleView = (TextView) view.findViewById(R.id.title);
int iconId = itemId >= 0 && itemId < NAVDRAWER_ICON_RES_ID.length ?
NAVDRAWER_ICON_RES_ID[itemId] : 0;
int titleId = itemId >= 0 && itemId < NAVDRAWER_TITLE_RES_ID.length ?
NAVDRAWER_TITLE_RES_ID[itemId] : 0;
// set icon and text
iconView.setVisibility(iconId > 0 ? View.VISIBLE : View.GONE);
if (iconId > 0) {
iconView.setImageResource(iconId);
}
titleView.setText(getString(titleId));
formatNavDrawerItem(view, itemId, selected);
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onNavDrawerItemClicked(itemId);
}
});
return view;
}