Skip to content

Commit 3cbc54a

Browse files
committed
Update: subcategory enhancement #1154 solved
1 parent 7d12408 commit 3cbc54a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

app/src/main/java/it/niedermann/owncloud/notes/edit/title/EditTitleDialogFragment.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,20 +61,15 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
6161
.setView(dialogView)
6262
.setCancelable(false)
6363
.setPositiveButton(R.string.action_edit_save, (dialog, which) -> {
64-
hideKeyboard(dialogView.findViewById(R.id.title).getWindowToken());
64+
hideKeyboard(dialogView.getWindowToken());
6565
listener.onTitleEdited(binding.title.getText().toString());
6666
})
67-
.setNegativeButton(R.string.simple_cancel, new DialogInterface.OnClickListener() {
68-
@Override
69-
public void onClick(DialogInterface dialogInterface, int i) {
70-
hideKeyboard(dialogView.findViewById(R.id.title).getWindowToken());
71-
}
72-
})
67+
.setNegativeButton(R.string.simple_cancel, (dialog, which) -> hideKeyboard(dialogView.getWindowToken()))
7368
.create();
7469
}
7570

7671
private void hideKeyboard(IBinder windowToken) {
77-
InputMethodManager inputManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
72+
final InputMethodManager inputManager = (InputMethodManager) requireContext().getSystemService(Context.INPUT_METHOD_SERVICE);
7873
inputManager.hideSoftInputFromWindow(windowToken, InputMethodManager.HIDE_NOT_ALWAYS);
7974
}
8075

0 commit comments

Comments
 (0)