Keyboard hides BottomSheetDialogFragment

I found the solution for 27 api. So the reason why keyboard hides view even with SOFT_INPUT_ADJUST_RESIZE is that the windowIsFloating is set for Dialogs. 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 …

Read more

AlertDialog with EditText, open soft keyboard automatically with focus on EditText doesn’t work

Ok I managed to get it working: Builder builder = new Builder(this); final EditText input = new EditText(this); builder .setTitle(R.string.dialog_title_addsubject) .setMessage(R.string.dialog_addsubject) .setView(input) .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { String value = input.getText().toString(); if (input.getText().toString().trim().length() == 0) { Toast.makeText(Main.this, R.string.input_empty, Toast.LENGTH_SHORT).show(); } else { db.insertSubject(value); getData(); } InputMethodManager imm = (InputMethodManager) …

Read more

How to resize AlertDialog on the Keyboard display

If your dialog was an activity using one of the Dialog themes you could effect this behavior by setting the adjustResize flag for the windowSoftInputMode parameter of the activity. I’m using: android:windowSoftInputMode=”adjustResize|stateHidden” I think you can still use this flag with regular dialogs, but I’m not sure how to apply it. You may have to …

Read more

Android show softkeyboard with showSoftInput is not working?

When the activity launches It seems that the keyboard is initially displayed but hidden by something else, because the following works (but is actually a dirty work-around): First Method InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); editText.postDelayed(new Runnable() { @Override public void run() { editText.requestFocus(); imm.showSoftInput(editText, 0); } }, 100); Second method in onCreate to launch it …

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 EditText, soft keyboard show/hide event?

Hi I’d used following workaround: As far as my content view is a subclass of LinearLayout (could be any other view or view group), I’d overridden onMeasure method lilke following: @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { final int proposedheight = MeasureSpec.getSize(heightMeasureSpec); final int actualHeight = getHeight(); if (actualHeight > proposedheight){ // Keyboard is …

Read more

adjustPan not preventing keyboard from covering EditText

After doing a lot of searching apparently it’s what I’m calling a bug. If you use the fullscreen tag (to remove the status bar from the activity) you can’t use “adjustResize” without wrapping the activity in a ScrollView. Unfortunately for me I’m using a ListView which would create yet another problem. I’m sick of messing …

Read more