Package 

Class Fit


  • 
    public class Fit
    
                        

    Describes how size differences are handled between an authored Rive artboard and its containing view.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public final class Fit.Layout

      Invokes the Rive layout engine to apply responsive layout to the artboard. This assumes that the artboard was designed with layouts in mind.

      public final class Fit.Contain

      Preserve aspect ratio and scale the artboard so that its larger dimension matches the corresponding dimension of the containing view.

      If aspect ratios are not identical, this will leave space on the larger axis.

      public final class Fit.ScaleDown

      Preserve aspect ratio and behave like Fit.Contain when the artboard is larger than the containing view. Otherwise, use the artboard's original dimensions.

      public final class Fit.Cover

      Preserve aspect ratio and scale the artboard so that its smaller dimension matches the corresponding dimension of the containing view.

      If aspect ratios are not identical, this will clip the artboard on the larger dimension.

      public final class Fit.FitWidth

      Preserve aspect ratio and scale the artboard width to match the containing view's width.

      If the aspect ratios between the artboard and containing view do not match, this will result in either vertical clipping or space in the vertical axis.

      public final class Fit.FitHeight

      Preserve aspect ratio and scale the artboard height to match the containing view's height.

      If the aspect ratios between the artboard and containing view do not match, this will result in either horizontal clipping or space in the horizontal axis.

      public class Fit.Fill

      Do not preserve aspect ratio and stretch to the containing view's dimensions.

      public final class Fit.None

      Do not scale. Use the artboard's original dimensions.

      For either dimension, if the artboard's dimension is larger, it will be clipped. If it is smaller, it will leave space.

    • Method Summary

      Modifier and Type Method Description
      Alignment getAlignment() Default alignment.
      Float getScaleFactor() Default scale factor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getAlignment

         Alignment getAlignment()

        Default alignment. Not relevant for all fit modes, but still passed when drawing or on pointer events.