Search in sources :

Example 51 with ViewRootImpl

use of android.view.ViewRootImpl in project android_frameworks_base by crdroidandroid.

the class PasswordEntryKeyboardHelper method sendKeyEventsToTarget.

private void sendKeyEventsToTarget(int character) {
    ViewRootImpl viewRootImpl = mTargetView.getViewRootImpl();
    KeyEvent[] events = KeyCharacterMap.load(KeyCharacterMap.VIRTUAL_KEYBOARD).getEvents(new char[] { (char) character });
    if (events != null) {
        final int N = events.length;
        for (int i = 0; i < N; i++) {
            KeyEvent event = events[i];
            event = KeyEvent.changeFlags(event, event.getFlags() | KeyEvent.FLAG_SOFT_KEYBOARD | KeyEvent.FLAG_KEEP_TOUCH_MODE);
            viewRootImpl.dispatchInputEvent(event);
        }
    }
}
Also used : ViewRootImpl(android.view.ViewRootImpl) KeyEvent(android.view.KeyEvent)

Aggregations

ViewRootImpl (android.view.ViewRootImpl)51 View (android.view.View)34 KeyEvent (android.view.KeyEvent)18 RemoteView (android.widget.RemoteViews.RemoteView)17 AccessibilityNodeInfo (android.view.accessibility.AccessibilityNodeInfo)11 AccessibilityNodeProvider (android.view.accessibility.AccessibilityNodeProvider)11 GhostView (android.view.GhostView)10 ImageView (android.widget.ImageView)10 Paint (android.graphics.Paint)9 InputMethodManager (android.view.inputmethod.InputMethodManager)6 RemoteException (android.os.RemoteException)5 ViewManager (android.view.ViewManager)5 WindowManager (android.view.WindowManager)5 WebView (android.webkit.WebView)5 DecorView (com.android.internal.policy.DecorView)4 Point (android.graphics.Point)2 Display (android.view.Display)2 Activity (android.app.Activity)1 Picture (android.graphics.Picture)1 Rect (android.graphics.Rect)1