Java 类android.text.method.KeyListener 实例源码

项目:Carrier    文件:UserProfileActivity.java   
/**
 * Tapping the edit icon next to the phone number allows the user to edit their phone
 *
 * @param v v is a View, allows usage of on click in xml
 */
public void editPhoneNumber(View v) {
    editingPhone = true;
    ImageButton cancelButton = (ImageButton) findViewById(R.id.Button_cancelPhoneEdit);
    ImageButton saveButton = (ImageButton) findViewById(R.id.EditButton_savePhoneEdit);
    ImageButton editButton = (ImageButton) findViewById(R.id.ImageButton_phoneEditIcon);
    // Set visibility of the buttons.
    editButton.setVisibility(View.INVISIBLE);
    saveButton.setVisibility(View.VISIBLE);
    cancelButton.setVisibility(View.VISIBLE);
    TextView phoneNumber = (TextView) findViewById(R.id.EditText_phone);
    phoneNumber.setClickable(true);
    // Set it so the user can edit the EditText
    phoneNumber.setFocusableInTouchMode(true);
    phoneNumber.setFocusable(true);
    phoneNumber.setKeyListener((KeyListener) phoneNumber.getTag());
    phoneNumber.requestFocus();
    phoneNumber.moveCursorToVisibleOffset();
    phoneNumber.setText("");
    phoneNumber.append(currentUser.getPhone());
}
项目:Carrier    文件:UserProfileActivity.java   
/**
 * Tapping the edit icon next to the email allows the user to edit their email
 *
 * @param v v is a View, allows usage of on click in xml
 */
public void editEmailAddress(View v) {
    editingEmail = true;
    ImageButton cancelButton = (ImageButton) findViewById(R.id.ImageButton_cancelEmailEdit);
    ImageButton saveButton = (ImageButton) findViewById(R.id.EditButton_saveEmail);
    ImageButton editButton = (ImageButton) findViewById(R.id.ImageButton_emailEditIcon);
    // Set visibility of the buttons.
    editButton.setVisibility(View.INVISIBLE);
    saveButton.setVisibility(View.VISIBLE);
    cancelButton.setVisibility(View.VISIBLE);
    EditText emailView = (EditText) findViewById(R.id.EditText_email);
    // Set it so the user can edit the EditText
    emailView.setFocusableInTouchMode(true);
    emailView.setClickable(true);
    emailView.setKeyListener((KeyListener) emailView.getTag());
    emailView.requestFocus();
    emailView.setText("");
    emailView.append(currentUser.getEmail());
}
项目:JotaTextEditor    文件:TextView.java   
/**
 * Sets the key listener to be used with this TextView.  This can be null
 * to disallow user input.  Note that this method has significant and
 * subtle interactions with soft keyboards and other input method:
 * see {@link KeyListener#getInputType() KeyListener.getContentType()}
 * for important details.  Calling this method will replace the current
 * content type of the text view with the content type returned by the
 * key listener.
 * <p>
 * Be warned that if you want a TextView with a key listener or movement
 * method not to be focusable, or if you want a TextView without a
 * key listener or movement method to be focusable, you must call
 * {@link #setFocusable} again after calling this to get the focusability
 * back the way you want it.
 *
 * @attr ref android.R.styleable#TextView_numeric
 * @attr ref android.R.styleable#TextView_digits
 * @attr ref android.R.styleable#TextView_phoneNumber
 * @attr ref android.R.styleable#TextView_inputMethod
 * @attr ref android.R.styleable#TextView_capitalize
 * @attr ref android.R.styleable#TextView_autoText
 */
