title: Calculate image size when using setCompoundDrawables for EditText
body: <p>When I am add icon like below:</p>
  
  <pre><code>etComment = (EditText) findViewById(R.id.et_comment);
  Drawable img = getResources().getDrawable( R.drawable.warning );
  etComment.setCompoundDrawablesWithIntrinsicBounds( img, null, null, null );
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/A30GC.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/JPEs0.png" alt="enter image description here"></p>
  
  <p>The icon resizes EditText. How can I calculate img size and put it into EditText without EditText resize?</p>
  
  <p>Thanks!</p>
  
  <hr>
  
  <blockquote>
    <p><strong>FunkTheMonk</strong> <br />
    Use setCompounDrawables() instead of setCompoundDrawablesWithIntrinsicBounds() - you'll have to set the bounds of the drawables manually.</p>
  </blockquote>
  
  <p>I don't understand how to calculate Bounds manually. I have got height and width of EditText:</p>
  
  <pre><code>etComment = (EditText) findViewById(R.id.et_comment);
  Drawable img = getResources().getDrawable( R.drawable.warning );
  int size = etComment.getHeight();
  img.setBounds(0, 0, size, size);
  etComment.setCompoundDrawables( img, null, null, null );
  </code></pre>
  
  <p>but I have different results in different screen sizes. How I can calculate correct size and padding of icon? Could you please help me?</p>