title: Show numbers in horizontal recyclerview with max 5 rows
body: <p>Show dynamic list of numbers in <strong>horizontal scrolled recyclerview</strong> with max 5 rows. Numbers size depend on current weeks number. If current weeks number is 45, then there will be 45 items. I can show them as below (vertically increasing) with <code>GridLayoutManager</code>.</p>
  
  <pre><code>1   6  11  16 
  2   7  12  17
  3   8  13  18
  4   9  14  19
  5  10  15  20
  
  &lt;-----------&gt;
  </code></pre>
  
  <p>But I want them to be shown as below (horizontal increasing)</p>
  
  <pre><code>1   2   3   4   5
  
  6   7   8   9  10
  
  11 12  13  14  15
  
  16 17  18  19  20
  
  21 22  23  24  24
  
  &lt;---------------&gt;
  </code></pre>
  
  <p>Here just for simplicity I started numbers from 1. In real application numbers can start from 100 or 1000.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Now what I've.</p>
  
  <p><a href="https://i.stack.imgur.com/YMXi5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YMXi5.jpg" alt="enter image description here"></a></p>
  
  <p>As you can see numbers are decreased vertically. I want them to be decreased horizontally.</p>
  
  <p>Below is my adapter</p>
  
  <pre><code>class SINumberAdapter(val context: Context, val list:List&lt;String&gt;): RecyclerView.Adapter&lt;SINumberAdapter.NumberViewHolder&gt;(){
      override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NumberViewHolder {
  
          val textView = TextView(parent.context)
          textView.layoutParams = LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,LinearLayout.LayoutParams.WRAP_CONTENT)
          val paddingInPixels = 5.toPx
          textView.setPadding(paddingInPixels, paddingInPixels, paddingInPixels, paddingInPixels)
          return NumberViewHolder(textView)
      }
  
      override fun getItemCount() = list.size
  
      override fun onBindViewHolder(holder: NumberViewHolder, position: Int) {
          holder.view.text = list[position]
      }
  
      inner class NumberViewHolder(val view:TextView):RecyclerView.ViewHolder(view){
          init {
              view.setOnClickListener {}
          }
      }
  }
  </code></pre>