Esempio n. 1
0
        public void OnGlobalLayout()
        {
            Rect displayFrame = new Rect();

            _drawerLayout.GetWindowVisibleDisplayFrame(displayFrame);
            int screenHeight = _drawerLayout.RootView.Height;
            int keypadHeight = screenHeight - displayFrame.Bottom;

            _keyboardProvider.ScreenHeight = screenHeight;

            Log.Debug("", "keypadHeight = " + keypadHeight);
            if (keypadHeight > screenHeight * 0.15)
            {
                keyboardOpened = true;
                _keyboardProvider.KeyboardHeight = keypadHeight;
                _keyboardProvider.OnKeyboardOpened();
            }
            else
            {
                if (keyboardOpened)
                {
                    _keyboardProvider.KeyboardHeight = 0;
                    _keyboardProvider.OnKeyboardClosed();
                    keyboardOpened = false;
                }
            }
        }