Defines the physical parameters of a screen to be used with a Cardboard-compatible device.
Public Constructors
ScreenParams(Display display)
|
Public Methods
staticScreenParams |
createFromInputStream(Display display, InputStream inputStream)
|
boolean | |
float | |
int | |
float | |
int |
getWidth()
|
float | |
void |
setBorderSizeMeters(float screenBorderSize)
|
void |
setHeight(int height)
|
void |
setWidth(int width)
|
String |
toString()
|
Inherited Methods
Public Constructors
public ScreenParams (Display display)
Initializes parameters to default values.
Public Methods
public static ScreenParams createFromInputStream (Display display, InputStreaminputStream)
Initializes the screen parameters from an InputStream
.
Caller is responsible for closing stream.
Parameters
inputStream | input stream containing phone params. |
---|
Returns
- A new ScreenParams object or
null
in case of error.
public boolean equals (Object other)
Compares this instance with the specified object and indicates if they are equal.
Parameters
other | The object to compare this instance with. |
---|
Returns
true
if the objects are equal,false
otherwise.
public float getBorderSizeMeters ()
Returns the screen border size.
Returns
- The screen border size in meters.
public int getHeight ()
Returns the screen height in pixels.
Returns
- The screen height in pixels.
public float getHeightMeters ()
Returns the screen height in meters.
Returns
- The screen height in meters.
public int getWidth ()
Returns the screen width in pixels.
Returns
- The screen width in pixels.
public float getWidthMeters ()
Returns the screen width in meters.
Returns
- The screen width in meters.
public void setBorderSizeMeters (float screenBorderSize)
Size of the border around the device screen.
Offset in meters from the bottom side of the inserted device to the bottom of the screen. Normally a small border of a few millimeters height when the device is in landscape position.
Parameters
screenBorderSize | The screen border size in meters. |
---|
public void setHeight (int height)
Sets the screen height in pixels.
Parameters
height | The screen width in pixels. |
---|
public void setWidth (int width)
Sets the screen width in pixels.
Parameters
width | The screen size in pixels. |
---|
public String toString ()
Returns a string containing a concise, human-readable description of this object.
Returns
- A printable representation of this object.