public void setKeyListener(KeyListener input) {
    setKeyListenerOnly(input);
    fixFocusableAndClickableSettings();

    if (input != null) {
        try {
            mInputType = mInput.getInputType();
        } catch (IncompatibleClassChangeError e) {
            mInputType = EditorInfo.TYPE_CLASS_TEXT;
        }
        if ((mInputType&EditorInfo.TYPE_MASK_CLASS)
                == EditorInfo.TYPE_CLASS_TEXT) {
            if (mSingleLine) {
                mInputType &= ~EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
            } else {
                mInputType |= EditorInfo.TYPE_TEXT_FLAG_MULTI_LINE;
            }
        }
    } else {
        mInputType = EditorInfo.TYPE_NULL;
    }

    InputMethodManager imm = InputMethodManager.peekInstance();
    if (imm != null) imm.restartInput(this);
}
项目:vit-04    文件:TextEntryElement.java   
/** gets the key listener by type */
private static KeyListener getKeyListenerForType(NumericType type) {
    switch (type) {
    case DIALPAD:
        return new DialerKeyListener();
    case INTEGER:
        return new DigitsKeyListener();
    case SIGNED:
        return new DigitsKeyListener(true, false);
    case DECIMAL:
        return new DigitsKeyListener(true, true);
    case NONE:
    default:
        return null;
    }
}
项目:vit-04    文件:TextEntryElement.java   
/** {@inheritDoc} */
@Override
protected View createView(Context c) {
    et = new EditText(c);
    et.setText(answer);
    et.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
            LayoutParams.WRAP_CONTENT));
    if (!NumericType.NONE.equals(numericType)) {
        KeyListener listener = getKeyListenerForType(numericType);
        if (listener != null)
            et.setKeyListener(listener);
    } else {
        et.setRawInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | 
                TYPE_TEXT_FLAG_NO_SUGGESTIONS);
    }
    return encapsulateQuestion(c, et);
}
项目:sana.mobile    文件:TextEntryElement.java   
/** gets the key listener by type */
protected static KeyListener getKeyListenerForType(NumericType type) {
    switch (type) {
    case DIALPAD:
        return new DialerKeyListener();
    case INTEGER:
        return new DigitsKeyListener();
    case SIGNED:
        return new DigitsKeyListener(true, false);
    case DECIMAL:
        return new DigitsKeyListener(true, true);
    case NONE:
    default:
        return null;
    }
}
项目:sana.mobile    文件:TextEntryElement.java   
/** {@inheritDoc} */
@Override
protected View createView(Context c) {
    et = new EditText(c);
    et.setBackgroundResource(R.drawable.oval);
    et.setTextColor(c.getResources()
            .getColorStateList(R.color.primary_text_holo_light));
    et.setText(answer);
    et.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
            LayoutParams.WRAP_CONTENT));
    if (!NumericType.NONE.equals(numericType)) {
        KeyListener listener = getKeyListenerForType(numericType);
        if (listener != null)
            et.setKeyListener(listener);
    } else {
        et.setRawInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES | 
                TYPE_TEXT_FLAG_NO_SUGGESTIONS);
    }
    return encapsulateQuestion(c, et);
}
项目:ModPE-IDE-Source    文件:LModEditor.java   
@Override
public void setReadOnly(boolean value) {
    KeyListener keyListener = getKeyListener();
    if (value) {
        setKeyListener(null);
    } else {
        if (keyListener != null)
            setKeyListener(keyListener);
    }
}
项目:Tada    文件:TextView.java   
private void setKeyListenerOnly(KeyListener input) {
    if (mEditor == null && input == null) return; // null is the default value

    createEditorIfNeeded();
    if (mEditor.mKeyListener != input) {
        mEditor.mKeyListener = input;
        if (input != null && !(mText instanceof Editable)) {
            setText(mText);
        }

        setFilters((Editable) mText, mFilters);
    }
}
项目:topodroid    文件:MyKeyboard.java   
static void setEditable( EditText et, MyKeyboard kbd, KeyListener kl, boolean editable, int flag )
{
  if ( TDSetting.mKeyboard ) {
    et.setKeyListener( null );
    et.setClickable( true );
    et.setFocusable( editable );
    if ( editable ) {
      registerEditText( kbd, et, flag );
      // et.setKeyListener( mKeyboard );
      et.setBackgroundResource( android.R.drawable.edit_text );
    } else {
      registerEditText( kbd, et, flag | FLAG_NOEDIT );
      et.setBackgroundColor( TDColor.MID_GRAY );
    }
  } else {
    if ( editable ) {
      et.setKeyListener( kl );
      et.setBackgroundResource( android.R.drawable.edit_text );
      et.setClickable( true );
      et.setFocusable( true );
    } else {
      // et.setFocusable( false );
      // et.setClickable( false );
      et.setKeyListener( null );
      et.setBackgroundColor( TDColor.MID_GRAY );
    }
  }
}
项目:topodroid    文件:CalibGMDialog.java   
private void setEditable( EditText et, KeyListener kl, boolean editable, int flag )
{
  if ( TDSetting.mKeyboard ) {
    et.setKeyListener( null );
    et.setClickable( true );
    et.setFocusable( editable );
    if ( editable ) {
      MyKeyboard.registerEditText( mKeyboard, et, flag );
      // et.setKeyListener( mKeyboard );
      et.setBackgroundResource( android.R.drawable.edit_text );
    } else {
      MyKeyboard.registerEditText( mKeyboard, et, flag | MyKeyboard.FLAG_NOEDIT );
      et.setBackgroundColor( TDColor.MID_GRAY );
    }
  } else {
    if ( editable ) {
      et.setKeyListener( kl );
      et.setBackgroundResource( android.R.drawable.edit_text );
      et.setClickable( true );
      et.setFocusable( true );
    } else {
      // et.setFocusable( false );
      // et.setClickable( false );
      et.setKeyListener( null );
      et.setBackgroundColor( TDColor.MID_GRAY );
    }
  }
}
项目:JotaTextEditor    文件:TextView.java   
private void setKeyListenerOnly(KeyListener input) {
    mInput = input;
    if (mInput != null && !(mText instanceof Editable))
        setText(mText);

    setFilters((Editable) mText, mFilters);
}
项目:JotaTextEditor    文件:EditableInputConnection.java   
public boolean clearMetaKeyStates(int states) {
    final Editable content = getEditable();
    if (content == null) return false;
    KeyListener kl = mTextView.getKeyListener();
    if (kl != null) {
        try {
            kl.clearMetaKeyState(mTextView, content, states);
        } catch (AbstractMethodError e) {
            // This is an old listener that doesn't implement the
            // new method.
        }
    }
    return true;
}
项目:BluetoothHidEmu    文件:GenericUiControls.java   
/**
 * onKeyDown()
 */
