Android KeyboardView - 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 KeyboardView class.

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: 
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;
5
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());
        } else if (currentKeyboard == mSymbolsKeyboard) {
            mSymbolsKeyboard.setShifted(true);
            mInputView.setKeyboard(mSymbolsShiftedKeyboard);
            mSymbolsShiftedKeyboard.setShifted(true);
        } else if (currentKeyboard == mSymbolsShiftedKeyboard) {
            mSymbolsShiftedKeyboard.setShifted(false);
            mInputView.setKeyboard(mSymbolsKeyboard);
            mSymbolsKeyboard.setShifted(false);
        } 
    } 
5
CodeRank
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;
	} 
	 
	/** 
5
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 void handleCharacter(int primaryCode, int[] keyCodes) {
        if (isInputViewShown()) { 
            if (mInputView.isShifted())
                primaryCode = Character.toUpperCase(primaryCode);
        } 
        if (isAlphabet(primaryCode) && mPredictionOn) {
            mComposing.append((char) primaryCode);
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: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());
		} else if (currentKeyboard == mSymbolsKeyboard) {
			mSymbolsKeyboard.setShifted(true);
			mInputView.setKeyboard(mSymbolsShiftedKeyboard);
			mSymbolsShiftedKeyboard.setShifted(true);
		} else if (currentKeyboard == mSymbolsShiftedKeyboard) {
			mSymbolsShiftedKeyboard.setShifted(false);
			mInputView.setKeyboard(mSymbolsKeyboard);
			mSymbolsKeyboard.setShifted(false);
		} 
	} 
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: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());
/*        } else if (currentKeyboard == mSymbolsKeyboard) { 
            mSymbolsKeyboard.setShifted(true); 
            mInputView.setKeyboard(mSymbolsShiftedKeyboard); 
            mSymbolsShiftedKeyboard.setShifted(true); 
        } else if (currentKeyboard == mSymbolsShiftedKeyboard) { 
            mSymbolsShiftedKeyboard.setShifted(false); 
            mInputView.setKeyboard(mSymbolsKeyboard); 
            mSymbolsKeyboard.setShifted(false); 
*/        } 
    } 
5
CodeRank

Related Android KeyboardView Questions & Answers:

See Code Examples for Android KeyboardView Methods: