Exemple #1
0
 /// <inheritdoc/>
 void IMessageSubscriber <UltravioletMessageID> .ReceiveMessage(UltravioletMessageID type, MessageData data)
 {
     if (type == UltravioletMessages.TextInputRegionChanged)
     {
         unsafe
         {
             var service = SoftwareKeyboardService.Create();
             var region  = service.TextInputRegion;
             if (region.HasValue)
             {
                 var rect = new SDL_Rect()
                 {
                     x = region.Value.X,
                     y = region.Value.Y,
                     w = region.Value.Width,
                     h = region.Value.Height,
                 };
                 SDL.SetTextInputRect(&rect);
             }
             else
             {
                 SDL.SetTextInputRect(null);
             }
         }
     }
 }
Exemple #2
0
        /// <summary>
        /// Updates the text input region so that this control will be panned into view while
        /// the software keyboard is open.
        /// </summary>
        private void UpdateTextInputRegion(Boolean clear = false)
        {
            var service = SoftwareKeyboardService.Create();

            service.TextInputRegion = clear ? (Ultraviolet.Rectangle?) null:
                                      (Ultraviolet.Rectangle)Display.DipsToPixels(CalculateTransformedVisualBounds());
        }
Exemple #3
0
        public CarouselViewRenderer()
        {
            var activity = Forms.Context as Activity;

            keyboardService = new SoftwareKeyboardService(activity);
        }