@Override
public boolean processKeyDown(int keyCode, KeyEvent event) {

    if (mEchoEditText != null && (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)) {
        KeyListener keyListener = mEchoEditText.getKeyListener();
        keyListener.onKeyDown(mEchoEditText, mEchoEditText.getEditableText(), keyCode, event);
        return true;
    }
    return false;
}
项目:BluetoothHidEmu    文件:GenericUiControls.java   
/**
 * onKeyUp()
 */
@Override
public boolean processKeyUp(int keyCode, KeyEvent event) {

    if (mEchoEditText != null && (keyCode == KeyEvent.KEYCODE_VOLUME_UP || keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)) {
        KeyListener keyListener = mEchoEditText.getKeyListener();
        keyListener.onKeyUp(mEchoEditText, mEchoEditText.getEditableText(), keyCode, event);
        return true;
    }

    return false;
}
项目:CalcMate    文件:AdvancedDisplay.java   
public void setKeyListener(KeyListener input) {
    mKeyListener = input;
}
项目:AndroidViewHelper    文件:TextViewWrapper.java   
/**
* @see TextView#setKeyListener(KeyListener)
*/
 public W setKeyListener(KeyListener input) {
     mView.setKeyListener(input);
     return (W) this;
 }
项目:Ymir    文件:KeyListenerWrapper.java   
public KeyListenerWrapper(KeyListener internalKeyListener) {
    this(internalKeyListener, 0);
}
项目:Ymir    文件:KeyListenerWrapper.java   
public KeyListenerWrapper(KeyListener internalKeyListener, int inputTypeFlags) {
    this.internalKeyListener = internalKeyListener;
    this.inputTypeFlags = inputTypeFlags;
}
项目:MaterialEditText    文件:MaterialEditText.java   
public MaterialEditText keyListener(KeyListener input) {
    mEditText.setKeyListener(input);
    return this;
}
项目:Tada    文件:TextView.java   
/**
 * Sets the key listener to be used with this TextView.  This can be null
 * to disallow user input.  Note that this method has significant and
 * subtle interactions with soft keyboards and other input method:
 * see {@link KeyListener#getInputType() KeyListener.getContentType()}
 * for important details.  Calling this method will replace the current
 * content type of the text view with the content type returned by the
 * key listener.
 * <p>
 * Be warned that if you want a TextView with a key listener or movement
 * method not to be focusable, or if you want a TextView without a
 * key listener or movement method to be focusable, you must call
 * {@link #setFocusable} again after calling this to get the focusability
 * back the way you want it.
 *
 * @attr ref android.R.styleable#TextView_numeric
 * @attr ref android.R.styleable#TextView_digits
 * @attr ref android.R.styleable#TextView_phoneNumber
 * @attr ref android.R.styleable#TextView_inputMethod
 * @attr ref android.R.styleable#TextView_capitalize
 * @attr ref android.R.styleable#TextView_autoText
 */
