title: Assign match_parent as a dimen programmatically
body: <p>I'm using <code>dimens.xml</code> file to assign values for different layout sizes(i.e <strong>dimens.xml@values</strong>, <strong>dimens.xml@values-sw600dp</strong>).</p>
  
  <p>When trying to set a dimen as <code>wrap_Content</code> or <code>match_parent</code> I'm using the following way:</p>
  
  <pre><code>&lt;resources&gt;
      &lt;item name="match_parent" format="integer" type="dimen"&gt;-1&lt;/item&gt;
      &lt;dimen name="popup_width"&gt;@dimen/match_parent&lt;/dimen&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>and it works perfectly when using this dimen inside the layout xml file, but when trying to use it programmatically like when declaring a popup window:</p>
  
  <pre><code>PopupWindow pw = new PopupWindow(layout, mContext.getResources().getDimension(R.dimen.popup_width),
                  ViewGroup.LayoutParams.MATCH_PARENT, true);
  pw.showAtLocation(layout, Gravity.CENTER, 40, 0);
  </code></pre>
  
  <p>it doesn't work at all and it considers like if I passed a <code>-1dp</code> values to it(it performs direct referencing), so the layout is ruined at all.</p>
  
  <p>So how can I declare the match_parent dimen in the <code>dimens.xml</code> file in order to use it efficiently in my code? or how even can I use the current dimen form efficiently in my code?</p>