Class DpToMetersViewSizer
- java.lang.Object
-
- com.google.ar.sceneform.rendering.DpToMetersViewSizer
-
- All Implemented Interfaces:
ViewSizer
public class DpToMetersViewSizer extends java.lang.Object implements ViewSizer
Controls the size of aViewRenderable
in aScene
by defining how many dp (density-independent pixels) there are per meter. This is recommended when using an android layout that is built using dp.
-
-
Constructor Summary
Constructors Constructor Description DpToMetersViewSizer(int dpPerMeters)
Constructor for creating a sizer for controlling the size of aViewRenderable
by defining how many dp there are per meter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDpPerMeters()
Returns the number of dp (density-independent pixels) there are per meter that is used for controlling the size of aViewRenderable
.Vector3
getSize(android.view.View view)
Calculates the desired size of the view in theScene
.
-
-
-
Constructor Detail
-
DpToMetersViewSizer
public DpToMetersViewSizer(int dpPerMeters)
Constructor for creating a sizer for controlling the size of aViewRenderable
by defining how many dp there are per meter.- Parameters:
dpPerMeters
- a number greater than zero representing the ratio of dp to meters
-
-
Method Detail
-
getDpPerMeters
public int getDpPerMeters()
Returns the number of dp (density-independent pixels) there are per meter that is used for controlling the size of aViewRenderable
.
-
-