title: Android anko DSL - adding textviews and make them "newline" when there are no more screen width?
body: <p>my task is simple I have an array of names, each name is added as a individual textview. However some of my arrays are long, and the textviews is too big to fit on the screen. The result is very ugle and I have no clue how to solve it. I have tried to use all different (as far as I know) layout types, and none of them seems to do the job I want. I simplye want them to jump to a new line when there is no more space left. A little like how this works: <a href="https://www.w3schools.com/css/tryit.asp?filename=trycss_float_elements" rel="nofollow noreferrer">https://www.w3schools.com/css/tryit.asp?filename=trycss_float_elements</a></p>
  
  <p>This is how it looks: <a href="https://i.stack.imgur.com/fv4CG.png" rel="nofollow noreferrer">enter image description here</a>
  This is my current code:</p>
  
  <pre><code>for (game in games) {
      verticalLayout {
          padding = dip(5)
          //border color
          verticalLayout {
              padding = dip(3)
              backgroundColor = Color.rgb(227, 227, 227)
              //background golor
              verticalLayout {
                  padding = dip(3)
                  backgroundColor = Color.rgb(250, 250, 250)
                  linearLayout {
                      var players = App.instance.db.getPlayerScores(game.toLong())
                      var isFirst = true
                      var colors = ArrayList(Arrays.asList(Color.BLUE, Color.RED, Color.GREEN, Color.MAGENTA, Color.YELLOW,Color.BLUE, Color.RED, Color.GREEN, Color.MAGENTA, Color.YELLOW,Color.BLUE, Color.RED, Color.GREEN, Color.MAGENTA, Color.YELLOW))
                      var ci = 0;
                      for (player in players) {
                          if (!isFirst) {
                              textView {
                                  text = " vs. "
                                  textSize = 18f
                              }
                          }
                          textView {
                              text = player.name
                              textSize = 24f
                              textColor = colors[ci]
                              ci += 1
                          }
                          isFirst = false
                      }
                  }
                  textView {
                      val date = App.instance.db.getGameTime(game)
                      text = date.substring(0, 16)
                      textSize = 18f
                      textColor = Color.GRAY
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>There should be some kind of solution to this without calculating the lenght of the content in the linearLayout and make it create a new leanaerLayout if next item will be too large to fit? If not... How could that be done?</p>