Example #1
0
        public static void Focus(this AView platformView, FocusRequest request)
        {
            request.IsFocused = true;

            // Android does the actual focus/unfocus work on the main looper
            // So in case we're setting the focus in response to another control's un-focusing,
            // we need to post the handling of it to the main looper so that it happens _after_ all the other focus
            // work is done; otherwise, a call to ClearFocus on another control will kill the focus we set

            var q = Looper.MyLooper();

            if (q != null)
            {
                new Handler(q).Post(RequestFocus);
            }
            else
            {
                MainThread.InvokeOnMainThreadAsync(RequestFocus);
            }

            void RequestFocus()
            {
                if (platformView == null || platformView.IsDisposed())
                {
                    return;
                }

                platformView?.RequestFocus();
            }
        }
        public void newFocusRequest(int applicationId)
        {
            focusRequestCount++;
            var request = new FocusRequest(focusRequestCount, applicationId);

            focusRequests.Enqueue(request);
        }
Example #3
0
        public static ICommand RequestFocus(this IEditor editor, FocusKind value, Point?location)
        {
            var req = new FocusRequest();

            req.Value    = value;
            req.Location = location;
            return(editor.PerformRequest(req));
        }
Example #4
0
        public static void Focus(this AView platformView, FocusRequest request)
        {
            // Android does the actual focus/unfocus work on the main looper
            // So in case we're setting the focus in response to another control's un-focusing,
            // we need to post the handling of it to the main looper so that it happens _after_ all the other focus
            // work is done; otherwise, a call to ClearFocus on another control will kill the focus we set here
            MainThread.BeginInvokeOnMainThread(() =>
            {
                if (platformView == null || platformView.IsDisposed())
                {
                    return;
                }

                platformView?.RequestFocus();
            });
        }
Example #5
0
 private void SetText(IEnumerable <TwitterAccount> infos,
                      string body,
                      TwitterStatus inReplyTo,
                      CursorPosition cursor,
                      bool focusToInputArea)
 {
     CurrentInputData = new InputData(body)
     {
         Accounts  = infos,
         InReplyTo = inReplyTo,
     };
     SetCursorRequest.SafeInvoke(cursor ?? CursorPosition.End);
     if (focusToInputArea)
     {
         FocusRequest.SafeInvoke();
     }
 }
Example #6
0
 private void SetDirectMessage(IEnumerable <TwitterAccount> infos,
                               [NotNull] TwitterUser recipient,
                               bool focusToInputArea)
 {
     if (recipient == null)
     {
         throw new ArgumentNullException("recipient");
     }
     CurrentInputData = new InputData(String.Empty)
     {
         Accounts         = infos,
         MessageRecipient = recipient
     };
     // because text is always empty, setting cursor position can be skipped.
     if (focusToInputArea)
     {
         FocusRequest.SafeInvoke();
     }
 }
Example #7
0
        private void SetFocus(FocusRequest req)
        {
            switch (req)
            {
            case FocusRequest.Search:
                SearchFlipViewModel.FocusToSearchBox();
                break;

            case FocusRequest.Timeline:
                SearchFlipViewModel.Close();
                var ctab = TabManager.CurrentFocusTab;
                if (ctab != null)
                {
                    ctab.RequestFocus();
                }
                break;

            case FocusRequest.Input:
                SearchFlipViewModel.Close();
                this.InputViewModel.OpenInput();
                this.InputViewModel.FocusToTextBox();
                break;
            }
        }
 private void SetFocus(FocusRequest req)
 {
     switch (req)
     {
         case FocusRequest.Search:
             SearchFlipViewModel.FocusToSearchBox();
             break;
         case FocusRequest.Timeline:
             SearchFlipViewModel.Close();
             var ctab = TabManager.CurrentFocusTab;
             if (ctab != null)
             {
                 ctab.RequestFocus();
             }
             break;
         case FocusRequest.Input:
             SearchFlipViewModel.Close();
             this.InputViewModel.OpenInput();
             this.InputViewModel.FocusToTextBox();
             break;
     }
 }
 private void SetFocus(FocusRequest req)
 {
     switch (req)
     {
         case FocusRequest.Search:
             SearchFlipViewModel.FocusToSearchBox();
             break;
         case FocusRequest.Timeline:
             TabManager.CurrentFocusTab.RequestFocus();
             SearchFlipViewModel.Close();
             break;
         case FocusRequest.Input:
             InputAreaViewModel.OpenInput();
             InputAreaViewModel.FocusToTextBox();
             SearchFlipViewModel.Close();
             break;
     }
 }
Example #10
0
 private static void SetEventPropagation()
 {
     _core.SetCursorRequest += arg => SetCursorRequest.SafeInvoke(arg);
     _core.FocusRequest     += () => FocusRequest.SafeInvoke();
     _core.CloseRequest     += () => CloseRequest.SafeInvoke();
 }
Example #11
0
 public static void SetFocusTo(FocusRequest req)
 {
     FocusRequested.SafeInvoke(req);
 }
Example #12
0
 public static void SetFocusTo(FocusRequest req)
 {
     FocusRequested.SafeInvoke(req);
 }
Example #13
0
 public static void Focus(this FrameworkElement platformView, FocusRequest request)
 {
     // TODO: Implement Focus on Windows.
 }
Example #14
0
 public static void Focus(this UIView platformView, FocusRequest request)
 {
     platformView.BecomeFirstResponder();
 }
Example #15
0
 public static void Focus(this object platformView, FocusRequest request)
 {
 }
Example #16
0
 public static void SetFocusTo(FocusRequest req)
 {
     var handler = FocusRequested;
     if (handler != null)
         handler(req);
 }
Example #17
0
 public static void Focus(this EvasObject platformView, FocusRequest request)
 {
     // TODO: Implement Focus on Tizen (ref #4588)
 }
Example #18
0
 public static void Focus(this FrameworkElement platformView, FocusRequest request)
 {
     request.IsFocused = platformView.Focus(FocusState.Programmatic);
 }