Member-only story
Android EditText: avoid showing software keyboard on focus
Have you ever needed an EditText to not showing the software keyboard when it gets tapped?
May it be because you have a custom input method for that field or whatever reason you have, you can easily achieve it by calling the setShowSoftInputOnFocus method on an EditText or if you prefer the Kotlin way
myEditText.showSoftInputOnFocus = false
This is ok if your project targets android API 21 (Android 5.0) or above but what happens when it comes to backward compatibility?
The said method is only public on API 21+ but it is private on lower API levels so you'll have to try and use reflection in order to achieve the same behaviour.
So YouTube could just do something like this:
Furthermore on Android API 15 the method have a different signature thus you have to hack it a bit and are another condition: