whalemare / sheetmenu

Library for speedy implementation menu with BottomSheet
124 stars 18 forks source link

How to remove icon area? #5

Closed NunciosChums closed 7 years ago

NunciosChums commented 7 years ago

Thank you for make useful library.

I want show just only title in sheet. But icon area show always. Is possible remove icon area?

This is my code.

<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item
    android:id="@+id/menu_choose_photo"
    android:title="Choose"/>
  <item
    android:id="@+id/menu_remove_photo"
    android:title="remove"/>
</menu>
 SheetMenu.with(ProfileInputActivity.this)
        .setMenu(R.menu.choose_photo_bottom_sheet_menu)
        .setAutoCancel(false)
        .setClick(item -> {
          Logg.i("###", "|" + item.getTitle() + "|" + item.getItemId());
          return false;
        }).show();
whalemare commented 7 years ago

Hi. If you what show only title, you can try pass to sheet-menu builder menu without fields <item ... /> or just not call .setMenu() method, and set some title with method .setTitle("Title")

If you already have filled menu.xml, and you what that shows only title, soon I will make a special method for deleting items menu. I opened a issue here.

However, if I do not understand what you meant, you can always extend my classes and add what your need functionality. All classes if open and non-final, you can do this :)

whalemare commented 7 years ago

Wow. I finally realized)) Okay, I am try add what you what in next release 1.3 (16.06.2017)

NunciosChums commented 7 years ago

thank you very much :)

whalemare commented 7 years ago

Okay, you can do it with version compile 'com.github.whalemare:sheetmenu:1.3', where i add flag for remove icons from menu items. Look at README.md to find it) showIcons = false