public void setKeyListener(KeyListener input) {
    setKeyListenerOnly(input);
    fixFocusableAndClickableSettings();

    if (input != null) {
        createEditorIfNeeded();
        try {
            mEditor.mInputType = mEditor.mKeyListener.getInputType();
        } catch (IncompatibleClassChangeError e) {
            mEditor.mInputType = EditorInfo.TYPE_CLASS_TEXT;
        }
        // Change inputType, without affecting transformation.
        // No need to applySingleLine since mSingleLine is unchanged.
        setInputTypeSingleLine(mSingleLine);
    } else {
        if (mEditor != null) mEditor.mInputType = EditorInfo.TYPE_NULL;
    }

    InputMethodManager imm = InputMethodManager.peekInstance();
    if (imm != null) imm.restartInput(this);
}
项目:Tada    文件:TextView.java   
private void setInputType(int type, boolean direct) {
    final int cls = type & EditorInfo.TYPE_MASK_CLASS;
    KeyListener input;
    if (cls == EditorInfo.TYPE_CLASS_TEXT) {
        boolean autotext = (type & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) != 0;
        TextKeyListener.Capitalize cap;
        if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS) != 0) {
            cap = TextKeyListener.Capitalize.CHARACTERS;
        } else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS) != 0) {
            cap = TextKeyListener.Capitalize.WORDS;
        } else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES) != 0) {
            cap = TextKeyListener.Capitalize.SENTENCES;
        } else {
            cap = TextKeyListener.Capitalize.NONE;
        }
        input = TextKeyListener.getInstance(autotext, cap);
    } else if (cls == EditorInfo.TYPE_CLASS_NUMBER) {
        input = DigitsKeyListener.getInstance(
                (type & EditorInfo.TYPE_NUMBER_FLAG_SIGNED) != 0,
                (type & EditorInfo.TYPE_NUMBER_FLAG_DECIMAL) != 0);
    } else if (cls == EditorInfo.TYPE_CLASS_DATETIME) {
        switch (type & EditorInfo.TYPE_MASK_VARIATION) {
            case EditorInfo.TYPE_DATETIME_VARIATION_DATE:
                input = DateKeyListener.getInstance();
                break;
            case EditorInfo.TYPE_DATETIME_VARIATION_TIME:
                input = TimeKeyListener.getInstance();
                break;
            default:
                input = DateTimeKeyListener.getInstance();
                break;
        }
    } else if (cls == EditorInfo.TYPE_CLASS_PHONE) {
        input = DialerKeyListener.getInstance();
    } else {
        input = TextKeyListener.getInstance();
    }
    setRawInputType(type);
    if (direct) {
        createEditorIfNeeded();
        mEditor.mKeyListener = input;
    } else {
        setKeyListenerOnly(input);
    }
}
项目:topodroid    文件:FixedDialog.java   
@Override
protected void onCreate(Bundle savedInstanceState) 
{
  super.onCreate(savedInstanceState);
  // TDLog.Log( TDLog.LOG_FIXED, "FixedDialog onCreate" );
  initLayout( R.layout.fixed_dialog, R.string.title_fixed_edit );

  mTVlng = (EditText) findViewById( R.id.fix_lng );
  mTVlat = (EditText) findViewById( R.id.fix_lat );
  mTValt = (EditText) findViewById( R.id.fix_alt );
  mTVasl = (EditText) findViewById( R.id.fix_asl );

  mTVdecl = (EditText) findViewById( R.id.fix_decl );
  {
    int year = TopoDroidUtil.year();
    int month = TopoDroidUtil.month();
    int day = TopoDroidUtil.day();
    MagElement elem = mWMM.computeMagElement( mFxd.lat, mFxd.lng, mFxd.alt, year, month, day );
    mTVdecl.setText( String.format(Locale.US, "%.4f", elem.Decl ) );
  }

  mButtonDecl = (CheckBox) findViewById( R.id.fix_save_decl );
  mButtonView = (Button) findViewById( R.id.fix_view );

  mButtonConvert = (Button) findViewById( R.id.fix_convert );
  mTVcrs         = (TextView) findViewById( R.id.fix_crs );
  mTVcs_coords   = (TextView) findViewById( R.id.fix_cs_coords );

  mETstation = (TextView) findViewById( R.id.fix_station );
  mETcomment = (EditText) findViewById( R.id.fix_comment );
  mETstation.setText( mFxd.name );
  mETcomment.setText( mFxd.comment );

  mButtonSave = (Button) findViewById( R.id.fix_save );
  mButtonDrop    = (Button) findViewById(R.id.fix_drop );
  // mButtonOK      = (Button) findViewById(R.id.fix_ok );
  // mButtonCancel  = (Button) findViewById(R.id.fix_cancel );
  int flag = MyKeyboard.FLAG_POINT_DEGREE;
  if ( TDSetting.mUnitLocation == TDConst.DEGREE ) {
    mTVlng.setText( FixedInfo.double2degree( mFxd.lng ) );
    mTVlat.setText( FixedInfo.double2degree( mFxd.lat ) );
  } else { // TDConst.DDMMSS
    mTVlng.setText( FixedInfo.double2ddmmss( mFxd.lng ) );
    mTVlat.setText( FixedInfo.double2ddmmss( mFxd.lat ) );
  }
  mTValt.setText( String.format( Locale.US, "%.0f", mFxd.alt ) );
  mTVasl.setText( String.format( Locale.US, "%.0f", mFxd.asl ) );


  mKeyboard = new MyKeyboard( mContext, (KeyboardView)findViewById( R.id.keyboardview ),
                              R.xml.my_keyboard, -1 );
  if ( TDSetting.mKeyboard ) {
    MyKeyboard.registerEditText( mKeyboard, mTValt, MyKeyboard.FLAG_POINT );
    MyKeyboard.registerEditText( mKeyboard, mTVasl, MyKeyboard.FLAG_POINT );
    MyKeyboard.registerEditText( mKeyboard, mTVlng, flag );
    MyKeyboard.registerEditText( mKeyboard, mTVlat, flag );
    // mKeyboard.hide();
  } else {
    mKeyboard.hide();
  }

  KeyListener mKLlng = mTVlng.getKeyListener();
  KeyListener mKLlat = mTVlat.getKeyListener();
  KeyListener mKLalt = mTValt.getKeyListener();
  KeyListener mKLasl = mTVasl.getKeyListener();

  editable = ( mFxd.source == FixedInfo.SRC_MANUAL );
  MyKeyboard.setEditable( mTValt, mKeyboard, mKLalt, editable, MyKeyboard.FLAG_POINT );
  MyKeyboard.setEditable( mTVasl, mKeyboard, mKLasl, editable, MyKeyboard.FLAG_POINT );
  MyKeyboard.setEditable( mTVlng, mKeyboard, mKLlng, editable, flag );
  MyKeyboard.setEditable( mTVlat, mKeyboard, mKLlat, editable, flag );

  mButtonDrop.setOnClickListener( this );
  mButtonView.setOnClickListener( this );
  mButtonSave.setOnClickListener( this );
  mButtonConvert.setOnClickListener( this );
  // mButtonCancel.setOnClickListener( this );

  showConvertedCoords( );
}
项目:mc_backup    文件:GeckoInputConnection.java   
private boolean processKey(int keyCode, KeyEvent event, boolean down) {
    if (GamepadUtils.isSonyXperiaGamepadKeyEvent(event)) {
        event = GamepadUtils.translateSonyXperiaGamepadKeys(keyCode, event);
        keyCode = event.getKeyCode();
    }

    if (keyCode > KeyEvent.getMaxKeyCode() ||
        !shouldProcessKey(keyCode, event)) {
        return false;
    }
    final int action = down ? KeyEvent.ACTION_DOWN : KeyEvent.ACTION_UP;
    event = translateKey(keyCode, event);
    keyCode = event.getKeyCode();

    View view = getView();
    if (view == null) {
        InputThreadUtils.sInstance.sendEventFromUiThread(ThreadUtils.getUiHandler(),
            mEditableClient, GeckoEvent.createKeyEvent(event, action, 0));
        return true;
    }

    // KeyListener returns true if it handled the event for us. KeyListener is only
    // safe to use on the UI thread; therefore we need to pass a proxy Editable to it
    KeyListener keyListener = TextKeyListener.getInstance();
    Handler uiHandler = view.getRootView().getHandler();
    Editable uiEditable = InputThreadUtils.sInstance.
        getEditableForUiThread(uiHandler, mEditableClient);
    boolean skip = shouldSkipKeyListener(keyCode, event);
    if (down) {
        mEditableClient.setSuppressKeyUp(true);
    }
    if (skip ||
        (down && !keyListener.onKeyDown(view, uiEditable, keyCode, event)) ||
        (!down && !keyListener.onKeyUp(view, uiEditable, keyCode, event))) {
        InputThreadUtils.sInstance.sendEventFromUiThread(uiHandler, mEditableClient,
            GeckoEvent.createKeyEvent(event, action, TextKeyListener.getMetaState(uiEditable)));
        if (skip && down) {
            // Usually, the down key listener call above adjusts meta states for us.
            // However, if we skip that call above, we have to manually adjust meta
            // states so the meta states remain consistent
            TextKeyListener.adjustMetaAfterKeypress(uiEditable);
        }
    }
    if (down) {
        mEditableClient.setSuppressKeyUp(false);
    }
    return true;
}
项目:JotaTextEditor    文件:TextView.java   
private void setInputType(int type, boolean direct) {
    final int cls = type & EditorInfo.TYPE_MASK_CLASS;
    KeyListener input;
    if (cls == EditorInfo.TYPE_CLASS_TEXT) {
        boolean autotext = (type & EditorInfo.TYPE_TEXT_FLAG_AUTO_CORRECT) != 0;
        TextKeyListener.Capitalize cap;
        if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_CHARACTERS) != 0) {
            cap = TextKeyListener.Capitalize.CHARACTERS;
        } else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_WORDS) != 0) {
            cap = TextKeyListener.Capitalize.WORDS;
        } else if ((type & EditorInfo.TYPE_TEXT_FLAG_CAP_SENTENCES) != 0) {
            cap = TextKeyListener.Capitalize.SENTENCES;
        } else {
            cap = TextKeyListener.Capitalize.NONE;
        }
        input = JotaTextKeyListener.getInstance(autotext, cap);
    } else if (cls == EditorInfo.TYPE_CLASS_NUMBER) {
        input = DigitsKeyListener.getInstance(
                (type & EditorInfo.TYPE_NUMBER_FLAG_SIGNED) != 0,
                (type & EditorInfo.TYPE_NUMBER_FLAG_DECIMAL) != 0);
    } else if (cls == EditorInfo.TYPE_CLASS_DATETIME) {
        switch (type & EditorInfo.TYPE_MASK_VARIATION) {
            case EditorInfo.TYPE_DATETIME_VARIATION_DATE:
                input = DateKeyListener.getInstance();
                break;
            case EditorInfo.TYPE_DATETIME_VARIATION_TIME:
                input = TimeKeyListener.getInstance();
                break;
            default:
                input = DateTimeKeyListener.getInstance();
                break;
        }
    } else if (cls == EditorInfo.TYPE_CLASS_PHONE) {
        input = DialerKeyListener.getInstance();
    } else {
        input = JotaTextKeyListener.getInstance();
    }
    setRawInputType(type);
    if (direct) mInput = input;
    else {
        setKeyListenerOnly(input);
    }
}
项目:android-floatinglabel-widgets    文件:FloatingLabelEditText.java   
/**
 * Delegate method for the input widget
 */
