If I understand what you're asking correctly, since onMeasure() is called before onDraw(), you do have the ability to figure out the size of a view before it's actually drawn. So just create a custom view or viewgroup (depending on your useCase) and before returning the result in onMeasure(), you can take your measured width/height and pass it to your network layer to fetch the image or image size or w/e and when you get that result you can do whatever it is you need to do in your custom view then trigger onDraw() manually via calls to requestLayout() or invalidate (). ( I don't remember the 4am which one triggers which methods to be called ha).
Hope that helps or at least gives you an idea. Again, I may have misunderstood your question but this is my guess given my understanding. Cheers.