Bug 1196914 - Don't scroll to focused input unless the IME went away and came back. r=rbarker

This commit is contained in:
Kartikaya Gupta
2015-08-21 08:52:11 -04:00
parent 6f9dfd8a6c
commit 5740126bd6

View File

@@ -2391,12 +2391,20 @@ public class GeckoAppShell
return HardwareUtils.isTablet();
}
private static boolean sImeWasEnabledOnLastResize = false;
public static void viewSizeChanged() {
LayerView v = getLayerView();
if (v != null && v.isIMEEnabled()) {
if (v == null) {
return;
}
boolean imeIsEnabled = v.isIMEEnabled();
if (imeIsEnabled && !sImeWasEnabledOnLastResize) {
// The IME just came up after not being up, so let's scroll
// to the focused input.
sendEventToGecko(GeckoEvent.createBroadcastEvent(
"ScrollTo:FocusedInput", ""));
}
sImeWasEnabledOnLastResize = imeIsEnabled;
}
@WrapForJNI(stubName = "GetCurrentNetworkInformationWrapper")