title: android - Scrolling TextView in each RecyclerView element as needed
body: <p>I have a RecyclerView (<code>ytRC</code>) and within that RecyclerView, each element has a thumbnail and a corresponding title that gets inside the RecyclerView via an adapter (<code>ResultsAdapter</code>), which puts the thumbnail and the title into a cardview. I want to make my title in the cardview a single line, which is easy enough. But, some titles are too long, so they get cut off. I thought that a marquee textview would be a great way to fix this, so off I went searching for a solution. </p>
  
  <p>I found some results such as <a href="https://stackoverflow.com/questions/3332924/textview-marquee-not-working">this</a> and <a href="https://stackoverflow.com/questions/2182578/marquee-text-in-android">this</a>. But, those solutions only partially worked, which means that only 1 out of the 50 elements in the RecyclerView actually scrolled that needed to scroll due to their length. I think this happened because I was calling <code>title.setEnabled(true);</code> and <code>title.requestFocus();</code> in the <code>onBindViewHolder()</code> method of the <code>ResultsAdapter</code> and the text was only being marqueed when the only a certain view in the RecyclerView was being produced. </p>
  
  <p>Another solution that I wanted to try was to create a custom TextView class <code>ScrollingTextView</code>:</p>
  
  <pre><code>import android.content.Context;
  import android.support.annotation.Nullable;
  import android.util.AttributeSet;
  
  
  public class ScrollingTextView extends android.support.v7.widget.AppCompatTextView {
  public ScrollingTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
      super(context, attrs, defStyleAttr);
      init();
  }
  
  public ScrollingTextView(Context context, AttributeSet attrs) {
      super(context, attrs);
      init();
  }
  
  private void init() {
      //set scrolling
      setSelected(true);
      requestFocus();
  }
  }
  </code></pre>
  
  <p>But, using that class yields the same results. So, how would I go about marqueeing a textview in each RecyclerView element that has too much text?</p>