public void setInputWidgetKeyListener(KeyListener input) {
    getInputWidget().setKeyListener(input);
}
项目:android-floatinglabel-widgets    文件:FloatingLabelAutoCompleteTextView.java   
/**
 * Delegate method for the input widget
 */
public void setInputWidgetKeyListener(KeyListener input) {
    getInputWidget().setKeyListener(input);
}
项目:android-shared    文件:FloatLabelAutoCompleteTextView.java   
/**
 * Delegate method for the input widget
 */
public void setKeyListener(KeyListener input) {
    getInput().setKeyListener(input);
}
项目:android-shared    文件:FloatLabelEditText.java   
/**
 * Delegate method for the input widget
 */
public void setKeyListener(KeyListener input) {
    getInput().setKeyListener(input);
}
项目:FastValueHolder    文件:ItemBuilder.java   
public ItemBuilder setKeyListener(int viewId, KeyListener input) {
    TextView view = retrieveView(viewId);
    view.setKeyListener(input);
    return this;
}
项目:FastValueHolder    文件:ItemBuilder.java   
public ItemBuilder setKeyListener(int viewId, KeyListener input) {
    TextView view = retrieveView(viewId);
    view.setKeyListener(input);
    return this;
}
项目:com.numix.calculator    文件:AdvancedDisplay.java   
public void setKeyListener(KeyListener input) {
    mKeyListener = input;
}
项目:MDPreference    文件:EditText.java   
/**
    * @return the current key listener for this TextView.
    * This will frequently be null for non-EditText TextViews.
    *
    * @attr ref android.R.styleable#TextView_numeric
    * @attr ref android.R.styleable#TextView_digits
    * @attr ref android.R.styleable#TextView_phoneNumber
    * @attr ref android.R.styleable#TextView_inputMethod
    * @attr ref android.R.styleable#TextView_capitalize
    * @attr ref android.R.styleable#TextView_autoText
    */
