title: How to handle long text in preferences on Android?
body: <h2>Background</h2>
  
  <p>I'm making an app that has some settings, and I want to use the built in PreferenceActivity or PreferenceFragment for the job</p>
  
  <h2>The problem</h2>
  
  <p>Some of the preferences have a long title which I cannot shorten, plus I think that if I ever localize the app (translate to multiple languages) I would face the same problem (for example in German, which has quite long words, sometimes).</p>
  
  <p>What you get in this situation is just the beginning of the text and then "..." (or less dots, which doesn't make much sense btw) in the end of it. </p>
  
  <p>Example:</p>
  
  <p><img src="https://i.stack.imgur.com/BapHU.png" alt="enter image description here"></p>
  
  <h2>What I've tried</h2>
  
  <p>I know that the PreferenceActivity extends from ListActivity, so I can change its adapter to whatever I wish, but that would remove the way it works.</p>
  
  <p>I also know that I can extend from each of the types of the preferences classes, use the "onCreateView" method to have a reference to the created view and then access its children, but this is weird, no? I mean, it's almost like assuming that it will never change the way it looks.</p>
  
  <p>EDIT: Here's a sample code of what I've tried:</p>
  
  <p>Extend from each of the preferences classes, and in each of them , use:</p>
  
  <pre><code>...
  @Override
  protected View onCreateView(final ViewGroup parent)
    {
    final View view=super.onCreateView(parent);
    ViewUtil.handlePreferenceTitleTextView(view);
    return view;
    }
  ...
  
  //ViewUtil.java :
  
  private void handlePreferenceTitleTextView(final View v)
    {
    final TextView titleTextView=(TextView)v.findViewById(android.R.id.title);
    if(titleTextView!=null)
      titleTextView.setSingleLine(false);
    }
  </code></pre>
  
  <p>It works, but I don't think it's recommended as Google might change the way preferences views work.</p>
  
  <h2>The question</h2>
  
  <p>How to handle long text in preferences' titles  on Android ?</p>
  
  <p>Is it possible to make it have an ellipsize / marquee (so that it will have an animation to show everything) ? Or maybe auto fit the font size? Or set it to have word wrap ? Or a horizontal scrollView that will allow the user to scroll to read the rest of the text?</p>
  
  <p>Is there maybe a convention of how to handle such cases? Maybe long clicking to show a toast/dialog for seeing the whole text?</p>