Skip to content

Commit

Permalink
Update: subcategory enhancement #1154 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottieKim authored and AndyScherzinger committed Jan 21, 2024
1 parent f70ff8a commit 7794790
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,15 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
.setView(dialogView)
.setCancelable(false)
.setPositiveButton(R.string.action_edit_save, (dialog, which) -> {
hideKeyboard(dialogView.findViewById(R.id.title).getWindowToken());
hideKeyboard(dialogView.getWindowToken());
listener.onTitleEdited(binding.title.getText().toString());
})
.setNegativeButton(R.string.simple_cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
hideKeyboard(dialogView.findViewById(R.id.title).getWindowToken());
}
})
.setNegativeButton(R.string.simple_cancel, (dialog, which) -> hideKeyboard(dialogView.getWindowToken()))
.create();
}

private void hideKeyboard(IBinder windowToken) {
InputMethodManager inputManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
final InputMethodManager inputManager = (InputMethodManager) requireContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.hideSoftInputFromWindow(windowToken, InputMethodManager.HIDE_NOT_ALWAYS);
}

Expand Down

0 comments on commit 7794790

Please sign in to comment.