Best code examples for Android KeyboardView class (android.inputmethodservice.KeyboardView)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android KeyboardView class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android KeyboardView examples from Open Source projects
This code example shows how to use the following methods: getKeyboard, isShifted, setKeyboard, setShifted
            mVibratePattern[i] = tmpArray[i];
        } 
    } 
 
    private void handleModeChange() { 
        final Keyboard current = mKeyboardView.getKeyboard();
        Keyboard next = null;
        if (current == mQwertyKeyboard || current == mQwertyKeyboardShifted) {
            next = mSymbolsKeyboard;
        } else if (current == mSymbolsKeyboard || current == mSymbolsKeyboardShifted) {
            next = mQwertyKeyboard;
        } 
        if (next != null) {
            mKeyboardView.setKeyboard(next);
            mKeyboardState = KEYBOARD_STATE_NORMAL;
        } 
    } 
 
    public void handleBackspace() { 
        sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL);

10
CodeRank
This code example shows how to use the following methods: getKeyboard, isShifted, setShifted
	private void handleShift() { 
		if (mInputView == null) {
			return; 
		} 
 
		Keyboard currentKeyboard = mInputView.getKeyboard();
		if (mQwertyKeyboard == currentKeyboard) {
			// Alphabet keyboard 
			checkToggleCapsLock(); 
			mInputView.setShifted(mCapsLock || !mInputView.isShifted());
		} 
	} 
 
	private String translateSpecialCode(int primaryCode) {
		String result = "";
		switch (primaryCode) {
		case -1100: 
			result = "A.";
			break; 
		case -1101: 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getKeyboard, setKeyboard, setOnKeyboardActionListener, setPreviewEnabled
	private Keyboard mKeyboard;
 
	public MyKeyboard(Activity host, int viewid, int layoutid) {
		this.mHostActivity = host;
		mKeyboardView= (KeyboardView)mHostActivity.findViewById(viewid);
        mKeyboardView.setKeyboard(new Keyboard(mHostActivity, layoutid));
        mKeyboard = mKeyboardView.getKeyboard();
        mKeyboardView.setPreviewEnabled(false); // NOTE Do not show the preview balloons
        mKeyboardView.setOnKeyboardActionListener(this);
        // Hide the standard keyboard initially 
        mHostActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
	} 
	 
 
 
	@Override 
	public void onKey(int primaryCode, int[] arg1) {
		View focusCurrent = mHostActivity.getWindow().getCurrentFocus();
	    if( focusCurrent==null || focusCurrent.getClass()!=MyEditText.class ) return;
	    MyEditText edittext = (MyEditText) focusCurrent;
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: getKeyboard, isShifted, setShifted
This code example shows how to use the following methods: setKeyboard, setOnKeyboardActionListener, setPreviewEnabled
	}; 
	 
	public MyKeyboard(Activity host, int viewId, int layoutId){
		mHostActivity = host;
		mKeyboardView = (KeyboardView) mHostActivity.findViewById(viewId);
		mKeyboardView.setKeyboard(new Keyboard(mHostActivity, layoutId));
		mKeyboardView.setPreviewEnabled(false); // NOTE Do not show the preview
												// balloons 
		mKeyboardView.setOnKeyboardActionListener(mOnKeyboardActionListener);
		// Hide the standard keyboard initially 
		mHostActivity.getWindow().setSoftInputMode(
				WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);	
	} 
 
	/** Returns whether the CustomKeyboard is visible. */ 
	public boolean isCustomKeyboardVisible() { 
		return mKeyboardView.getVisibility() == View.VISIBLE;
	} 
	 
	/** 
Full Snippet Info
5
CodeRank
Related Android KeyboardView Questions & Answers:
See Code Examples for Android KeyboardView Methods: