title: Resetting ViewSwitcher in a RecyclerView
body: <p>I have a RecyclerView that has fixed size and divider decoration. The views in the adapter are ViewSwitchers. I want the ViewSwitcher to go back to its original view when the ViewHolder is recycled so that it shows the correct view when the user scrolls. </p>
  
  <p>When I override OnViewDetatchedFromWindow, and scroll, the RecyclerView now only shows every 5th view and there is a lag in scrolling.</p>
  
  <p>Here is my Adapter Code:</p>
  
  <pre><code>@Override
  public void onViewDetachedFromWindow(ViewHolder holder) {
      super.onViewDetachedFromWindow(holder);
      holder.vs.reset(); 
  }
  
  @Override
  public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
  
      ViewSwitcher vs = new ViewSwitcher(parent.getContext());
      vs.addView(LayoutInflater.from(parent.getContext()).inflate(
              R.layout.layout_audio_row, parent, false), 0);
      vs.addView(LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_audio_menu_row,
      parent, false), 1);
      vs.setMeasureAllChildren(false);
      Animation showView = AnimationUtils.loadAnimation(parent.getContext(),
              android.R.anim.fade_in);
      vs.setInAnimation(showView);
      //vs.setOutAnimation(hideView);
      ViewHolder vh = new ViewHolder(vs);
      return vh;
  }
  </code></pre>
  
  <p>Am I calling vs.reset() in the appropriate location? Thanks so much in advance!</p>