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

pull/600/head
mcarare 3 years ago committed by mergify[bot]
parent e297e494c2
commit de520bc77a

@ -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)
}
}

@ -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()

Loading…
Cancel
Save