从底部滑动菜单,就像在Dropbox中一样

时间:2015-11-12 10:29:11

标签: java android navigation-drawer dropbox slidingdrawer

有人知道,Dropbox在Android中使用了哪些菜单?我无法理解,它是SlidingDrawer,NavigationDrawer还是其他的。这样的事情对我来说非常有用。

1 个答案:

答案 0 :(得分:3)

It's a material BottomSheet. There aren't official android sdk to integrate it but Flipboard provides a library with some BottomSheet utils.

You can find it there: https://github.com/Flipboard/bottomsheet

And use:

MenuSheetView menuSheetView = new MenuSheetView(MenuActivity.this, MenuSheetView.MenuType.LIST, "Create...", new MenuSheetView.OnMenuItemClickListener() {
        @Override
        public boolean onMenuItemClick(MenuItem item) {
            if (bottomSheetLayout.isSheetShowing()) {
                bottomSheetLayout.dismissSheet();
            }
            // do something
            return true;
        }
    });
menuSheetView.inflateMenu(R.menu.create);
bottomSheetLayout.showWithSheetView(menuSheetView);