public final KeyListener getKeyListener (){
    return mInputView.getKeyListener();
}
项目:MDPreference    文件:EditText.java   
/**
    * Sets the key listener to be used with this TextView.  This can be null
    * to disallow user input.  Note that this method has significant and
    * subtle interactions with soft keyboards and other input method:
    * see {@link KeyListener#getInputType() KeyListener.getContentType()}
    * for important details.  Calling this method will replace the current
    * content type of the text view with the content type returned by the
    * key listener.
    * <p>
    * Be warned that if you want a TextView with a key listener or movement
    * method not to be focusable, or if you want a TextView without a
    * key listener or movement method to be focusable, you must call
    * {@link #setFocusable} again after calling this to get the focusability
    * back the way you want it.
    *
    * @attr ref android.R.styleable#TextView_numeric
    * @attr ref android.R.styleable#TextView_digits
    * @attr ref android.R.styleable#TextView_phoneNumber
    * @attr ref android.R.styleable#TextView_inputMethod
    * @attr ref android.R.styleable#TextView_capitalize
    * @attr ref android.R.styleable#TextView_autoText
    */
public void setKeyListener (KeyListener input){
    mInputView.setKeyListener(input);
}
项目:instalist-android    文件:ViewUtils.java   
/**
 * Retrieve a KeyListener that accepts decimal numbers and dots as separator. Additionally the
 * decimal separator of the current language is accepted.
 *
 * @return An instance of a DigitKeyListener with additional separator.
 */
