diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-10-16 13:48:15 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-10-16 13:48:47 +0300 |
commit | 9e769462bd09483c1ccfde452bc679ea54a5d85e (patch) | |
tree | ddca2585fefccf6ab7382503465ca5aa2bcfa48f /shared | |
parent | 6290daf788d6a96afaae4d6db058762b713af291 (diff) | |
parent | e157228948d4583951cad358b77e8ab27990e5e5 (diff) | |
download | vaadin-framework-9e769462bd09483c1ccfde452bc679ea54a5d85e.tar.gz vaadin-framework-9e769462bd09483c1ccfde452bc679ea54a5d85e.zip |
Merge remote-tracking branch 'origin/master' into grid
Change-Id: I7462e5a6a902eb0c4396bc14216a6f323dd33b76
Diffstat (limited to 'shared')
-rw-r--r-- | shared/src/com/vaadin/shared/VBrowserDetails.java | 26 | ||||
-rw-r--r-- | shared/src/com/vaadin/shared/ui/datefield/Resolution.java | 8 |
2 files changed, 28 insertions, 6 deletions
diff --git a/shared/src/com/vaadin/shared/VBrowserDetails.java b/shared/src/com/vaadin/shared/VBrowserDetails.java index 3c89bdb6bb..a85d031c49 100644 --- a/shared/src/com/vaadin/shared/VBrowserDetails.java +++ b/shared/src/com/vaadin/shared/VBrowserDetails.java @@ -43,6 +43,8 @@ public class VBrowserDetails implements Serializable { private boolean isIE = false; private boolean isWindowsPhone; + private boolean isIPad; + private boolean isIPhone; private OperatingSystem os = OperatingSystem.UNKNOWN; @@ -176,8 +178,9 @@ public class VBrowserDetails implements Serializable { } else if (userAgent.contains("macintosh") || userAgent.contains("mac osx") || userAgent.contains("mac os x")) { - if (userAgent.contains("ipad") || userAgent.contains("ipod") - || userAgent.contains("iphone")) { + isIPad = userAgent.contains("ipad"); + isIPhone = userAgent.contains("iphone"); + if (isIPad || userAgent.contains("ipod") || isIPhone) { os = OperatingSystem.IOS; parseIOSVersion(userAgent); } else { @@ -431,6 +434,7 @@ public class VBrowserDetails implements Serializable { * Tests if the browser is run on Windows Phone. * * @return true if run on Windows Phone, false otherwise + * @since 7.3.2 */ public boolean isWindowsPhone() { return isWindowsPhone; @@ -473,6 +477,24 @@ public class VBrowserDetails implements Serializable { } /** + * Tests if the browser is run on iPhone. + * + * @return + */ + public boolean isIPhone() { + return isIPhone; + } + + /** + * Tests if the browser is run on iPad. + * + * @return + */ + public boolean isIPad() { + return isIPad; + } + + /** * Returns the major version of the operating system. Currently only * supported for mobile devices (iOS/Android) * diff --git a/shared/src/com/vaadin/shared/ui/datefield/Resolution.java b/shared/src/com/vaadin/shared/ui/datefield/Resolution.java index 6d467e233c..689db11188 100644 --- a/shared/src/com/vaadin/shared/ui/datefield/Resolution.java +++ b/shared/src/com/vaadin/shared/ui/datefield/Resolution.java @@ -16,7 +16,6 @@ package com.vaadin.shared.ui.datefield; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; /** @@ -26,8 +25,9 @@ import java.util.List; * @since 7.0 */ public enum Resolution { - SECOND(Calendar.SECOND), MINUTE(Calendar.MINUTE), HOUR(Calendar.HOUR_OF_DAY), DAY( - Calendar.DAY_OF_MONTH), MONTH(Calendar.MONTH), YEAR(Calendar.YEAR); + // Values from Calendar.SECOND etc. Set as ints to avoid Calendar dependency + // (does not exist on the client side) + SECOND(13), MINUTE(12), HOUR(11), DAY(5), MONTH(2), YEAR(1); private int calendarField; @@ -36,7 +36,7 @@ public enum Resolution { } /** - * Returns the field in {@link Calendar} that corresponds to this + * Returns the field in java.util.Calendar that corresponds to this * resolution. * * @return one of the field numbers used by Calendar |