Skip to content

Commit

Permalink
Update: subcategory enhancement nextcloud#1154 solved
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottieKim committed Jun 24, 2021
1 parent 7d12408 commit 3cbc54a
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,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 3cbc54a

Please sign in to comment.