Back to Browse

Android: Get The View's Size Before Display

1.2K views
Apr 23, 2016
4:17

Code on GitHub: https://github.com/TheWayOfCoding/tutorialsandsnippets/tree/master/Android/SizeBeforeViewCreation My website Article: http://thewayofcoding.com/2016/04/get-the-size-of-a-custom-view-before-display/ Tutorial code license: http://thewayofcoding.com/tutorial-code-license/ In this video I go over making a custom view where we can get the size of the view before it starts fully running. This is helpful when you want to do screen calculations beforehand. In my case I had a simple game's display code in the view that needed screen tile calculations before everything started. We use ViewTreeObserver.OnGlobalLayoutListener to make it happen.

Download

1 formats

Video Formats

360pmp48.0 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

Android: Get The View's Size Before Display | NatokHD