title: Seekbar - align value label above thumb
body: <p>My text isn´t aligned with the thumb.</p>
  
  <p><a href="https://i.stack.imgur.com/icuRp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/icuRp.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/8XNRk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8XNRk.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/5pgYG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5pgYG.png" alt="enter image description here"></a></p>
  
  <p>My label is going of the screen. This is my kotlin code:</p>
  
  <pre><code>val x: Int = progress * (seekBar!!.width - 2 * seekBar.thumbOffset) / seekBar.max
  text12.text = "$progress %"
  val textViewX: Int = x- text12.width / 2
  val finalX =
      if (text12.width + textViewX &gt; maxX){
          maxX - text12.width- 100
      } else textViewX +40 /*your margin*/
  text12.x = if (finalX &lt; 0) 0f /*your margin*/ else finalX.toFloat() +16
  </code></pre>
  
  <p>My xml:</p>
  
  <pre><code>&lt;SeekBar
      android:id="@+id/customSeekBar1"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:max="100"
      android:layout_marginTop="100dp"
      android:progress="50"
      app:layout_constraintTop_toBottomOf="@+id/tv_user_data_notsaved"/&gt;
  
  &lt;TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:id="@+id/text1"
      android:text="12%"
      app:layout_constraintBottom_toTopOf="@+id/customSeekBar1"
      app:layout_constraintLeft_toLeftOf="parent"/&gt;
  </code></pre>