/// <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); } } } }
/// <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()); }
public CarouselViewRenderer() { var activity = Forms.Context as Activity; keyboardService = new SoftwareKeyboardService(activity); }