public static KeyListener getNumberListener() {
    return DigitsKeyListener.getInstance(NUMBERS_AND_SEPARATOR);
}
项目:material-master    文件:EditText.java   
/**
    * @return the current key listener for this TextView.
    * This will frequently be null for non-EditText TextViews.
    *
    * @attr ref android.R.styleable#TextView_numeric
    * @attr ref android.R.styleable#TextView_digits
    * @attr ref android.R.styleable#TextView_phoneNumber
    * @attr ref android.R.styleable#TextView_inputMethod
    * @attr ref android.R.styleable#TextView_capitalize
    * @attr ref android.R.styleable#TextView_autoText
    */
public final KeyListener getKeyListener (){
    return mInputView.getKeyListener();
}
项目:material-master    文件:EditText.java   
/**
    * Sets the key listener to be used with this TextView.  This can be null
    * to disallow user input.  Note that this method has significant and
    * subtle interactions with soft keyboards and other input method:
    * see {@link android.text.method.KeyListener#getInputType() KeyListener.getContentType()}
    * for important details.  Calling this method will replace the current
    * content type of the text view with the content type returned by the
    * key listener.
    * <p>
    * Be warned that if you want a TextView with a key listener or movement
    * method not to be focusable, or if you want a TextView without a
    * key listener or movement method to be focusable, you must call
    * {@link #setFocusable} again after calling this to get the focusability
    * back the way you want it.
    *
    * @attr ref android.R.styleable#TextView_numeric
    * @attr ref android.R.styleable#TextView_digits
    * @attr ref android.R.styleable#TextView_phoneNumber
    * @attr ref android.R.styleable#TextView_inputMethod
    * @attr ref android.R.styleable#TextView_capitalize
    * @attr ref android.R.styleable#TextView_autoText
    */
