title: Circle button dynamic size android
body: <p>I'm developing an app that requires circle buttons, I achieved the expected result, like this image:</p>
  
  <p><a href="https://i.stack.imgur.com/njICK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/njICK.png" alt="enter image description here"></a></p>
  
  <p>The problem is that I need to set a fixed value to the width and height to get the correct shape, otherwise the buttons would be like the following image and I needed it to be dynamic:</p>
  
  <p><a href="https://i.stack.imgur.com/mrs7B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mrs7B.png" alt="enter image description here"></a></p>
  
  <p>My button's XML:</p>
  
  <pre><code>&lt;Button
      android:id="@+id/bt_ab_mais"
      style="@style/TipoSanguineoButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_weight="1"
      android:layout_marginRight="13dp"
      android:text="@string/pedir_doacao_sangue_ab_mais"
      android:textAllCaps="true"
      android:textSize="15sp"
      android:textStyle="bold" /&gt;
  </code></pre>
  
  <p>The button's background:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt;
      &lt;item android:state_pressed="false"&gt;
          &lt;shape android:shape="oval"&gt;
              &lt;stroke android:width="2dp" android:color="@android:color/darker_gray" /&gt;
              &lt;solid android:color="@color/branco" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
      &lt;item android:state_pressed="true"&gt;
          &lt;shape android:shape="oval"&gt;
              &lt;stroke android:width="2dp" android:color="@android:color/darker_gray" /&gt;
              &lt;solid android:color="@color/cinza_tablayout" /&gt;
          &lt;/shape&gt;
      &lt;/item&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>Does anybody know how to do it?</p>