title: Android drag a view along side a path
body: <p>So I have path and I want to drag my view in that path vertically.
  this is my <code>onTouchListener</code> code for the view:</p>
  <pre><code>val point = FloatArray(2)
  val pathMeasure = PathMeasure(path, true)
  
   tooltipView.setOnTouchListener(object :View.OnTouchListener{
              override fun onTouch(v: View?, event: MotionEvent?): Boolean {
                  onDataPointTouchListener()
                  if (event?.action == MotionEvent.ACTION_MOVE){
                      v?.performClick()
                      pathMeasure.getPosTan(event.x, point, null) // This is where I get path point
                      v?.x = point[0] - tooltipWith / 2
                      v?.y = point[1] - tooltipHeight
                  }else if (event?.action == MotionEvent.ACTION_UP){
                      tooltipView.animate().translationX(previousX - tooltipWith / 2)
                      tooltipView.animate().translationY(previousY - tooltipHeight)
                      layoutDate.visible()
                  }
                  return true
              }
          })
  </code></pre>
  <p>Can someone please help me. My path is a curved line. I want to be able to drag the view in that line.Just like a seekbar:</p>
  <p><a href="https://i.stack.imgur.com/vbt37.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vbt37.gif" alt="enter image description here" /></a></p>