ViewSizer

  • ViewSizer is an interface used to control the size of a ViewRenderable within a Sceneform Scene.

  • It provides a mechanism to calculate the desired size of an Android View in meters for 3D placement.

  • The final rendered size is influenced by both the ViewSizer and the Node's world scale.

  • getSize() is the core method, taking an Android View and returning a Vector3 representing its dimensions in the scene.

  • Several pre-built implementations exist, like FixedHeightViewSizer, FixedWidthViewSizer, and DpToMetersViewSizer, offering different approaches to sizing.

public interface ViewSizer
Known Indirect Subclasses

Interface for controlling the size of a ViewRenderable in the Scene. The final size that the view is displayed at will be the size from this ViewSizer scaled by the getWorldScale() of the Node that the ViewRenderable is attached to.

Public Methods

abstract Vector3
getSize(View view)
Calculates the desired size of the view in the Scene.

Public Methods

public abstract Vector3 getSize (View view)

Calculates the desired size of the view in the Scene. x represents the width, and y represents the height.

Parameters
view the view to calculate the size of
Returns
  • a new vector that represents the view's size in the Scene