File tree 1 file changed +3
-8
lines changed
app/src/main/java/it/niedermann/owncloud/notes/edit/title
1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -61,20 +61,15 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
61
61
.setView (dialogView )
62
62
.setCancelable (false )
63
63
.setPositiveButton (R .string .action_edit_save , (dialog , which ) -> {
64
- hideKeyboard (dialogView .findViewById ( R . id . title ). getWindowToken ());
64
+ hideKeyboard (dialogView .getWindowToken ());
65
65
listener .onTitleEdited (binding .title .getText ().toString ());
66
66
})
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 ()))
73
68
.create ();
74
69
}
75
70
76
71
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 );
78
73
inputManager .hideSoftInputFromWindow (windowToken , InputMethodManager .HIDE_NOT_ALWAYS );
79
74
}
80
75
You can’t perform that action at this time.
0 commit comments