Skip to content

Instantly share code, notes, and snippets.

@BenDol
Last active August 28, 2017 23:12
Show Gist options
  • Save BenDol/4ebb7f7c6de063ac2d1290748213fad9 to your computer and use it in GitHub Desktop.
Save BenDol/4ebb7f7c6de063ac2d1290748213fad9 to your computer and use it in GitHub Desktop.
ViewPort.when(Resolution.ALL_MOBILE, Resolution.LAPTOP)
// match // fallback
.then((portChange) -> GWT.log(portChange.getResolution()), (width, height) -> GWT.log("fallback for " + width + " " + height));
ViewPort.when(Resolution.ALL_MOBILE, Resolution.LAPTOP)
// match
.then((portChange) -> GWT.log(portChange.getResolution()));
ViewPort.when(Resolution.ALL_MOBILE)
.or(Resolution.LAPTOP)
// match // fallback
.then((portChange) -> GWT.log(portChange.getResolution()), (width, height) -> GWT.log("fallback for " + width + " " + height));
ViewPort.when(Resolution.ALL_MOBILE)
.or(Resolution.LAPTOP)
// match // fallback
.then((portChange) -> GWT.log(portChange.getResolution()), (width, height) -> GWT.log("fallback for " + width + " " + height))
.or(Resolution.TABLET)
// match // fallback
.then((portChange) -> GWT.log(portChange.getResolution()), (width, height) -> GWT.log("fallback for " + width + " " + height));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment