Interface UltraliteSDK.ScrollingTextView

Enclosing interface:
UltraliteSDK

public static interface UltraliteSDK.ScrollingTextView
ScrollingTextView is used to perform optimized text drawing to the Ultralite display. Before a ScrollingTextView can be used, the Ultralite layout should be set to SCROLL. Otherwise ScrollingTextView methods won't do anything. Glasses control is also required for all ScrollingTextView methods.
Since:
1.4.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    This enumeration lists actions that are valid while an app has control and has selected the SCROLL layout.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum number of slices into which the screen can be divided using ScrollingTextView Note: not all slices must be visible.
    static final int
    Maximum height of any single slice.
    static final int
    Minimum number of slices into which the screen can be divided using ScrollingTextView Note: not all slices must be visible.
    static final int
    Minimum height of any single slice.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    After requesting control to SCROLL layout and populating with image data, this removes all content from the screen.
    void
    clear(int slicePosition)
    After requesting control to SCROLL layout and populating with image data, this removes one selected slice from the screen.
    void
    Deprecated.
    Beginning in SDK 1.7.0 please use one of the following method calls instead:
    setPaused(boolean)
    scrollNow()
    clear()
    void
    scrollLayoutConfig(int sliceHeight, int numSlicesVisible, int animationDurationMs, boolean autoScroll)
    Deprecated.
    Beginning in 1.7.0 please use scrollLayoutConfig(int, int, int, int, boolean) to also control the minSlicePositionVisible.
    void
    scrollLayoutConfig(int sliceHeight, int minSlicePositionVisible, int numSlicesVisible, int animationDurationMs, boolean autoScroll)
    After requesting control to SCROLL layout, scrollLayoutConfig must be called to configure the image slices.
    void
    After requesting control to SCROLL layout and configuring scrollLayoutConfig(int, int, int, int, boolean) with autoScroll false, this will manually request the contents to scroll by one position.
    void
    sendScrollImage(LVGLImage image, int slicePosition, boolean scrollFirst)
    After sending scrollLayoutConfig, this will set the screen content according to those configured parameters.
    void
    setPaused(boolean pause)
    After requesting control to SCROLL layout and configuring scrollLayoutConfig(int, int, int, int, boolean) with autoScroll true, this will pause and resume the automatic scrolling behavior.
    void
    validateScrollParameters(int sliceHeight, int minSlicePositionVisible, int numSlicesVisible)
    Utility method to check the paramters intended for scrollLayoutConfig(int, int, int, int, boolean).
  • Field Details

    • MIN_NUM_SLICES

      static final int MIN_NUM_SLICES
      Minimum number of slices into which the screen can be divided using ScrollingTextView Note: not all slices must be visible.
      Since:
      1.7.0
      See Also:
    • MAX_NUM_SLICES

      static final int MAX_NUM_SLICES
      Maximum number of slices into which the screen can be divided using ScrollingTextView Note: not all slices must be visible.
      Since:
      1.7.0
      See Also:
    • MIN_SLICE_HEIGHT

      static final int MIN_SLICE_HEIGHT
      Minimum height of any single slice.
      Since:
      1.7.0
      See Also:
    • MAX_SLICE_HEIGHT

      static final int MAX_SLICE_HEIGHT
      Maximum height of any single slice.
      Since:
      1.7.0
      See Also:
  • Method Details

    • validateScrollParameters

      void validateScrollParameters(int sliceHeight, int minSlicePositionVisible, int numSlicesVisible) throws IllegalArgumentException
      Utility method to check the paramters intended for scrollLayoutConfig(int, int, int, int, boolean). This is called internally to throw exceptions if the parameters do not work together. Clients do not need to directly call this, but are welcome to.
      Parameters:
      sliceHeight - The number of pixels high for each slice (all slices are the same). Range: [30-120] pixels.This divides the screen into between 4 and 16 slices, and leaves any remainder unusable.
      minSlicePositionVisible - The index of the lowest slice that will be visble. Use 0 to begin rendering at the lowest position possible. Use higher values to create a "mask" below the starting position. Text will appear from under that mask as if coming from off-screen. Min=0, Max=((480/sliceHeight)-1).
      numSlicesVisible - The number of slices. Min=1. Max=((480/sliceHeight)-minSlicePositionVisible). Having fewer slices shown increases the animation quality.
      Throws:
      IllegalArgumentException
    • scrollLayoutConfig

      void scrollLayoutConfig(int sliceHeight, int numSlicesVisible, int animationDurationMs, boolean autoScroll)
      Deprecated.
      Beginning in 1.7.0 please use scrollLayoutConfig(int, int, int, int, boolean) to also control the minSlicePositionVisible.
      After requesting control to SCROLL layout, scrollLayoutConfig must be called to configure the image slices.
      Parameters:
      sliceHeight - The number of pixels high for each slice (all slices are the same). Range: [30-120] pixels.This divides the screen into between 4 and 16 slices, and leaves any remainder unusable.
      numSlicesVisible - The number of slices. Min=1. Max=(480/sliceHeight). Having fewer slices shown increases the animation quality.
      animationDurationMs - The duration in milliseconds over which we animate text moving between positions. Value 0 indicates instantaneous movement rather than animation.
      autoScroll - True will automatically scroll every animationDurationMs
      Since:
      1.4.0
      See Also:
    • scrollLayoutConfig

      void scrollLayoutConfig(int sliceHeight, int minSlicePositionVisible, int numSlicesVisible, int animationDurationMs, boolean autoScroll)
      After requesting control to SCROLL layout, scrollLayoutConfig must be called to configure the image slices.
      Parameters:
      sliceHeight - The number of pixels high for each slice (all slices are the same). Range: [30-120] pixels.This divides the screen into between 4 and 16 slices, and leaves any remainder unusable.
      minSlicePositionVisible - The index of the lowest slice that will be visble. Use 0 to begin rendering at the lowest position possible. Use higher values to create a "mask" below the starting position. Text will appear from under that mask as if coming from off-screen. Min=0, Max=((480/sliceHeight)-1).
      numSlicesVisible - The number of slices. Min=1. Max=((480/sliceHeight)-minSlicePositionVisible). Having fewer slices shown increases the animation quality.
      animationDurationMs - The duration in milliseconds over which we animate text moving between positions. Value 0 indicates instantaneous movement rather than animation.
      autoScroll - True will automatically scroll every animationDurationMs
      Since:
      1.7.0
      See Also:
    • sendScrollImage

      void sendScrollImage(@NonNull LVGLImage image, int slicePosition, boolean scrollFirst)
      After sending scrollLayoutConfig, this will set the screen content according to those configured parameters.
      Parameters:
      image - - A image slice. Must be size SCREEN_WIDTH x sliceHeight and should contain a single line of text rendered as an image.
      slicePosition - - The position from 0 (bottom) to numSlicesVisible-1 (top) to place the image.
      scrollFirst - - Commonly used when not configured for autoScroll. This causes the screen buffers to rotate one position prior to updating the image data. After* rotating, the bottom slice (position 0) is guaranteed empty.
      Since:
      1.4.0
    • scrollAction

      Deprecated.
      Beginning in SDK 1.7.0 please use one of the following method calls instead:
      setPaused(boolean)
      scrollNow()
      clear()
      After requesting control to SCROLL layout and populating with image data, this sends an explicit control to the buffer behavior.
      Parameters:
      action - The action to perform
      Since:
      1.4.0
      See Also:
    • setPaused

      void setPaused(boolean pause)
      After requesting control to SCROLL layout and configuring scrollLayoutConfig(int, int, int, int, boolean) with autoScroll true, this will pause and resume the automatic scrolling behavior.
      Parameters:
      pause - True to request scrolling to pause. False to request scrolling to resume;
      Since:
      1.7.0
    • scrollNow

      void scrollNow()
      After requesting control to SCROLL layout and configuring scrollLayoutConfig(int, int, int, int, boolean) with autoScroll false, this will manually request the contents to scroll by one position.
      Since:
      1.7.0
    • clear

      void clear()
      After requesting control to SCROLL layout and populating with image data, this removes all content from the screen.
      Since:
      1.7.0
    • clear

      void clear(int slicePosition)
      After requesting control to SCROLL layout and populating with image data, this removes one selected slice from the screen.
      Parameters:
      slicePosition - - The position from 0 (bottom) to numSlicesVisible-1 (top) to clear to black.
      Since:
      1.7.0