title: How to anchor a toast to a view, without overlapping them?
body: <h2>Background</h2>
  
  <p>Popups can be anchored to views, but the Toast is missing this API. </p>
  
  <p>What I'd like to know, is how to correctly position a toast near a view (suppose prefer to put below if on upper half of screen, and above if on bottom half), so that they won't overlap each other, no matter the position&amp;size of the view (unless really impossible because the view takes too much space, of course).</p>
  
  <h2>The problem</h2>
  
  <p>I'm aware there are various questions to this question, but all set the toast to be shown below the view, or manually set its position, without regard to the size of both of them.</p>
  
  <h2>What I've found</h2>
  
  <p>Currently I've found the next solutions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/a/13683701/878126"><strong>here</strong></a>, it doesn't take the size of the toast into consideration</li>
  <li><a href="https://stackoverflow.com/a/21026866/878126"><strong>here</strong></a>, it lets you set the position of the toast manually, so they can still overlap each other.</li>
  </ul>
  
  <p>It could be, however, that the toast that appears from long clicking an action item is anchored to the action item's view, but I didn't find out how it works there.</p>
  
  <p>I've also tried many libraries from <a href="https://android-arsenal.com/tag/104" rel="nofollow noreferrer"><strong>Android-Arsenal website</strong></a>, but all of them are either for styling the toasts, or make things that aren't toasts and sometimes don't even work well. </p>
  
  <h2>The question</h2>
  
  <p>Is there a generic way to use the same method used for Popups, on Toasts, so that it will be anchored to a view, without overlapping it?</p>