public interface Viewport
Represents a viewport defined as per the CSS specifications.
The Viewport, together with the CSSCanvas, has a similar role to
the W3C's Screen, with the big difference that some of the information
that Screen provides is in fact available from the StyleDatabase.
-
Method Summary
Modifier and TypeMethodDescriptionfloatGets the width of the scrollbar that appears when a box overflows with scroll.intThe viewport height, in natural units.intThe viewport width, in natural units.booleanTests whether the device is currently landscape or portrait.
-
Method Details
-
getViewportHeight
int getViewportHeight()The viewport height, in natural units.- Returns:
- the viewport height.
-
getViewportWidth
int getViewportWidth()The viewport width, in natural units.- Returns:
- the viewport width.
-
isLandscape
boolean isLandscape()Tests whether the device is currently landscape or portrait.- Returns:
trueif the device is currently landscape,falseotherwise.
-
getScrollbarWidth
float getScrollbarWidth()Gets the width of the scrollbar that appears when a box overflows with scroll.- Returns:
- the width of the scrollbar.
-