KeyboardView setKeyboard - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for KeyboardView setKeyboard method.

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, 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:closing, setKeyboard
 
	@Override 
	public void onStartInputView(EditorInfo attribute, boolean restarting) {
		super.onStartInputView(attribute, restarting);
		// Apply the selected keyboard to the input view. 
		mInputView.setKeyboard(mCurKeyboard);
		mInputView.closing();
	} 
 
	@Override 
	public boolean onKeyUp(int keyCode, KeyEvent event) {
		if(keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
			volDownPressed = false;
			return true; 
		} else { 
			return super.onKeyUp(keyCode, event);
		} 
	} 
	/** 
	 * Use this to monitor key events being delivered to the application. We get 
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:closing, setKeyboard
	@Override 
	public void onStartInputView(EditorInfo attribute, boolean restarting) {
		super.onStartInputView(attribute, restarting);
		debug("onStartInputView"); 
		// Apply the selected keyboard to the input view. 
		mInputView.setKeyboard(mCurKeyboard);
		mInputView.closing();
		 
		// Reset composing buffer 
		mComposing.setLength(0);
		updateCandidates(); 
	} 
 
	/** 
	* Deal with the editor reporting movement of its cursor. 
	*/ 
	@Override 
	public void onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd,
		int candidatesStart, int candidatesEnd) {
		super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd);
4
CodeRank
This code example shows how to use the following methods:closing, setKeyboard
	@Override  
	public void onStartInputView(EditorInfo attribute, boolean restarting) {
		super.onStartInputView(attribute, restarting);
		// Apply the selected keyboard to the input view. 
		//Ó¦ÓÃÑ¡¶¨µÄ¼üÅ̵½ÊäÈëÊÓͼÖР
		mInputView.setKeyboard(mCurKeyboard);
		mInputView.closing();
	} 
	 
	/** 
	* Deal with the editor reporting movement of its cursor. 
	* ´¦Àí±à¼­Æ÷±¨¸æËûµÄ½¹µãÒƶ¯ÎÊÌâ 
	*/ 
	@Override  
	public void onUpdateSelection(int oldSelStart, int oldSelEnd,
	    int newSelStart, int newSelEnd,
	    int candidatesStart, int candidatesEnd) {
		super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd,
		        candidatesStart, candidatesEnd);
		 
4
CodeRank
This code example shows how to use the following methods:closing, setKeyboard
     
    // @URSA: Everytime the soft keyboard is shown, this method will be called 
    @Override public void onStartInputView(EditorInfo attribute, boolean restarting) {
        super.onStartInputView(attribute, restarting);
        // Apply the selected keyboard to the input view. 
        mInputView.setKeyboard(mCurKeyboard);
        mInputView.closing();
        updateCandidates() ; 
    } 
     
    /** 
     * Deal with the editor reporting movement of its cursor. 
     */ 
    @Override public void onUpdateSelection(int oldSelStart, int oldSelEnd,
            int newSelStart, int newSelEnd,
            int candidatesStart, int candidatesEnd) {
        super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd,
                candidatesStart, candidatesEnd);
         
        // If the current selection in the text view changes, we should 
4
CodeRank
This code example shows how to use the following methods:closing, setKeyboard
 
    @Override 
    public void onStartInputView(EditorInfo attribute, boolean restarting) {
        super.onStartInputView(attribute, restarting);
        // Apply the selected keyboard to the input view. 
        mInputView.setKeyboard(mCurKeyboard);
        mInputView.closing();
    } 
 
    /** 
     * Deal with the editor reporting movement of its cursor. 
     */ 
    @Override 
    public void onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd,
            int candidatesStart, int candidatesEnd) {
        super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart,
                candidatesEnd);
 
        // If the current selection in the text view changes, we should 
        // clear whatever candidate text we have. 
4
CodeRank
This code example shows how to use the following methods:closing, setKeyboard
        	Log.d("bk", "Can't load ges_lib");
        } else{ 
        	Log.d("bk", "ges_lib loaded");
        } 
        // Apply the selected keyboard to the input view. 
        mKeyboardView.setKeyboard(mCurKeyboard);
        mKeyboardView.closing();
    } 
     
    /** 
     * Deal with the editor reporting movement of its cursor. 
     */ 
    @Override public void onUpdateSelection(int oldSelStart, int oldSelEnd,
            int newSelStart, int newSelEnd,
            int candidatesStart, int candidatesEnd) {
        super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd,
                candidatesStart, candidatesEnd);
         
        // If the current selection in the text view changes, we should 
        // clear whatever candidate text we have. 
4
CodeRank
This code example shows how to use the following methods:closing, setKeyboard
 
	@Override 
	public void onStartInputView(EditorInfo attribute, boolean restarting) {
		super.onStartInputView(attribute, restarting);
		// Apply the selected keyboard to the input view. 
		mInputView.setKeyboard(mCurKeyboard);
		mInputView.closing();
	} 
 
	/** 
	 * Deal with the editor reporting movement of its cursor. 
	 */ 
	@Override 
	public void onUpdateSelection(int oldSelStart, int oldSelEnd,
			int newSelStart, int newSelEnd, int candidatesStart,
			int candidatesEnd) {
		super.onUpdateSelection(oldSelStart, oldSelEnd, newSelStart, newSelEnd,
				candidatesStart, candidatesEnd);
 
		// If the current selection in the text view changes, we should 
4
CodeRank

Related KeyboardView setKeyboard Questions & Answers:

setKeyboard Method Overview
Attaches a keyboard to this view.
See Code Examples for other Android KeyboardView Methods: