Android Use Done button on Keyboard to click button

You can use this one also (sets a special listener to be called when an action is performed on the EditText), it works both for DONE and RETURN: max.setOnEditorActionListener(new OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) { Log.i(TAG,”Enter … Read more

How to disable emojis programmatically in Android

Try this it’s works for me editText.setFilters(new InputFilter[]{new EmojiExcludeFilter()}); private class EmojiExcludeFilter implements InputFilter { @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { for (int i = start; i < end; i++) { int type = Character.getType(source.charAt(i)); if (type == Character.SURROGATE || type == Character.OTHER_SYMBOL) { return … Read more

Android adjustpan not working after the first time

This may seem a bit silly but I ran into this problem when I set the property gravity of my EditText to either ‘center_horizontal’ or ‘center’. The same problem occurs when using textAlignment ‘center’. Remove it and you won’t run into the problem of the keyboard hiding the EditText the second time (and subsequent ones) … Read more

Android: How to push button above soft keyboard

You need to set your keyboard’s input mode to adjustResize. You can do this adding the following line to your activity’s attributes in the manifest: android:windowSoftInputMode=”adjustResize” Here’s an example of the attribute added in the activity: <activity android:name=”.activity.MyActivity” android:windowSoftInputMode=”adjustResize”> </activity>

Show entire bottom sheet with EditText above Keyboard

Just reposting @jblejder from this question Keyboard hides BottomSheetDialogFragment since it worked for me, to make it easier for others to find: The most convenient way that I found to change this is by creating style: <style name=”DialogStyle” parent=”Theme.Design.Light.BottomSheetDialog”> <item name=”android:windowIsFloating”>false</item> <item name=”android:statusBarColor”>@android:color/transparent</item> <item name=”android:windowSoftInputMode”>adjustResize</item> </style> And set this in onCreate method of your BottomSheetDialogFragment: … Read more