title: Expand/Collapse groups in expandable recyclerview
body: <p>I am using <a href="https://github.com/thoughtbot/expandable-recycler-view" rel="nofollow noreferrer">this</a> library to implement an expandable <code>RecyclerView</code>. I have implemented it, and it works fine. But what I want is the group should only expand if I click a particular view. Right now what is happening is if I click anywhere on the <code>RecyclerView</code> item, the group expands. I have an <code>ImageView</code>, and when I click that ImageView, only then the group should expand. How can I implement this?</p>
  
  <p><strong>RecyclerViewAdapter.java:</strong></p>
  
  <pre><code>public class GenresSongAdapter extends ExpandableRecyclerViewAdapter&lt;SongDetailsViewHolder, OptionViewHolder&gt; {
      private Context mContext;
      public GenresSongAdapter(Context context, List&lt;? extends ExpandableGroup&gt; groups) {
          super(groups);
          mContext = context;
      }
  
      @Override
      public SongDetailsViewHolder onCreateGroupViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.row_song, parent, false);
          return new SongDetailsViewHolder(view);
      }
  
      @Override
      public OptionViewHolder onCreateChildViewHolder(ViewGroup parent, int viewType) {
          View view = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.row_artists, parent, false);
          return new OptionViewHolder(view);
      }
  
      @Override
      public void onBindChildViewHolder(OptionViewHolder holder, int flatPosition, ExpandableGroup group, int childIndex) {
          ArtistsModel artistsModel = (ArtistsModel) group.getItems().get(childIndex);
          holder.ArtistText.setText(artistsModel.getArtistsName());
      }
  
      @Override
      public void onBindGroupViewHolder(SongDetailsViewHolder holder, int flatPosition, ExpandableGroup songInfo) {
          holder.setSongDetails(mContext, songInfo);
      }
  }
  </code></pre>
  
  <p><strong>SongDetailsViewHolder.java</strong></p>
  
  <pre><code>class SongDetailsViewHolder extends GroupViewHolder {
      public TextView songName;
      public TextView artistName;
      public TextView duration;
      public ImageView iv_artwork;
  
      public SongDetailsViewHolder(View itemView) {
          super(itemView);
          songName = (TextView) itemView.findViewById(R.id.SongName);
          artistName = (TextView) itemView.findViewById(R.id.ArtistName);
          duration = (TextView) itemView.findViewById(R.id.duration);
          iv_artwork = (ImageView) itemView.findViewById(R.id.iv_artwork);
      }
  
      public void setSongDetails(Context mContext, ExpandableGroup songInfo) {
          if (songInfo instanceof SongInfo) {
              songName.setText(songInfo.getTitle());
              artistName.setText(((SongInfo) songInfo).getArtistName());
              duration.setText(((SongInfo) songInfo).getSongDuration());
              Picasso.with(mContext).load(((SongInfo) songInfo).getImageURI()).placeholder(R.drawable.ic_launcher).into(iv_artwork);
          }
      }
  }
  </code></pre>
  
  <p><strong>OptionViewHolder.java</strong></p>
  
  <pre><code>class OptionViewHolder extends ChildViewHolder {
      TextView ArtistText;
  
      public OptionViewHolder(View itemView) {
          super(itemView);
          ArtistText = itemView.findViewById(R.id.ArtistText);
      }
  }
  </code></pre>