title: How do I get a ConstraintLayout from a View?
body: <p>I have an app and I have a dynamically changing crosshair that is supposed to follow where the user clicks. What I'm trying to do to get the crosshair to move is changing the constraints on the crosshair relative to the sides of the view. </p>
  
  <p>Here is my code.</p>
  
  <pre><code>ConstraintSet set = new ConstraintSet();
  View layout = findViewById(R.id.crosshair);
  
  set.clone((ConstraintLayout) layout);
  set.clear(R.id.crosshair,ConstraintSet.LEFT);
  set.clear(R.id.crosshair,ConstraintSet.TOP);
  set.connect(R.id.crosshair,ConstraintSet.TOP,R.id.CourseMain,y);
  set.connect(R.id.crosshair,ConstraintSet.LEFT,R.id.CourseMain,x);
  
  set.applyTo((ConstraintLayout) layout);
  </code></pre>
  
  <p>Unfortunately, I can't cast a view to a constraint and I'm having problems finding how to get a constraint layout.</p>
  
  <p>So, what I'm really asking is. How to I get a ConstraintLayout from a view OR how do I get a ConstraintLayout in general. I'm kinda lost there too.</p>