title: Create grid (n × n) in Android ConstraintLayout with variable number of n
body: <p>I want to create a square grid inside <code>ConstraintLayout</code>. My first thought was to create a horizontal chain, give some margin value and set to all single view size attributes <code>width = match_constraint</code>, <code>height = match_constraint</code> and set the ratio to 1:1. It works and it looks like:</p>
  
  <p><a href="https://i.stack.imgur.com/CcfZF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CcfZF.png" alt="enter image description here"></a></p>
  
  <p>And it's easy when a size of the grid is 2×2 - there are 4 elements so it's easy. But what I should do when I had to create a grid 7×7? We have 49 views so setting all of these views could be tricky. I want to do this in constraint layout because I want to have a flexible layout. :) </p>