title: How can I share a int value globally (xml and code)?
body: <p>In my Android app, I use LinearLayout's weight at multiple point in my app. Those weight are both used in xml and in code as I change them dynamically.</p>
  <p>To reuse the same values everywhere, I thought I could declare them in my dimens.xml file like this:</p>
  <pre><code>&lt;resources&gt;
      &lt;dimen name=&quot;total_weight&quot;&gt;5&lt;/dimen&gt;
      &lt;dimen name=&quot;expanded_weight&quot;&gt;3&lt;/dimen&gt;
      &lt;dimen name=&quot;collapsed_weight&quot;&gt;2&lt;/dimen&gt;
  &lt;/resources&gt;
  </code></pre>
  <p>But it doesn't work as dimen only accept dp, px or sp units.</p>
  <p>What workaround could I use?</p>