fragment/src/main/java/androidx/fragment/app/OneShotPreDrawListener.java
public static OneShotPreDrawListener add(View view, Runnable runnable) {
        OneShotPreDrawListener listener = new OneShotPreDrawListener(view, runnable);
        view.getViewTreeObserver().addOnPreDrawListener(listener);
        view.addOnAttachStateChangeListener(listener);
        return listener;
    }
/**
     * Creates a OneShotPreDrawListener and adds it to view's ViewTreeObserver.
     * @param view The view whose ViewTreeObserver the OnPreDrawListener should listen.
     * @param runnable The Runnable to execute in the OnPreDraw (once)
     * @return The added OneShotPreDrawListener. It can be removed prior to
     * the onPreDraw by calling {@link #removeListener()}.
     */
Creates a OneShotPreDrawListener and adds it to view's ViewTreeObserver.
@param view The view whose ViewTreeObserver the OnPreDrawListener should listen.
@param runnable The Runnable to execute in the OnPreDraw (once)
@return The added OneShotPreDrawListener. It can be removed prior to
the onPreDraw by calling  #removeListener().
Creates a OneShotPreDrawListener and adds it to view ' s ViewTreeObserver . @param view The view whose ViewTreeObserver the OnPreDrawListener should listen . @param runnable The Runnable to execute in the OnPreDraw ( once ) @return The added OneShotPreDrawListener . It can be removed prior to the onPreDraw by calling #removeListener () .
public static OneShotPreDrawListener add(View view, Runnable runnable) {
        OneShotPreDrawListener listener = new OneShotPreDrawListener(view, runnable);
        view.getViewTreeObserver().addOnPreDrawListener(listener);
        view.addOnAttachStateChangeListener(listener);
        return listener;
    }
public static OneShotPreDrawListener add ( View view , Runnable runnable ) { OneShotPreDrawListener listener = new OneShotPreDrawListener ( view , runnable ) ; view . getViewTreeObserver ( ) . addOnPreDrawListener ( listener ) ; view . addOnAttachStateChangeListener ( listener ) ; return listener ; }
Creates a OneShotPreDrawListener and adds it to view's ViewTreeObserver.
Creates a OneShotPreDrawListener and adds it to view ' s ViewTreeObserver .