Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3133

Support a Match Media annotation for MVVM to use

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 8.0.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None
    • Environment:

      IE10+

    • gh.sprint.customfield.default.name:
      ZK 8.0 UI Pattern S1

      Description

      For RWD, we need a way to monitor if the browser screen has matched with some criteria which is listed in this media queries spec.

      The usage in ViewModel is like this.

      @MatchMedia("(max-width: 700px)")
      @NotifyChange("matchMedia")
      public void mediaQuery(@ContextParam(ContextType.TRIGGER_EVENT) ClientInfoEvent evt) {
              if (evt.isMediaMatched()) {
                  // ...
                  _matchMedia = true;  
              } else {
                  // ... 
                  _matchMedia = false;  
              }
      }
      

      As you can see above, if the media queries has matched, the mediaQuery method will be invoked, and its trigger event will be ClientInfoEvent with two new methods, boolean isMediaMatched() and String getMedia().

      According to the media queries' spec. we can only support this feature for IE10+. (Please note it in Javadoc as well).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              wenninghsu wenninghsu
              Reporter:
              jumperchen jumperchen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 week, 2 days, 5 hours
                  1w 2d 5h