Interface KeyboardService

  • All Known Implementing Classes:
    AndroidKeyboardService, DummyKeyboardService, IOSKeyboardService

    public interface KeyboardService
    With the keyboard service, you can query the height of the software keyboard, whenever it becomes visible.

    Example

     Services.get(KeyboardService.class).ifPresent(service -> {
          service.visibleHeightProperty().addListener((obs, ov, nv) ->
              System.out.println("height: " + nv));
      });

    Android Configuration: none

    iOS Configuration: none

    Since:
    4.0.7
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static java.util.Optional<KeyboardService> create()
      Returns an instance of KeyboardService.
      void keepVisibilityForNode​(javafx.scene.Node node)
      Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it.
      void keepVisibilityForNode​(javafx.scene.Node node, javafx.scene.Parent parent)
      Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it
      javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty()
      Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
    • Method Detail

      • keepVisibilityForNode

        void keepVisibilityForNode​(javafx.scene.Node node)
        Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it. For that, the root parent will be moved accordingly.
        Parameters:
        node - the Node to adjust, so it is always visible
      • keepVisibilityForNode

        void keepVisibilityForNode​(javafx.scene.Node node,
                                   javafx.scene.Parent parent)
        Node is adjusted vertically when software keyboard shows up, so it is visible and not covered by it
        Parameters:
        node - the Node to adjust, so it is always visible
        parent - the Parent of the node that will be moved
      • visibleHeightProperty

        javafx.beans.property.ReadOnlyFloatProperty visibleHeightProperty()
        Gets the visible height of the Keyboard, so scene or views can adjusted to prevent some of their content from being covered by the keyboard.
        Returns:
        A ReadOnlyFloatProperty with the height of the soft keyboard