-1

I need to set up my drawer menu to display two icons side by side per row, each icon being a different menu item as opposed to one item per row.

basically it looks like this:

| Home |

| Inventory |

| Work Orders |

I want it to look like this... but with icons instead of words

| Home | Inventory |

| W.O. | Time Clock |

I tried using linear layout, and horizontal alignment with weight, however this didn't work... Here is the current xml:

<?xml version="1.0" encoding="utf-8" ?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <group android:checkableBehavior="single">
    <item
      android:id="@+id/nav_home"
      android:title="Home" />
    <item
      android:id="@+id/nav_inventory"
      android:title="Inventory" />
    <item
      android:id="@+id/nav_item_inventory_worksheet"
      android:title="Item Inventory Worksheet" />
    <item
      android:id="@+id/nav_purchase_order_receiving"
      android:title="Purchase Order Receiving" />
    <item
      android:id="@+id/nav_picklist"
      android:title="Picklist" />
    <item
      android:id="@+id/nav_packing_slip"
      android:title="Packing Slips"/>
    <item
      android:id="@+id/nav_work_order"
      android:title="Work Orders"/>
    <item
      android:id="@+id/nav_timeclock"
      android:title="Time Clock"/>
    <item
      android:id="@+id/nav_settings"
      android:title="Settings" />
    <item
      android:id="@+id/nav_change_division"
      android:title="Change Division" />
    <item
      android:id="@+id/nav_logout"
      android:title="Logout"
      android:gravity="bottom" />
  </group>
</menu>

  • Here is a discussion you can refer to. https://stackoverflow.com/questions/30625280/how-to-create-a-simple-divider-in-the-new-navigationview – Junior Jiang Aug 06 '19 at 06:52
  • Possible duplicate of [How to create a simple divider in the new NavigationView?](https://stackoverflow.com/questions/30625280/how-to-create-a-simple-divider-in-the-new-navigationview) – Cheesebaron Aug 07 '19 at 12:41
  • This isn't really a duplicate as this question is in regards to how to specifically create a grid based navigation drawer. While I did find this option in that post, that post was not on this topic. – Jessie Lulham Aug 09 '19 at 20:58

1 Answers1

0

The answer was to set up a Relative Layout within the NavigationView which can then be customized with axml objects. While the AppMenu page will be hidden behind the Relative Layout setting app:menu="@menu/empty_menu" then having Empty_menu as a blank xml document.

ALSO if you decide you can have a setting to have a text based or icon based menu in this fashion which could easily be setup by setting the relative layout as hidden if the user setting is set this way