Skip to content

Commit 7794790

Browse files
ScottieKimAndyScherzinger
authored andcommitted
Update: subcategory enhancement #1154 solved
1 parent f70ff8a commit 7794790

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
@@ -65,20 +65,15 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
6565
.setView(dialogView)
6666
.setCancelable(false)
6767
.setPositiveButton(R.string.action_edit_save, (dialog, which) -> {
68-
hideKeyboard(dialogView.findViewById(R.id.title).getWindowToken());
68+
hideKeyboard(dialogView.getWindowToken());
6969
listener.onTitleEdited(binding.title.getText().toString());
7070
})
71-
.setNegativeButton(R.string.simple_cancel, new DialogInterface.OnClickListener() {
72-
@Override
73-
public void onClick(DialogInterface dialogInterface, int i) {
74-
hideKeyboard(dialogView.findViewById(R.id.title).getWindowToken());
75-
}
76-
})
71+
.setNegativeButton(R.string.simple_cancel, (dialog, which) -> hideKeyboard(dialogView.getWindowToken()))
7772
.create();
7873
}
7974

8075
private void hideKeyboard(IBinder windowToken) {
81-
InputMethodManager inputManager = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
76+
final InputMethodManager inputManager = (InputMethodManager) requireContext().getSystemService(Context.INPUT_METHOD_SERVICE);
8277
inputManager.hideSoftInputFromWindow(windowToken, InputMethodManager.HIDE_NOT_ALWAYS);
8378
}
8479

0 commit comments

Comments
 (0)