title: airbnb epoxy - how to insert new items
body: <p>I am having an issue in understanding how <a href="https://github.com/airbnb/epoxy" rel="nofollow noreferrer">epoxy</a> works in Android. There is also a tutorial <a href="https://medium.com/airbnb-engineering/epoxy-airbnbs-view-architecture-on-android-c3e1af150394#.iis3o5r2y" rel="nofollow noreferrer">here</a> </p>
  
  <p>imagine i have an adapter as follows:</p>
  
  <pre><code>    public class PhotoAdapter extends EpoxyAdapter {
    private final LoaderModel loaderModel = new LoaderModel();
  
    public PhotoAdapter() {
      models.add(new HeaderModel("My Photos"));
      models.add(loaderModel);
      notifyItemRangeInserted(0, 2);
    }
  
    public void addPhotos(Collection&lt;Photo&gt; photos) {
      for (Photo photo : photos) {
        int loaderPosition = models.size() - 1;
        models.add(loaderPosition, photo);
        notifyItemInserted(loaderPosition);
      }
    }
  }
  </code></pre>
  
  <p>This is as per the <a href="https://github.com/airbnb/epoxy#basic-usage" rel="nofollow noreferrer">example here</a></p>
  
  <p>How would i insert new items about "photos your friends like". So i'd like a new header to say "photos your friends like" and then i need to actually add the photos which i have stored in a model already.  </p>
  
  <p>would i just do the following to make it work:</p>
  
  <pre><code>public void addFriendsPhotos(Collection&lt;Photo&gt; photosOfFriends) {
  
  models.add(new HeaderModel("photos your friends like"));
   for (Photo photo : photosOfFriends) {
        int loaderPosition = models.size() - 1;
        models.add(loaderPosition, photo);
        notifyItemInserted(loaderPosition);
      }
    }
  </code></pre>
  
  <p>I am a little confused about the "models" class.  I thought for example there would be a PhotosModel class and a PhotoFriendsModel class etc. instead from the example i see a HeaderModel and LoaderModel. i thought there should be a model for every item row type.  Can someone explain. </p>
  
  <p>UPDATE:  </p>
  
  <p>let us say i have more information and its not photos. Lets say i have information about addresses where the photos were taken. so now after all the photos are displayed right below the photos i want to display a huge list of addresses where EACH photo was taken. Tell me how i would add the addresses list ?</p>