2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-02 03:40:16 +00:00

[fenix] For https://github.com/mozilla-mobile/fenix/issues/21744: Replace InputMethodManager's deprecated toggleSoftInput.

This commit is contained in:
mcarare 2022-01-11 16:54:12 +02:00 committed by mergify[bot]
parent e297e494c2
commit de520bc77a
2 changed files with 2 additions and 4 deletions

View File

@ -465,8 +465,7 @@ class SearchDialogFragment : AppCompatDialogFragment(), UserInteractionHandler {
if (!dialogHandledAction) {
val imm =
requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
@Suppress("DEPRECATION")
imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0)
imm.hideSoftInputFromWindow(view?.windowToken, InputMethodManager.HIDE_IMPLICIT_ONLY)
}
}

View File

@ -110,8 +110,7 @@ class AddLoginFragment : Fragment(R.layout.fragment_add_login) {
binding.hostnameText.requestFocus()
val imm =
requireContext().getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
@Suppress("DEPRECATION")
imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, 0)
imm.showSoftInput(binding.hostnameText, InputMethodManager.SHOW_IMPLICIT)
binding.clearHostnameTextButton.setOnClickListener {
binding.hostnameText.text?.clear()