private static void askToSave() { if (!hasSaved) { askToSaveGroup_STATIC.alpha = 1; askToSaveGroup_STATIC.interactable = true; askToSaveGroup_STATIC.blocksRaycasts = true; } else { KeyboardVisible.invisibleKeyboard(); } }
public void OnGlobalLayout() { // navigation bar height int navigationBarHeight = 0; int resourceId = Resources.GetIdentifier("navigation_bar_height", "dimen", "android"); if (resourceId > 0) { navigationBarHeight = Resources.GetDimensionPixelSize(resourceId); } // status bar height int statusBarHeight = 0; resourceId = Resources.GetIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { statusBarHeight = Resources.GetDimensionPixelSize(resourceId); } // display window size for the app layout Rect rect = new Rect(); Window.DecorView.GetWindowVisibleDisplayFrame(rect); // screen height - (user app height + status + nav) ..... if non-zero, then there is a soft keyboard int keyboardHeight = rootLayout.RootView.Height - (statusBarHeight + navigationBarHeight + rect.Height()); if (keyboardHeight <= 0) { KeyboardHide?.Invoke(this, EventArgs.Empty); } else { KeyboardVisible?.Invoke(this, keyboardHeight); } }