public void setKeyListener (KeyListener input){
    mInputView.setKeyListener(input);
}
项目:Tada    文件:TextView.java   
/**
 * @return the current key listener for this TextView.
 * This will frequently be null for non-EditText TextViews.
 *
 * @attr ref android.R.styleable#TextView_numeric
 * @attr ref android.R.styleable#TextView_digits
 * @attr ref android.R.styleable#TextView_phoneNumber
 * @attr ref android.R.styleable#TextView_inputMethod
 * @attr ref android.R.styleable#TextView_capitalize
 * @attr ref android.R.styleable#TextView_autoText
 */
public final KeyListener getKeyListener() {
    return mEditor == null ? null : mEditor.mKeyListener;
}
项目:material_fork    文件:EditText.java   
/**
    * @return the current key listener for this TextView.
    * This will frequently be null for non-EditText TextViews.
    *
    * @attr ref android.R.styleable#TextView_numeric
    * @attr ref android.R.styleable#TextView_digits
    * @attr ref android.R.styleable#TextView_phoneNumber
    * @attr ref android.R.styleable#TextView_inputMethod
    * @attr ref android.R.styleable#TextView_capitalize
    * @attr ref android.R.styleable#TextView_autoText
    */
public final KeyListener getKeyListener (){
    return mInputView.getKeyListener();
}
项目:material_fork    文件:EditText.java   
/**
    * Sets the key listener to be used with this TextView.  This can be null
    * to disallow user input.  Note that this method has significant and
    * subtle interactions with soft keyboards and other input method:
    * see {@link android.text.method.KeyListener#getInputType() KeyListener.getContentType()}
    * for important details.  Calling this method will replace the current
    * content type of the text view with the content type returned by the
    * key listener.
    * <p>
    * Be warned that if you want a TextView with a key listener or movement
    * method not to be focusable, or if you want a TextView without a
    * key listener or movement method to be focusable, you must call
    * {@link #setFocusable} again after calling this to get the focusability
    * back the way you want it.
    *
    * @attr ref android.R.styleable#TextView_numeric
    * @attr ref android.R.styleable#TextView_digits
    * @attr ref android.R.styleable#TextView_phoneNumber
    * @attr ref android.R.styleable#TextView_inputMethod
    * @attr ref android.R.styleable#TextView_capitalize
    * @attr ref android.R.styleable#TextView_autoText
    */
public void setKeyListener (KeyListener input){
    mInputView.setKeyListener(input);
}