Skip to content

Commit

Permalink
Resize dialog with keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sudonatalie committed Jul 19, 2020
1 parent 3a77d5b commit eb9a88f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.SearchView;
import android.widget.SpinnerAdapter;
Expand Down Expand Up @@ -73,6 +74,9 @@ private AlertDialog createDialog() {
.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.dismiss());
AlertDialog dialog = builder.create();

// Resize with soft keyboard
dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

// Set dialog adapter
IngredientAdapter dialogAdapter = new IngredientAdapter(ingredients, pos -> {
setSelection(pos);
Expand Down

0 comments on commit eb9a88f

Please sign in to comment.