001/* 002 * #%L 003 * GwtMaterial 004 * %% 005 * Copyright (C) 2015 - 2017 GwtMaterialDesign 006 * %% 007 * Licensed under the Apache License, Version 2.0 (the "License"); 008 * you may not use this file except in compliance with the License. 009 * You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the License for the specific language governing permissions and 017 * limitations under the License. 018 * #L% 019 */ 020package gwt.material.design.client.base.viewport; 021 022public enum Resolution implements Boundary { 023 ALL_MOBILE(new WidthBoundary(0, 425)), 024 ALL_LAPTOP(new WidthBoundary(769, 2560)), 025 MOBILE_SMALL(new WidthBoundary(0, 320)), 026 MOBILE_MEDIUM(new WidthBoundary(321, 375)), 027 MOBILE_LARGE(new WidthBoundary(376, 425)), 028 TABLET(new WidthBoundary(426, 768)), 029 LAPTOP(new WidthBoundary(769, 1024)), 030 LAPTOP_LARGE(new WidthBoundary(1025, 1440)), 031 LAPTOP_4K(new WidthBoundary(1441, 2560)); 032 033 private final WidthBoundary boundary; 034 035 Resolution(WidthBoundary boundary) { 036 this.boundary = boundary; 037 } 038 039 public WidthBoundary getBoundary() { 040 return boundary; 041 } 042 043 @Override 044 public int getMin() { 045 return boundary.getMin(); 046 } 047 048 @Override 049 public int getMax() { 050 return boundary.getMax(); 051 } 052 053 @Override 054 public String asMediaQuery() { 055 return boundary.asMediaQuery(); 056 } 057}