本文整理汇总了Java中com.flipboard.bottomsheet.commons.MenuSheetView.OnMenuItemClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java MenuSheetView.OnMenuItemClickListener方法的具体用法?Java MenuSheetView.OnMenuItemClickListener怎么用?Java MenuSheetView.OnMenuItemClickListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.flipboard.bottomsheet.commons.MenuSheetView
的用法示例。
在下文中一共展示了MenuSheetView.OnMenuItemClickListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showSortBottomDialog
import com.flipboard.bottomsheet.commons.MenuSheetView; //导入方法依赖的package包/类
private void showSortBottomDialog() {
MenuSheetView menuSheetView = new MenuSheetView(this, MenuSheetView.MenuType.LIST, R.string.title_sort_by, new MenuSheetView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (bslMenu.isSheetShowing()) {
bslMenu.dismissSheet();
}
if (item.getItemId() == R.id.action_sort_by_published_date &&
!sortType.equalsIgnoreCase(BloggerManager.SORT_PUBLISHED_DATE)) {
changeFeedSortType(BloggerManager.SORT_PUBLISHED_DATE);
} else if (item.getItemId() == R.id.action_sort_by_updated_date &&
!sortType.equalsIgnoreCase(BloggerManager.SORT_UPDATED_DATE)) {
changeFeedSortType(BloggerManager.SORT_UPDATED_DATE);
}
return true;
}
});
menuSheetView.inflateMenu(R.menu.menu_post_list);
bslMenu.showWithSheetView(menuSheetView);
}
示例2: showMenuSheet
import com.flipboard.bottomsheet.commons.MenuSheetView; //导入方法依赖的package包/类
private void showMenuSheet(final MenuSheetView.MenuType menuType) {
MenuSheetView menuSheetView =
new MenuSheetView(MenuActivity.this, menuType, "Create...", new MenuSheetView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Toast.makeText(MenuActivity.this, item.getTitle(), Toast.LENGTH_SHORT).show();
if (bottomSheetLayout.isSheetShowing()) {
bottomSheetLayout.dismissSheet();
}
if (item.getItemId() == R.id.reopen) {
showMenuSheet(menuType == MenuSheetView.MenuType.LIST ? MenuSheetView.MenuType.GRID : MenuSheetView.MenuType.LIST);
}
return true;
}
});
menuSheetView.inflateMenu(R.menu.create);
bottomSheetLayout.showWithSheetView(menuSheetView);
}
示例3: pickTags
import com.flipboard.bottomsheet.commons.MenuSheetView; //导入方法依赖的package包/类
public static void pickTags (final BottomSheetLayout layout
, final OnTagSelectedListener listener
, final List<Tag> tags) {
MenuSheetView view = new MenuSheetView(layout.getContext()
, MenuSheetView.MenuType.GRID
, R.string.title_tags
, new MenuSheetView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == ID_ALL) {
listener.onSpecialSelected(item.getItemId());
layout.dismissSheet();
return true;
}
listener.onSelected(tags.get(item.getItemId()));
layout.dismissSheet();
return true;
}
});
view.getMenu().add(0, ID_ALL, 0, R.string.filter_all)
.setIcon(R.drawable.ic_apps_black_24dp);
for (int i = 0; i < tags.size(); i ++) {
Tag tag = tags.get(i);
// TODO: Icon load
view.getMenu().add(0, i, 0, tag.getName())
.setIcon(new IconBuilder(layout.getContext(), tag.getColor()).build());
}
view.updateMenu();
layout.showWithSheetView(view);
}
示例4: pickTags
import com.flipboard.bottomsheet.commons.MenuSheetView; //导入方法依赖的package包/类
public static void pickTags (final BottomSheetLayout layout
, final OnTagSelectedListener listener
, final List<ForumNav.Forum> forumList) {
MenuSheetView view = new MenuSheetView(layout.getContext()
, MenuSheetView.MenuType.GRID
, R.string.title_forums
, new MenuSheetView.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == ID_ALL) {
listener.onSpecialSelected(item.getItemId());
layout.dismissSheet();
return true;
}
listener.onSelected(forumList.get(item.getItemId()));
layout.dismissSheet();
return true;
}
});
// DZ BBS Not support "All" tag.
/*
view.getMenu().add(0, ID_ALL, 0, R.string.filter_all)
.setIcon(R.drawable.ic_apps_black_24dp);
*/
for (int i = 0; i < forumList.size(); i ++) {
ForumNav.Forum forum = forumList.get(i);
// TODO: Icon load
view.getMenu().add(0, i, 0, forum.getName());
}
view.updateMenu();
layout.showWithSheetView(view);
}