title: Android Studio Equivalate to CSS display grid
body: <p>In CSS I can easily create a grid as in the picture below:</p>
  <p><a href="https://i.stack.imgur.com/gSTU4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gSTU4.png" alt="Grid" /></a></p>
  <p><div class="snippet" data-lang="js" data-hide="true" data-console="false" data-babel="false">
  <div class="snippet-code snippet-currently-hidden">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.grid {
    display: grid;
    grid-template: repeat(2, 1fr) / repeat(2, 1fr);
  
    width: 200px;
    height: 200px;
  
    margin: auto;
  }
  
  .grid &gt; div {
    border: 1px solid black;
    text-align: center;
    line-height: 100px; 
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="grid"&gt;
    &lt;div&gt;1&lt;/div&gt;
    &lt;div&gt;2&lt;/div&gt;
    &lt;div&gt;3&lt;/div&gt;
    &lt;div&gt;4&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>I started working with Android Studio today and want to achieve a similar effect? I've tried the linear layouts, but cannot get them to wrap or specify the number of columns and rows. Here's what I have so far:</p>
  <pre><code>&lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:id=&quot;@+id/drawerLayout&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      android:orientation=&quot;horizontal&quot;&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textView&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_weight=&quot;1&quot;
          android:text=&quot;1&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textView2&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_weight=&quot;1&quot;
          android:text=&quot;2&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textView3&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_weight=&quot;1&quot;
          android:text=&quot;3&quot; /&gt;
  
      &lt;TextView
          android:id=&quot;@+id/textView4&quot;
          android:layout_width=&quot;wrap_content&quot;
          android:layout_height=&quot;wrap_content&quot;
          android:layout_weight=&quot;1&quot;
          android:text=&quot;4&quot; /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  <p>But they are all in a line and acting more like a flexbox. There seems to be a grid layout, but it's under legacy so I'm assuming it's depreciated. How can I make a grid layout like the one above, specify the number of columns and rows?</p>