title: Animate Between Visibility Modes For Menu Item
body: <p>I am trying to animate between the visibility mode for a menu.
  By default all menu items are hidden but when the user clicks on the edit button i want to show all the items with an animation.</p>
  
  <p>I have achieved the first part of changing the visibility of the menu items and that works fine but the animation part crashes the app.</p>
  
  <p>Here is my code.</p>
  
  <p>When user clicks on edit this is called.By default edit_mode is false.</p>
  
  <pre><code>if (!edit_mode) {
    edit_mode = true;
    supportInvalidateOptionsMenu();
  }
  </code></pre>
  
  <p>This is the menu code.</p>
  
  <pre><code>    @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.menu_add__custom, menu);
      return true;
  }
  
  @Override
  public boolean onPrepareOptionsMenu(Menu menu) {
  
      MenuItem photo = menu.findItem(R.id.photo);
      photo.setVisible(edit_mode);
      if (edit_mode)
          photo.getActionView().animate().alpha(1.0f);
  
      MenuItem date = menu.findItem(R.id.date);
      date.setVisible(edit_mode);
      if (edit_mode)
          date.getActionView().animate().alpha(1.0f);
  
      MenuItem done = menu.findItem(R.id.done);
      done.setVisible(edit_mode);
      if (edit_mode)
          done.getActionView().animate().alpha(1.0f);
  
      return edit_mode;
  }
  </code></pre>
  
  <p>menu.xml</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"&gt;
  &lt;item
      android:id="@+id/date"
      android:icon="@drawable/ic_event_white_24dp"
      android:orderInCategory="200"
      android:title="Date"
      app:showAsAction="ifRoom" /&gt;
  
  &lt;item
      android:id="@+id/done"
      android:icon="@drawable/ic_done_white_24dp"
      android:orderInCategory="300"
      android:title="Done"
      app:showAsAction="ifRoom" /&gt;
  
  &lt;item
      android:id="@+id/photo"
      android:icon="@drawable/ic_photo_white_24dp"
      android:orderInCategory="100"
      android:title="Done"
      app:showAsAction="ifRoom" /&gt;
  </code></pre>
  
  <p></p>