title: What is the different uses of attrs in android?
body: <p>First of all, i know that there plenty of post about the issue and i think i read them all. If someone ask i will attach them for approve :)</p>
  <p>I have an issue with attrs. The issue is that sometimes i see programmers using it when they create a <strong>custom view</strong> but sometimes i see that they are used also when building a theme.
  For example:</p>
  <pre><code>  &lt;declare-styleable name=&quot;Main_Theme&quot;&gt;
     
      &lt;attr name=&quot;background&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;backgroundCard&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;secondaryTextColor&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;primaryTextColor&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;primaryColor&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;secondaryColor1&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;secondaryColor2&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;secondaryColor3&quot; format=&quot;reference&quot; /&gt;
      &lt;attr name=&quot;dividerColor&quot; format=&quot;reference&quot; /&gt;
  </code></pre>
  <p>and then they creates a theme using it.
  For example:</p>
  <pre><code>    &lt;item name=&quot;background&quot;&gt;@color/dark_theme_background&lt;/item&gt;
      &lt;item name=&quot;backgroundCard&quot;&gt;@color/dark_theme_card_background&lt;/item&gt;
      &lt;item name=&quot;secondaryTextColor&quot;&gt;@color/dark_theme_scores_new&lt;/item&gt;
      &lt;item name=&quot;primaryTextColor&quot;&gt;@color/dark_theme_primary_text_color&lt;/item&gt;
      &lt;item name=&quot;primaryColor&quot;&gt;@color/dark_theme_primary_color&lt;/item&gt;
      &lt;item name=&quot;secondaryColor1&quot;&gt;@color/dark_theme_secondary_1_color&lt;/item&gt;
      &lt;item name=&quot;secondaryColor2&quot;&gt;@color/dark_theme_secondary_2_color&lt;/item&gt;
      &lt;item name=&quot;secondaryColor3&quot;&gt;@color/dark_theme_secondary_3_color&lt;/item&gt;
      &lt;item name=&quot;dividerColor&quot;&gt;@color/dark_theme_divider_color&lt;/item&gt;
  </code></pre>
  <p>Then i saw them using those items as values for attributes in layout activity xml file
  So i really can't understand the variety use of attrs.
  I hope someone can help me to understand cause i feeling very confused</p>