Package 

Class Spacing


  • 
    public class Spacing
    
                        

    Class representing CSS spacing (padding, margin, and borders). This is mostly necessary to properly implement interactions and updates for properties like margin, marginLeft, and marginHorizontal.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      public final static int LEFT
      public final static int TOP
      public final static int RIGHT
      public final static int BOTTOM
      public final static int START
      public final static int END
      public final static int HORIZONTAL
      public final static int VERTICAL
      public final static int ALL
    • Method Summary

      Modifier and Type Method Description
      boolean set(int spacingType, float value) Set a spacing value.
      float get(int spacingType) Get the spacing for a direction.
      float getRaw(int spacingType) Get the raw value (that was set using set), without taking into accountany default values.
      void reset() Resets the spacing instance to its default state.
      • Methods inherited from class java.lang.Object

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

      • Spacing

        Spacing()
      • Spacing

        Spacing(float defaultValue)
      • Spacing

        Spacing(Spacing original)
    • Method Detail

      • set

         boolean set(int spacingType, float value)

        Set a spacing value.

        Parameters:
        spacingType - one of LEFT, TOP, RIGHT, BOTTOM, , HORIZONTAL, ALL
        value - the value for this direction
      • get

         float get(int spacingType)

        Get the spacing for a direction. This takes into account any default values that have been set.

        Parameters:
        spacingType - one of LEFT, TOP, RIGHT, BOTTOM
      • getRaw

         float getRaw(int spacingType)

        Get the raw value (that was set using set), without taking into accountany default values.

        Parameters:
        spacingType - one of LEFT, TOP, RIGHT, BOTTOM, , HORIZONTAL, ALL
      • reset

         void reset()

        Resets the spacing instance to its default state. This method is meant to be used whenrecycling Spacing instances.