android.inputmethodservice.KeyboardView Java Examples
The following examples show how to use
android.inputmethodservice.KeyboardView.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RemoteKeyboardService.java From remotekeyboard with Apache License 2.0 | 5 votes |
@Override public View onCreateInputView() { KeyboardView ret = new KeyboardView(this, null); ret.setKeyboard(new Keyboard(this, R.xml.keyboarddef)); ret.setOnKeyboardActionListener(this); ret.setPreviewEnabled(false); return ret; }
Example #2
Source File: SecKeyboardView.java From AndroidSecurityKeyboard with Apache License 2.0 | 5 votes |
public SecKeyboardView(Activity act, final EditText editText, KeyboardView keyboardView) { Activity activity = act; this.ed = editText; this.mKeyboardView = keyboardView; alphabetKeyBoard = new Keyboard(activity, R.xml.qwerty); numberKeyBoard = new Keyboard(activity, R.xml.number); symbolKeyBoard = new Keyboard(activity, R.xml.symbols); mImm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE); mKeyboardView.setKeyboard(alphabetKeyBoard); mKeyboardView.setEnabled(true); mKeyboardView.setPreviewEnabled(false); mKeyboardView.setOnKeyboardActionListener(listener); editText.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (!b) { hideKeyboard(); } else { mImm.hideSoftInputFromWindow(view.getWindowToken(), 0); //强制隐藏键盘 } } }); editText.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { int inputType = editText.getInputType(); hideSoftInputMethod(editText); showKeyboard(); editText.setInputType(inputType); return false; } }); }
Example #3
Source File: MainActivityDemo.java From AndroidSecurityKeyboard with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mPassword = (EditText) findViewById(R.id.password_edit); mKeyboardView = (KeyboardView)findViewById(com.kejiwen.securitykeyboardlibrary.R.id.keyboard_view); new SecKeyboardView(this, mPassword,mKeyboardView); }
Example #4
Source File: KeyboardUtil.java From quickmark with MIT License | 5 votes |
public KeyboardUtil(Activity act, Context ctx, EditText edit, String typemode) { this.ctx = ctx; this.ed = edit; this.act = act; this.typemode = typemode; k2 = new Keyboard(ctx, R.xml.symbols_num); keyboardView = (KeyboardView) act.findViewById(R.id.keyboard_view); keyboardView.setEnabled(true); keyboardView.setKeyboard(k2); keyboardView.setPreviewEnabled(false); keyboardView.setOnKeyboardActionListener(listener); }
Example #5
Source File: PinFragment.java From green_android with GNU General Public License v3.0 | 5 votes |
@Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { mIsSixDigit = getArguments() == null || getArguments().getBoolean("is_six_digit", true); // Disable android keyboard getGaActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); final View rootView; if (mIsSixDigit) { // PIN fixed at six digits length rootView = inflater.inflate(R.layout.fragment_pin_six_digits, container, false); mPinEntryView = UI.find(rootView, R.id.pin_entry); mPinEntryView.requestFocus(); mPinEntryView.disableKeyboard(); mPinEntryView.setOnPinEnteredListener(pin -> afterPinInserted()); mPinEntryView.setOnTouchListener((view, motionEvent) -> true); // prevent keyboard from popping out } else { // long pin text (supported for upgrading existing installs) rootView = inflater.inflate(R.layout.fragment_pin_text, container, false); mPinLongText = UI.find(rootView, R.id.pinText); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) // API 21 mPinLongText.setShowSoftInputOnFocus(false); else mPinLongText.setTextIsSelectable(true); mPinButton = UI.mapClick(rootView, R.id.pinLoginButton, this); } // Load custom keyboard final KeyboardView kv = UI.find(rootView, R.id.keyboardView); kv.setKeyboard(new Keyboard(getActivity(), R.xml.keyboard)); kv.setOnKeyboardActionListener(this); kv.setPreviewEnabled(false); return rootView; }
Example #6
Source File: DSL.java From anvil with MIT License | 4 votes |
public static Void onKeyboardAction(KeyboardView.OnKeyboardActionListener arg) { return BaseDSL.attr("onKeyboardAction", arg); }
Example #7
Source File: EntryKeyboardView.java From bither-android with Apache License 2.0 | 4 votes |
private TextView getPreviewText() throws Exception { Field field = KeyboardView.class.getDeclaredField("mPreviewText"); field.setAccessible(true); return (TextView) field.get(this); }
Example #8
Source File: EntryKeyboardView.java From bither-android with Apache License 2.0 | 4 votes |
private void setShadowRadius(float radius) throws Exception { Field field = KeyboardView.class.getDeclaredField("mShadowRadius"); field.setAccessible(true); field.setFloat(this, radius); }
Example #9
Source File: EntryKeyboardView.java From bither-android with Apache License 2.0 | 4 votes |
private void setShadowColor(int color) throws Exception { Field field = KeyboardView.class.getDeclaredField("mShadowColor"); field.setAccessible(true); field.setInt(this, color); }
Example #10
Source File: EntryKeyboardView.java From bither-android with Apache License 2.0 | 4 votes |
private int getKeyTextColor() throws Exception { Field field = KeyboardView.class.getDeclaredField("mKeyTextColor"); field.setAccessible(true); return field.getInt(this); }
Example #11
Source File: EntryKeyboardView.java From bither-android with Apache License 2.0 | 4 votes |
private Paint getPaint() throws Exception { Field field = KeyboardView.class.getDeclaredField("mPaint"); field.setAccessible(true); return (Paint) field.get(this); }
Example #12
Source File: DSL.java From anvil with MIT License | 4 votes |
public static Void onKeyboardAction(KeyboardView.OnKeyboardActionListener arg) { return BaseDSL.attr("onKeyboardAction", arg); }
Example #13
Source File: DSL.java From anvil with MIT License | 4 votes |
public static Void keyboardView(Anvil.Renderable r) { return BaseDSL.v(KeyboardView.class, r); }
Example #14
Source File: DSL.java From anvil with MIT License | 4 votes |
public static BaseDSL.ViewClassResult keyboardView() { return BaseDSL.v(KeyboardView.class); }
Example #15
Source File: DSL.java From anvil with MIT License | 4 votes |
public static Void keyboardView(Anvil.Renderable r) { return BaseDSL.v(KeyboardView.class, r); }
Example #16
Source File: DSL.java From anvil with MIT License | 4 votes |
public static BaseDSL.ViewClassResult keyboardView() { return BaseDSL.v(KeyboardView.class); }
Example #17
Source File: PersistentSearchView.java From PersistentSearchView with Apache License 2.0 | 4 votes |
public void setCustomKeyboardView(KeyboardView customKeyboardView) { mCustomKeyboardView = customKeyboardView; }
Example #18
Source File: NiboPlacesAutoCompleteSearchView.java From Nibo with MIT License | 4 votes |
public void setCustomKeyboardView(KeyboardView customKeyboardView) { mCustomKeyboardView = customKeyboardView; }
Example #19
Source File: OnCustomKeyboardActionListener.java From SSForms with GNU General Public License v3.0 | 4 votes |
public OnCustomKeyboardActionListener(AppCompatEditText myEditText, KeyboardView mKeyboardView) { this.myEditText = myEditText; this.mKeyboardView = mKeyboardView; }