@Override
              public void onGlobalLayout() {
                ResizableFrameLayout mainImageFrameLayout =
                    (ResizableFrameLayout) view.findViewById(R.id.frame_main);
                mainImageFrameLayout.init(view.findViewById(R.id.btn_resize));

                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                  view.getViewTreeObserver().removeOnGlobalLayoutListener(this);
                } else {
                  view.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                }
              }
Fragment that illustrates how to use the image pipeline directly in order to create
notifications.
samples/showcase/src/main/java/com/facebook/fresco/samples/showcase/imagepipeline/ImagePipelineResizingFragment.java