title: When recycler veiw item is expanded (child views shown), the list should scroll to the bottom of expanded item
body: <p>I have a RecyclerView with a custom adapter. Every item of the list contains hidden (collapsed) views, that are shown when I click "expand" button. The problem is if the item is at the bottom of the screen, item contents is left out of screen. Is it possible to scroll list view, so the contents of an expanded item be on the screen? I hope my question makes sense. </p>
  
  <pre><code>UnitCardAdapter.java
  public class ViewHolder {
      public ViewHolder(View view) {
          cardBody = (LinearLayout) view.findViewById(R.id.cardBody);
  
          setListeners(unitCard, this);
      }
  }
  
  private void setListeners(final UnitCard unitCard, final ViewHolder holder) {
      int position = holder.getAdapterPosition();
      holder.unitExpandBtn.setOnClickListener( 
         unitCard.getUnitExpandOnClick()
  }
  </code></pre>
  
  <pre><code>UnitCard.java
  public View.OnClickListener getUnitExpandOnClick() {
      return new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              if (!mIsExpanded) {
                  expand();
              } else { 
                  collapse(); 
              }
          }
      };
  }
  
  public void expand() {
      mIsExpanded = true;
      if (mViewHolder != null) {
          mViewHolder.cardBody.setVisibility(View.VISIBLE);
      }
  }
  
  public void collapse() {
      mIsExpanded = false;
      if (mViewHolder != null) {
          mViewHolder.cardBody.setVisibility(View.GONE);
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TeStt.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TeStt.gif" alt="enter image description here"></a></p>