During onResume() I want to get the maximum size of content that my Activity can show sans status bar and navigation bar, before anything is shown. Using DisplayMetrics doesn't seem to work as the returned heightPixels seems to include the status bar size:
DisplayMetrics displayMetrics = new DisplayMetrics();
int width = displayMetrics.widthPixels;
int height = displayMetrics.heightPixels; //includes status-bar size
I've tried getting the Activity's content view however it's not laid out until after onResume() has finished:
View view = this.findViewById(android.R.id.content);
int width = view.getWidth(); // == 0
int height = view.getHeight(); // == 0
I feel like I'm missing something obvious and that it should be simple to get the maximum size that potential content can be before onResume() finishes, or am I wrong?