예제 #1
0
 public ChatInputKeyboardDelegate(ChatInputView chatInputView)
 {
     _chatInputView    = new WeakReferenceEx <ChatInputView>(chatInputView);
     _willShowObserver = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillShowNotification, (notification) =>
     {
         if (!KeyBoardOpened)
         {
             TryInvokeOpenKeyboardEvent(notification);
         }
     });
     _willHideObserver = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillHideNotification, (notification) =>
     {
         if (KeyBoardOpened)
         {
             KeyBoardOpened = false;
             KeyboardHeightChanged?.Invoke(0);
         }
     });
     _willChangeFrameObserver = NSNotificationCenter.DefaultCenter.AddObserver(UIKeyboard.WillChangeFrameNotification, (notification) =>
     {
         if (KeyBoardOpened)
         {
             TryInvokeOpenKeyboardEvent(notification);
         }
     });
 }
예제 #2
0
        public ChatInputScrollViewDelegate(ChatInputView chatInputView, UIScrollView scrollView, nfloat scrollViewBottomMargin)
        {
            _scrollView             = new WeakReferenceEx <UIScrollView>(scrollView);
            _chatInputView          = chatInputView;
            _scrollViewBottomMargin = scrollViewBottomMargin;

            _chatInputView.KeyboardDelegate.KeyboardHeightChanged += KeyboardDelegate_KeyboardHeightChanged;
        }