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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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);
        } 
    } 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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
Connect your IDE to all the code out there  Get Codota for Java
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);
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getKeyboard, isShifted, setShifted
        LOGI(TAG,"KEYBOARD : HANDLE SHIFT ");
 
        if (mKeyboardView == null) {
            return; 
        } 
        Keyboard currentKeyboard = mKeyboardView.getKeyboard();
        if (mQwertyKeyboard == currentKeyboard) {
            // Alphabet keyboard 
            checkToggleCapsLock(); 
            mKeyboardView.setShifted(mCapsLock || !mKeyboardView.isShifted());
        } else if (currentKeyboard == mSymbolsKeyboard) {
            mSymbolsKeyboard.setShifted(true);
            mKeyboardView.setKeyboard(mSymbolsShiftedKeyboard);
            mSymbolsShiftedKeyboard.setShifted(true);
        } else if (currentKeyboard == mSymbolsShiftedKeyboard) {
            mSymbolsShiftedKeyboard.setShifted(false);
            mKeyboardView.setKeyboard(mSymbolsKeyboard);
            mSymbolsKeyboard.setShifted(false);
        } 
    } 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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);
		} 
	} 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
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); 
*/        } 
    } 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android KeyboardView Questions & Answers:

See Code Examples for Android KeyboardView Methods: