title: Android : Create your own attribute names in styles.xml
body: <p>I need some help, I've been browsing for a while, but none of the topic I've found could resolve my problem. Hope you'll help me !</p>
  
  <p>Here we go : I have a custom view, let's call it CustomView.
  It has some custom attributes too, defined in an attrs.xml file, like below : </p>
  
  <pre><code>&lt;declare-styleable name="CustomView"&gt;
      &lt;attr name="customBackgroundColor" format="color"/&gt;
      &lt;attr name="customTextColor" format="color"/&gt;
      &lt;attr name="customWhatever" format="dimension"/&gt;
  &lt;/declare-styleable&gt;
  </code></pre>
  
  <p>This view is part of a library I want to create so I can use it in multiple projects.</p>
  
  <p>The funny part comes here : Actually, I'll use this view really often, so I want to define a style in styles.xml to define its property, so I don't have to go in every xml layout files where I use this view to edit its attributes. Something like this :</p>
  
  <pre><code>&lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;item name="colorPrimary"&gt;@color/colorPrimary&lt;/item&gt;
      &lt;item name="colorPrimaryDark"&gt;@color/colorPrimaryDark&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
      &lt;item name="customViewStyle"&gt;@style/myCustomViewStyle&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="myCustomViewStyle" parent="CustomViewStyle"&gt;
      &lt;item name="customBackgroundColor"&gt;@color/red&lt;/item&gt;
      &lt;item name="customTextColor"&gt;@color/blue&lt;/item&gt;
      &lt;item name="customWhatever"&gt;@dimen/someHeight&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>So my question is : How do I define this "customViewStyle" key, and if it's possible, how to get informations from it ?</p>
  
  <p>Bonus : I've been able to create this "customViewStyle" key by doing this :</p>
  
  <pre><code>&lt;attr name="customViewStyle" format="reference"/&gt;
  </code></pre>
  
  <p>But I haven't found yet how to exploit it.</p>