title: How to get circular shape in gridview cell in Android
body: <p>I am using a gridview to make a simple calculator app. I am using gridView to hold the buttons of calculator. The gridview cell is a layout with TextView. The dextView uses a drawable background, which uses an oval shape.
  Below are the XML representations:</p>
  
  <p>Grid cell's layout xml
       </p>
  
  <pre><code>    &lt;TextView
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:id="@+id/id_gridCell"
          android:background="@drawable/circularbutton_selector"
          android:layout_margin="0dp"
          android:gravity="center_horizontal|center_vertical"
          android:textSize="40dp"
          android:text="-"
          android:layout_gravity="center_horizontal|center_vertical"
          android:elevation="5dp"
          /&gt; &lt;/LinearLayout&gt;
  </code></pre>
  
  <blockquote>
    <p> 
  </blockquote>
  
  <p>Drawable Shape</p>
  
  <pre><code>xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"&gt;
  
          &lt;solid android:color="@color/accent_material_dark"/&gt;
          &lt;stroke android:width="2dp" android:color="#AAA"/&gt; &lt;/shape&gt;
  </code></pre>
  
  <p><strong>The Question:</strong>
  Depending upon the cell width/height, the shape ends up into oval rather than circle. I can not specify a hardcoded value as the grid children should scale for any device. Is there a way to achieve circle which scales with device dimensions?
  The idea is to get it scale with change in margins.</p>