A powerful & customizable menu implementation for android.

Overview

BottomSheetMenu Release

A powerful & customizable menu implementation for android. It supports any level of nested menu structures along with custom header and footer views, and much more. Follow the steps below to import the library to your project. You will also find some sample codes.


Import

Add JitPack repository to your project level build.gradle file

...

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Or, in newer android projects, if you need to the add repository in settings.gradle file...

...

dependencyResolutionManagement {
    ...
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Finally, add this dependency to your app/module level build.gradle file

...

dependencies {
    ...
    implementation 'com.github.buggysofts-com:BottomSheetMenu:v1.0.4'
}

And you are done importing the library.


Sample codes

To create a minimal bottom sheet menu...

BottomSheetMenu bottomSheetMenu = new BottomSheetMenu(
  MainActivity.this,
  R.menu.sample_menu,
  new BottomSheetMenu.MenuItemClickListener() {
      @Override
      public void onClick(MenuItem item) {
          Toast.makeText(MainActivity.this, item.getTitle(), Toast.LENGTH_SHORT).show();
      }
  }
).show();

You can use methods that follow builder pattern to set properties of different components of the menu. For example the following code snippet sets background, divider, menu icon place holder (in case a menu item does not have an icon), expand icon (for indicating submenu of a menu item), a title and finally it shows the menu. There are other constructors where you can set these properties all at once.

bottomSheetMenu
  .menuBackground(
      AppCompatResources.getDrawable(
        MainActivity.this,
        R.drawable.menu_bg
      )
  )
  .dividerDrawable(
      BottomSheetMenu.getSystemDefaultDivider(
          MainActivity.this
      )
  )
  .menuIconPlaceHolder(
      AppCompatResources.getDrawable(
          MainActivity.this,
          R.drawable.ic_menu_item
      )
  )
  .menuExpandIcon(
      AppCompatResources.getDrawable(
          MainActivity.this,
         R.drawable.ic_arrow_forward
      )
  )
  .menuTitle("Property Setting Demo")
  .show();

You can obtain various default properties with the static methods available in the BottomSheetMenu class, for example BottomSheetMenu.getDefaultExpandIcon(context) returns the default drawable used as the expand icon. There are other methods for other properties as well. But you don't need to explicitly call these methods, these properties are set by default.


The menu supports custom header and footer views. You can select different header and footer views for different menu items, and also for initial call to show(). There may be many use cases for different header and footer views, such as description of the the submenu of a menu item can be placed as the footer view. See the code snippet below to know how you can define these selectors.

bottomSheetMenu
    .headerViewSelector(
        new BottomSheetMenu.ViewSelector() {
            @Nullable
            @Override
            public View getInitialView() {
                return getLayoutInflater().inflate(R.layout.initial_menu_header, null);
            }

            @Nullable
            @Override
            public View selectViewForItem(MenuItem item) {
                int itemId = item.getItemId();
                if (itemId == R.id.menu_image) {
                    return getLayoutInflater().inflate(R.layout.image_info_layout, null);
                } else if (itemId == R.id.menu_video) {
                    return getLayoutInflater().inflate(R.layout.video_info_layout, null);
                } else {
                    return getLayoutInflater().inflate(R.layout.raw_file_info_layout, null);
                }
            }
        }
    )
    .menuTitle("View Selecting Demo")
    .show();

The above code selects different views for different selected menu item(having submenu). Also, it selects an initial header view. Similarly, you can set footer views with footerViewSelector(...) method.


Images

Here are some example images of the menu containing a header and a footer view. The one above the top divider line is the header view, and the one below the bottom divider line is the footer view. You can select your desider header or footer views, or customize the menu styles and behaviours by following the topics above. Note, the styling applied to the menu does not apply on header and footer views, they are external views and you should apply necessary styling to them before using them in the menu.

Root menu: Root menu

Nested submenu: Nested submenu



Please share & rate the library if you find it useful.

Happy coding!

You might also like...
Android Satellite Menu
Android Satellite Menu

#Satellite Menu 'Path' has a very attractive menu sitting on the left bottom corner of the screen. Satellite Menu is the open version of this menu. Fo

An android custom view which looks like the menu in Path 2.0 (for iOS).

ArcMenu & RayMenu ArcMenu An android custom view which looks like the menu in Path 2.0 (for iOS). RayMenu About The user experience in Path 2.0 (for i

(UNMAINTAINED) An implemention of  Filter Menu concept for android
(UNMAINTAINED) An implemention of Filter Menu concept for android

FilterMenu This is a library project with a custom view that implements concept of Filter Menu(https://dribbble.com/shots/1956586-Filter-Menu) made by

Navigation menu for Android (based off Google+ app)
Navigation menu for Android (based off Google+ app)

RibbonMenu Navigation menu for Android (based on Google+ app). Usage Menus are created in xml as normal, adding text and an icon. In the layout you wa

Simple and easy to use circular menu widget for Android.
Simple and easy to use circular menu widget for Android.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

A multicard menu that can open and close with animation on android
A multicard menu that can open and close with animation on android

MultiCardMenu A multicard menu that can open and close with animation on android,require API level = 11 Demo ##Usage net.wujingchao.android.view.

An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.
An Android Library that allows users to pull down a menu and select different actions. It can be implemented inside ScrollView, GridView, ListView.

AndroidPullMenu AndroidPullMenu is an Open Source Android library that allows developers to easily create applications with pull menu. The aim of this

Android Overlay Menu
Android Overlay Menu

Overlay Menu Android Overlay Menu Demo: Installation: Add this dependency to your gradle script: compile 'it.sephiroth.android.library.overlaymenu:ove

A floating menu library for Android.
A floating menu library for Android.

Hover Hover is a floating menu implementation for Android. Goals The goals of Hover are to: Provide an easy-to-use, out-of-the-box floating menu imple

Releases(v1.1.0)
Owner
Nowrose Muhammad Ragib
Android Developer
Nowrose Muhammad Ragib
Floating Action Menu for Android. Inspired by the Google Plus floating menu

android-floating-action-menu Floating Action Menu for Android. Inspired by the Google Plus floating menu. Demo Setup The simplest way to use this libr

Alessandro Crugnola 242 Nov 10, 2022
Classic Power Menu is a Power Menu Replacement for Android 11+

Classic Power Menu is a Power Menu Replacement for Android 11+, with the main aim being restoring power menu options (Device Controls & Quick Access Wallet) on Android 12.

Kieron Quinn 385 Dec 31, 2022
:fire: The powerful and easiest way to implement modern material popup menu.

PowerMenu ?? The powerful and easiest way to implement modern material popup menu. PowerMenu can be fully customized and used for popup dialogs. Downl

Jaewoong Eum 1k Dec 29, 2022
💧 A customizable jetpack compose dropdown menu with cascade and animations

Dropdown ?? A customizable jetpack compose dropdown menu with cascade and animations. Who's using Dropdown? ?? Check out who's using Dropdown Include

Ranbir Singh 192 Jan 4, 2023
Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app)

Android SideNavigation Library Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app). Description The Go

Evgeny Shishkin 319 Nov 25, 2022
** A slide-out menu implementation, which allows users to navigate between views in your app.

MenuDrawer A slide-out menu implementation, which allows users to navigate between views in your app. Most commonly the menu is revealed by either dra

Simon Vig Therkildsen 2.6k Dec 8, 2022
Android-NewPopupMenu 3.9 0.0 Java is an android library to create popup menu with GoogleMusic app-like style.

Android-NewPopupMenu Android-NewPopupMenu is an android library to create popup menu with GoogleMusic app-like style. Requirements Tested with APIv4 H

u1aryz 159 Nov 21, 2022
an animated circular menu for Android

CircularFloatingActionMenu An animated, customizable circular floating menu for Android, inspired by Path app. Getting Started Requirements API >= 15

OÄŸuz Bilgener 2.7k Dec 24, 2022
A menu which can ... BOOM! - Android

BoomMenu 2.0.0 Comes Finally Approximately 8 months ago, I got an inspiration to creating something that can boom and show menu, which I named it Boom

Nightonke 5.8k Dec 27, 2022