googlevr / gvr-android-sdk

Google VR SDK for Android
http://developers.google.com/vr/android/
Other
3.28k stars 1.28k forks source link

Soft keyboard showing when in VR mode #545

Closed bluemarvin closed 6 years ago

bluemarvin commented 6 years ago

I just upgraded our application that was using 1.120 to 1.130 and now anytime a Text Edit View gets focus, the system soft keyboard covers the screen. Is this a regression or do I need to do something additional to prevent the keyboard from showing. For context we are drawing native android ui elements offscreen to a surface texture for displaying in our 3D scene.

jdduke commented 6 years ago

I'm not aware of any specific change that might have caused this. Are you using the GVR SDK directly, or one of the engines (Unity/Unreal)? Is your application manifest identical to what is was previously?

bluemarvin commented 6 years ago

It is a native app using the GVR SDK directly. I just tried to verify that 1.130 was the cause but now I can reproduce on 1.120 as well. Something must have changed in my app but I don't see anything obvious. I've tried adding android:windowSoftInputMode="stateAlwaysHidden" to the activity with no effect. So I guess while upgrading to 1.130 is not the issue the fact that the soft keyboard is covering the VR window is still an issue.

bluemarvin commented 6 years ago

One additional data point: My app application can switch between a Launcher activity and a Daydream activity. If I switch back and forth once, the soft keyboard seems to stop showing in VR mode when giving focus to a text edit view.

sigmaxipi commented 6 years ago

@bluemarvin this is an Android framework issue since GVR doesn't do anything special for the Android IME. Consider overriding the TextView with a custom class that handles all the focus events. Or you might be able to use TextInputView.setInputType to avoid bringing up the keyboard.

jdduke commented 6 years ago

Yeah, you might also try explicitly/programatically adjusting focus when the Daydream Activity is shown. Feel free to re-open the issue if you think this is specific to Daydream.

bluemarvin commented 6 years ago

For anyone else that run into this issue. TextView.setShowSoftInputOnFocus(false) seems to work.