com.androidplot.ui
Class SizeMetrics

java.lang.Object
  extended by com.androidplot.ui.SizeMetrics

public class SizeMetrics
extends Object

Encapsulates sizing preferences associated with a Widget; how/if it scales etc.


Constructor Summary
SizeMetrics(float height, SizeLayoutType heightLayoutType, float width, SizeLayoutType widthLayoutType)
          Convenience constructor.
SizeMetrics(SizeMetric heightMetric, SizeMetric widthMetric)
          Creates a new SizeMetrics instance using the specified size layout algorithm and value.
 
Method Summary
 SizeMetric getHeightMetric()
           
 android.graphics.RectF getRectF(android.graphics.RectF canvasRect)
          Calculates a RectF with calculated width and height.
 android.graphics.RectF getRoundedRect(android.graphics.RectF canvasRect)
          Same as getRectF but with edges rounded to the nearest full pixel.
 SizeMetric getWidthMetric()
           
 void setHeightMetric(SizeMetric heightMetric)
           
 void setWidthMetric(SizeMetric widthMetric)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeMetrics

public SizeMetrics(float height,
                   SizeLayoutType heightLayoutType,
                   float width,
                   SizeLayoutType widthLayoutType)
Convenience constructor. Wraps SizeMetrics(SizeMetric, SizeMetric).

Parameters:
height - Height value used algorithm to calculate the height of the associated widget(s).
heightLayoutType - Algorithm used to calculate the height of the associated widget(s).
width - Width value used algorithm to calculate the width of the associated widget(s).
widthLayoutType - Algorithm used to calculate the width of the associated widget(s).

SizeMetrics

public SizeMetrics(SizeMetric heightMetric,
                   SizeMetric widthMetric)
Creates a new SizeMetrics instance using the specified size layout algorithm and value. See SizeMetric for details on what can be passed in.

Parameters:
heightMetric -
widthMetric -
Method Detail

getHeightMetric

public SizeMetric getHeightMetric()

setHeightMetric

public void setHeightMetric(SizeMetric heightMetric)

getWidthMetric

public SizeMetric getWidthMetric()

getRectF

public android.graphics.RectF getRectF(android.graphics.RectF canvasRect)
Calculates a RectF with calculated width and height. The top-left corner is set to 0,0.

Parameters:
canvasRect -
Returns:

getRoundedRect

public android.graphics.RectF getRoundedRect(android.graphics.RectF canvasRect)
Same as getRectF but with edges rounded to the nearest full pixel.

Parameters:
canvasRect -
Returns:

setWidthMetric

public void setWidthMetric(SizeMetric widthMetric)


Copyright © 2010-2013 androidplot.com. All Rights Reserved.