Adding ActionMenuView to place Navigation Buttons in Phimpme Android

In the previous version of Phimpme a user had to use the traditional popup view to navigate the image to the Edit Activity or to the share activity or move and copy the image. We implemented an additional toolbar on the bottom of the screen to have quick access to the buttons for the said features.

First implementation with popup view

In the first version, we were using popup view to navigate the image while viewing it from the gallery. This is a traditional but rather confusing way for any new user to figure how to choose the edit option or share the image from the gallery.                       

Adding ActionMenuView on the bottom of the screen

Let’s add action menu view to the xml file. To place the ActionMenuView at the bottom of the screen we set android:background to true. By default the color of the bottom action bar to be default color of the application. We want to make the color of the bottom bar to be transparent in order to see the image behind it. To set the color of the bottom bar translucent we append #59 with the color hex code. For example-  android:background=”#59000000”


Add items in the menu to be displayed on the bottom bar

Add menu.xml in res->menu. We need to add items in the menu.xml in order inflate in the bottom bar.

<menu xmlns:android=""

Inflating Bottom ActionMenuView

In your main activity get the id of the ActionMenuView and typecast it:

ActionMenuView bottomBar = (ActionMenuView) findViewById(;

Inflate the bottomBar with the menu.xml

Menu bottomMenu = bottomBar.getMenu();

getMenuInflater().inflate(, bottomMenu);

ActionMenuView shares the same onOptionItemSelected function with toolbar of the application. We will send the each item from the action menu bar onOptionItemSelected in a for loop. The loop will run till bottomMenu.size. This enables onClick of the navigation button.

for (int i = 0; i < bottomMenu.size(); i++){
             bottomMenu.getItem(i).setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener(){
                 public boolean onMenuItemClick(MenuItem item) {
                     return onOptionsItemSelected(item);


While using two toolbars on the application we use ActionMenuView for the second toolbar which is at the bottom. ActionMenuView evenly spaces the button on the bottom toolbar.