Beispiel #1
0
 public void onEmojiClicked()
 {
     FIZZMainThreadExecutor.Queue(() => {
         FIZZKeyboard.ResetAndroidKeyboardObject();
         FIZZKeyboard.OnEmojiClicked();
     });
 }
Beispiel #2
0
        void ActivateKeyboard()
        {
#if UNITY_IPHONE && !UNITY_EDITOR
            _handleTouches = true;
            FIZZTouchScreenKeyboard.SetCustomMessage(true, OnMessageCallback, OnStickerCallback);
            if (_keyboard == null)
            {
                string _initialText = (_message.Equals(_placeholderText)) ? string.Empty : _message;
                _keyboard = FIZZTouchScreenKeyboard.Open(_initialText, FIZZTouchScreenKeyboardType.Default, true, true, false, false, _placeholderText);
            }
            else
            {
                _keyboard.active = true;
            }

            DeviceOrientation deviceOrientation = FizzUI.Instance.CanvasScaler.Orientation;
            if ((deviceOrientation == DeviceOrientation.PortraitUpsideDown || deviceOrientation == DeviceOrientation.Portrait) &&
                nodeToMove != null)
            {
                _moveUI = true;
            }
#elif UNITY_ANDROID && !UNITY_EDITOR
            _handleTouches = true;

            RemoveAllAndroidKBListener();
            FIZZKeyboard.OnDoneButtonPress = OnDoneButtonPress;
            FIZZKeyboard.OnCancel          = OnCancel;
            FIZZKeyboard.OnKeyboardClose   = OnKeyboardClose;
            FIZZKeyboard.OnKeyboardOpen    = OnKeyboardOpen;
            FIZZKeyboard.OnEmojiClicked    = OnEmojiClicked;

            string _initialText = (_message.Equals(_placeholderText)) ? string.Empty : _message;
            FIZZKeyboard.ShowKeyboard(_initialText, _placeholderText, false);
#endif
        }
Beispiel #3
0
 public void onKeyboardClose()
 {
     FIZZMainThreadExecutor.Queue(() => {
         FIZZKeyboard.ResetAndroidKeyboardObject();
         FIZZKeyboard.OnKeyboardClose();
     });
 }
Beispiel #4
0
 public void onKeyboardOpen(float height)
 {
     FIZZMainThreadExecutor.Queue(() => {
         FIZZKeyboard.GetKeyboardJavaObject();
         FIZZKeyboard.OnKeyboardOpen(height);
     });
 }
Beispiel #5
0
        public void OnKeyboardClose()
        {
            FIZZKeyboard.ResetAndroidKeyboardObject();

            RemoveAllAndroidKBListener();

            _handleTouches = false;
            MoveScrollNode(Vector2.down, rect.sizeDelta.y, 1);
        }
Beispiel #6
0
        void OnApplicationPause(bool pauseState)
        {
            if (pauseState)
            {
#if UNITY_IOS && !UNITY_EDITOR
                DeactivateKeyboard();
#elif UNITY_ANDROID && !UNITY_EDITOR
                //NOTHING to do anything. Android widget handle itself
                FIZZKeyboard.HideKeyboard();
#endif
            }
        }
Beispiel #7
0
        void OnDisable()
        {
            sendButton.onClick.RemoveListener(OnSend);

#if UNITY_EDITOR || UNITY_STANDALONE
            inputEditor.onDone.RemoveListener(OnSend);
            inputEditor.onSelect.RemoveListener(OnInputFieldSelect);
            inputEditor.onDeselect.RemoveListener(OnInputFieldDeselect);
#else
            inputMobile.GetComponent <Button> ().onClick.RemoveListener(ActivateKeyboard);
#endif

            FizzService.Instance.OnConnected    -= OnFizzConnected;
            FizzService.Instance.OnDisconnected -= OnFizzDisconnected;

#if UNITY_IPHONE && !UNITY_EDITOR
            DeactivateKeyboard();
#elif UNITY_ANDROID && !UNITY_EDITOR
            FIZZKeyboard.HideKeyboard();
#endif
        }
Beispiel #8
0
 public void OnKeyboardOpen(float height)
 {
     FIZZKeyboard.GetKeyboardJavaObject();
     MoveScrollNode(Vector2.up, height, FizzUI.Instance.CanvasScaler.ReferenceResolutionRatio);
 }
Beispiel #9
0
 public void onDoneButtonPress(string text)
 {
     FIZZMainThreadExecutor.Queue(() => {
         FIZZKeyboard.OnDoneButtonPress(text);
     });
 }
Beispiel #10
0
 public void onCancel(string text)
 {
     FIZZMainThreadExecutor.Queue(() => {
         FIZZKeyboard.OnCancel(text);
     });
 }