Package 

Class Size

  • All Implemented Interfaces:

    
    public final class Size
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Size.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
      Size(Integer sizeInDp, Float mass, Float massVariance)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer getSizeInDp() the size of the confetti in dip
      final Float getMass() each size can have its own mass for slightly different behavior.
      final Float getMassVariance() create slight randomness how particles react to gravity.
      • Methods inherited from class java.lang.Object

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

      • getMass

         final Float getMass()

        each size can have its own mass for slightly different behavior. For example, the closer the mass is to zero the easier it will accelerate but the slower it will will fall down due to gravity.

      • getMassVariance

         final Float getMassVariance()

        create slight randomness how particles react to gravity. This variance is a percentage based on mass. The higher the variance the bigger the difference in mass between each particle is. Default is 0.2f for a slight difference in mass for each particle.