title: Android SDK - camera2 - Draw rectangle over TextureView
body: <p>Im new to android development, and I'm finding it hard to find good examples on the camera2 api.</p>
  
  <p>Im working my way slowly through most issues, but on this one I am stuck.
  In the default camera, when you touch the screen to focus, it shows a rectangle of the focus area for a moment. I want to do something similar (Or in this case, the exact same thing to start off with so i can figure it out).</p>
  
  <p>I read somewhere (I think the TextureView page in the SDK docs) that you cant draw on a textureview while its being used as a camera preview - and calling the lock method will return null rather than a canvas.</p>
  
  <p>I found this online: <a href="https://github.com/commonsguy/vidtry/" rel="noreferrer">https://github.com/commonsguy/vidtry/</a>
  But i cant get it to work. I either get errors saying my my main view cant be cast to my drawable view, or vice versa - Or my drawable view is on top and makes the screen black - Or its on the bottom and wont respond to touch events (and trying to force the performClick from the view above it casues crashes.)</p>
  
  <p>Im stuck! Can anyone give me an explanation or example of how i can draw my rectangle over the event position for a few sconds?</p>
  
  <p>Thanks!</p>