vaadin / touchkit

TouchKit is a library of mobile components for Vaadin Framework
https://vaadin.com/touchkit
Other
11 stars 25 forks source link

DatePicker is not using HTML5 on Android Lollipop #404

Closed vaadin-bot closed 9 years ago

vaadin-bot commented 9 years ago

Originally by f92dev


I'm developing with Vaadin Touchkit add-on and I noticed that running Google Chrome under Android Lollipop 5.0.2 the DatePicker renders the "fallback" widget instead of the html5 native field.

This is caused by the following method com.vaadin.addon.touchkit.gwt.client.ui.DatePicker.isOldAndroid() which is not considering the newest Android versions:

    /**
     - @return true if the Android version is older than 4.2, in which case the
     -         HTML5 date field is not very useful.
     -/
    private boolean isOldAndroid() {
        VBrowserDetails details = new VBrowserDetails(
                BrowserInfo.getBrowserString());
        return details.isAndroid()
                && (details.getOperatingSystemMajorVersion() < 4 || details
                        .getOperatingSystemMinorVersion() < 2);
    }

The method should return like this:

   int majorVersion = details.getOperatingSystemMajorVersion();
   int minorVersion = details.getOperatingSystemMinorVersion();
   return details.isAndroid() && (major < 4 || (major == 4 && minor < 2));

Imported from https://dev.vaadin.com/ issue #17167