private void initOrientationChange() { if (orientationChangeInitialized != null) return; orientationChangeInitialized = this.addJQMEventHandler(JQMComponentEvents.ORIENTATIONCHANGE, new JQMOrientationChangeHandler() { @Override public void onEvent(JQMEvent<?> event) { int h = Window.getClientHeight(); int w = Window.getClientWidth(); String s = JQMOrientationChangeHandler.Process.getOrientation(event); // iOS and Android give opposite values (iOS - already rotated, Android - not yet rotated) if (JQMOrientationChangeHandler.LANDSCAPE.equals(s)) { initialWindowHeight = Math.min(w, h); } else if (JQMOrientationChangeHandler.PORTRAIT.equals(s)) { initialWindowHeight = Math.max(w, h); } //Window.alert(s + ", height: " + initialWindowHeight); if (hideFixedToolbarsIfVirtualKeyboard > 0) { refreshPartsPositioning(); } } }); }
private void initOrientationChange() { if (orientationChangeInitialized != null) return; orientationChangeInitialized = this.addJQMEventHandler(JQMComponentEvents.ORIENTATIONCHANGE, new JQMOrientationChangeHandler() { @Override public void onEvent(JQMEvent<?> event) { int h = Window.getClientHeight(); int w = Window.getClientWidth(); String s = JQMOrientationChangeHandler.Process.getOrientation(event); // iOS and Android give opposite values (iOS - already rotated, Android - not yet rotated) if (JQMOrientationChangeHandler.LANDSCAPE.equals(s)) { initialWindowHeight = Math.min(w, h); } else if (JQMOrientationChangeHandler.PORTRAIT.equals(s)) { initialWindowHeight = Math.max(w, h); } //Window.alert(s + ", height: " + initialWindowHeight); if (hideFixedToolbarsIfVirtualKeyboard > 0) { refreshPartsPositioning(); } } }); }
private void initOrientationChange() { if (orientationChangeInitialized != null) return; orientationChangeInitialized = this.addJQMEventHandler(JQMComponentEvents.ORIENTATIONCHANGE, new JQMOrientationChangeHandler() { @Override public void onEvent(JQMEvent<?> event) { int h = Window.getClientHeight(); int w = Window.getClientWidth(); String s = JQMOrientationChangeHandler.Process.getOrientation(event); // iOS and Android give opposite values (iOS - already rotated, Android - not yet rotated) if (JQMOrientationChangeHandler.LANDSCAPE.equals(s)) { initialWindowHeight = Math.min(w, h); } else if (JQMOrientationChangeHandler.PORTRAIT.equals(s)) { initialWindowHeight = Math.max(w, h); } //Window.alert(s + ", height: " + initialWindowHeight); if (hideFixedToolbarsIfVirtualKeyboard > 0) { refreshPartsPositioning(); } } }); }