Replaced OnPreDraw with View.measure() to fix issue #12