title: How to pass parameters in Android drawable
body: <p>How to pass arguments in the android drawable.</p>
  <p>How to acheive the below mentioned code</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;item&gt;
          &lt;shape android:shape=&quot;rectangle&quot;&gt;
              &lt;solid android:color=&quot;{colorcode}&quot; /&gt;
              &lt;stroke android:width=&quot;1sp&quot; android:color=&quot;{colorcode}&quot; /&gt;
              &lt;corners android:radius=&quot;15dp&quot; /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/selector&gt;
  </code></pre>
  <p>and then from XML file take this drawable passing values for parameters. Something like</p>
  <pre><code>&lt;TextView
      android:layout_width=&quot;wrap_content&quot;
      android:layout_height=&quot;50dp&quot;
      android:layout_marginRight=&quot;5dp&quot;
      android:layout_weight=&quot;1&quot;
      android:background=&quot;@drawable/rounded,{colorCode}&quot;
      android:gravity=&quot;center&quot;/&gt;
  </code></pre>