Java Code Examples for android.view.View#getViewRootImpl()

The following examples show how to use android.view.View#getViewRootImpl() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * Detaches the draw GL functor.
 *
 * @param nativeDrawGLFunctor the pointer to the native functor that implements
 *        system/core/include/utils/Functor.h
 */
public void detachDrawGlFunctor(View containerView, long nativeDrawGLFunctor) {
    ViewRootImpl viewRootImpl = containerView.getViewRootImpl();
    if (nativeDrawGLFunctor != 0 && viewRootImpl != null) {
        viewRootImpl.detachFunctor(nativeDrawGLFunctor);
    }
}
 
Example 2
/**
 * Provides the default implementation of {@link InputConnection#sendKeyEvent(KeyEvent)}, which
 * is expected to dispatch an keyboard event sent from the IME to an appropriate event target
 * depending on the given {@link View} and the current focus state.
 *
 * <p>CAUTION: This method is provided only for the situation where
 * {@link InputConnection#sendKeyEvent(KeyEvent)} needs to be implemented without relying on
 * {@link BaseInputConnection}. Do not use this API for anything else.</p>
 *
 * @param targetView the default target view. If {@code null} is specified, then this method
 * tries to find a good event target based on the current focus state.
 * @param event the key event to be dispatched.
 */
public void dispatchKeyEventFromInputMethod(@Nullable View targetView,
        @NonNull KeyEvent event) {
    synchronized (mH) {
        ViewRootImpl viewRootImpl = targetView != null ? targetView.getViewRootImpl() : null;
        if (viewRootImpl == null) {
            if (mServedView != null) {
                viewRootImpl = mServedView.getViewRootImpl();
            }
        }
        if (viewRootImpl != null) {
            viewRootImpl.dispatchKeyFromIme(event);
        }
    }
}
 
Example 3
private void startInputWhenTransitionsComplete() {
    if (mViewsTransitionComplete && mSharedElementTransitionComplete) {
        final View decor = getDecor();
        if (decor != null) {
            final ViewRootImpl viewRoot = decor.getViewRootImpl();
            if (viewRoot != null) {
                viewRoot.setPausedForTransition(false);
            }
        }
        onTransitionsComplete();
    }
}
 
Example 4
protected void pauseInput() {
    final View decor = getDecor();
    final ViewRootImpl viewRoot = decor == null ? null : decor.getViewRootImpl();
    if (viewRoot != null) {
        viewRoot.setPausedForTransition(true);
    }
}
 
Example 5
static void scheduleCheckFocusLocked(View view) {
    ViewRootImpl viewRootImpl = view.getViewRootImpl();
    if (viewRootImpl != null) {
        viewRootImpl.dispatchCheckFocus();
    }
}