diff --git a/app/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt index a6726774c96..e939d9afbb4 100755 --- a/app/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/player/state/StateFragmentPresenter.kt @@ -438,9 +438,8 @@ class StateFragmentPresenter @Inject constructor( val inputManager: InputMethodManager = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager inputManager.hideSoftInputFromWindow( - fragment.view!!.windowToken, - @Suppress("DEPRECATION") // TODO(#5406): Use the correct constant value here. - InputMethodManager.SHOW_FORCED + fragment.requireView().windowToken, + 0 // Flag value to force hide the keyboard when possible. ) } diff --git a/app/src/main/java/org/oppia/android/app/survey/SurveyFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/survey/SurveyFragmentPresenter.kt index 062a4d3864e..cbcfb397e0a 100644 --- a/app/src/main/java/org/oppia/android/app/survey/SurveyFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/survey/SurveyFragmentPresenter.kt @@ -333,9 +333,8 @@ class SurveyFragmentPresenter @Inject constructor( val inputManager: InputMethodManager = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager inputManager.hideSoftInputFromWindow( - fragment.view!!.windowToken, - @Suppress("DEPRECATION") // TODO(#5406): Use the correct constant value here. - InputMethodManager.SHOW_FORCED + fragment.requireView().windowToken, + 0 // Flag value to force hide the keyboard when possible. ) } diff --git a/app/src/main/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerFragmentPresenter.kt b/app/src/main/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerFragmentPresenter.kt index 78a978ba51c..e78221853c5 100644 --- a/app/src/main/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerFragmentPresenter.kt +++ b/app/src/main/java/org/oppia/android/app/topic/questionplayer/QuestionPlayerFragmentPresenter.kt @@ -314,9 +314,8 @@ class QuestionPlayerFragmentPresenter @Inject constructor( val inputManager: InputMethodManager = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager inputManager.hideSoftInputFromWindow( - fragment.view!!.windowToken, - @Suppress("DEPRECATION") // TODO(#5406): Use the correct constant value here. - InputMethodManager.SHOW_FORCED + fragment.requireView().windowToken, + 0 // Flag value to force hide the keyboard when possible. ) }