Android BaseInputConnection - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android BaseInputConnection class.

This code example shows how to use the following methods:sendKeyEvent, sleep
      assertTrue(url.endsWith("sample2.html"));
      testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("sample3.html"));
      BaseInputConnection viewConnection = new BaseInputConnection(testView, true);
      KeyEvent backDown = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK);
      KeyEvent backUp = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK);
      viewConnection.sendKeyEvent(backDown);
      viewConnection.sendKeyEvent(backUp);
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("sample2.html"));
      viewConnection.sendKeyEvent(backDown);
      viewConnection.sendKeyEvent(backUp);
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("index.html"));
  } 
   

8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:sendKeyEvent, sleep
      assertTrue(url.endsWith("sample2.html"));
      testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("sample3.html"));
      BaseInputConnection viewConnection = new BaseInputConnection(testView, true);
      KeyEvent backDown = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK);
      KeyEvent backUp = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK);
      viewConnection.sendKeyEvent(backDown);
      viewConnection.sendKeyEvent(backUp);
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("sample2.html"));
      viewConnection.sendKeyEvent(backDown);
      viewConnection.sendKeyEvent(backUp);
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("index.html"));
  } 
   

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:sendKeyEvent, sleep
      assertTrue(url.endsWith("sample2.html"));
      testView.loadUrl("file:///android_asset/www/backbuttonmultipage/sample3.html");
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("sample3.html"));
      BaseInputConnection viewConnection = new BaseInputConnection(testView, true);
      KeyEvent backDown = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK);
      KeyEvent backUp = new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_BACK);
      viewConnection.sendKeyEvent(backDown);
      viewConnection.sendKeyEvent(backUp);
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("sample2.html"));
      viewConnection.sendKeyEvent(backDown);
      viewConnection.sendKeyEvent(backUp);
      sleep(); 
      url = testView.getUrl();
      assertTrue(url.endsWith("index.html"));
  } 
   

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
            outAttrs.label = "";
            outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
            outAttrs.inputType = InputType.TYPE_NULL;
 
            return new BaseInputConnection (this, false);
        } 
 
        //============================================================================== 
        @Override 
        protected void onSizeChanged (int w, int h, int oldw, int oldh)
        { 
            super.onSizeChanged (w, h, oldw, oldh);
            viewSizeChanged(); 
        } 
 
        @Override 
        protected void onLayout (boolean changed, int left, int top, int right, int bottom)
        { 
            for (int i = getChildCount(); --i >= 0;)
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
            outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
            outAttrs.label = "";
            outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI;
            outAttrs.inputType = InputType.TYPE_NULL;
 
            return new BaseInputConnection (this, false);
        } 
 
        //============================================================================== 
        @Override 
        protected void onSizeChanged (int w, int h, int oldw, int oldh)
        { 
            super.onSizeChanged (w, h, oldw, oldh);
            viewSizeChanged(); 
        } 
 
        @Override 
        protected void onLayout (boolean changed, int left, int top, int right, int bottom)
        { 
            for (int i = getChildCount(); --i >= 0;)
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
  public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    outAttrs.imeOptions |=
        EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_FLAG_NO_ENTER_ACTION
            | EditorInfo.IME_ACTION_NONE;
    outAttrs.inputType = EditorInfo.TYPE_NULL;
    return new BaseInputConnection(this, false);
  } 
 
  @Override 
  public boolean onSingleTapUp(MotionEvent e) {
    mInputMethodManager.showSoftInput(this, InputMethodManager.SHOW_IMPLICIT);
    return true; 
  } 
} 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
        result = super.onCreateInputConnection(outAttrs);
 
        if (result == null) {
            if (inputConnection == null)
                inputConnection = new BaseInputConnection(this, false);
            result = inputConnection;
        } 
        return result;
    } 
 
    @Override 
    public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
        video.resetScreen(true);
    } 
 
    @Override 
    public void surfaceCreated(SurfaceHolder holder) {
        running = true;
        context.addButtonsView(input, availableHeight(), isLandscape());
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	 
	@Override 
	public InputConnection onCreateInputConnection (EditorInfo outAttrs)
	{ 
		Log.v("trolololo", "Keyboard connection created");
        BaseInputConnection fic = new BaseInputConnection(this, false);
        outAttrs.actionLabel = null;
        outAttrs.inputType = InputType.TYPE_NULL;
        outAttrs.imeOptions = EditorInfo.IME_ACTION_NEXT;
        return fic;
	} 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android BaseInputConnection Questions & Answers:

See Code Examples for Android BaseInputConnection Methods: