@Override
            public void onGlobalLayout() {
                if (view.getMeasuredWidth() > 0 && view.getMeasuredHeight() > 0) {
                    final Boolean continueAction = action.apply(view);
                    if (continueAction == null || !continueAction) {
                        view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                    }
                }
            }
requests a layout change on given view and runs the given consumer once the view has been measured
main/src/main/java/cgeo/geocaching/ui/ViewUtils.java