Skip to content

Commit 1f812f9

Browse files
authored
Merge pull request #1039 from GwtMaterialDesign/release_2.8.0
Release 2.8.0
2 parents cc738db + 737a3f9 commit 1f812f9

File tree

9 files changed

+220
-9
lines changed

9 files changed

+220
-9
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ cache:
88
- $HOME/.m2
99
before_install:
1010
# install the gwt-material-jquery because it will depends on built in jquery
11-
- git clone -b release_2.7.1 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
11+
- git clone -b release_2.8.0 https://github.com/GwtMaterialDesign/gwt-material-jquery.git
1212
- cd gwt-material-jquery
1313
- mvn install -DskipTests=true -DdryRun=true
1414
- cd ..

.utility/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
set -ev
3-
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.7.1" ]; then
3+
if [ "$TRAVIS_JDK_VERSION" == "oraclejdk8" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "release_2.8.0" ]; then
44
echo "<settings><servers><server><id>ossrh</id><username>\${env.OSSRH_USER}</username><password>\${env.OSSRH_PASS}</password></server></servers></settings>" > ~/settings.xml
55
mvn deploy -DskipTests --settings ~/settings.xml
66
fi

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Support documentation can be found [here](https://github.com/GwtMaterialDesign/g
2020
We created <a href="http://gwtmaterialdesign.github.io/gwt-material-demo/apidocs" > Java Docs </a> for developers
2121

2222
## Maven
23-
### Current Version 2.7.1
23+
### Current Version 2.8.0
2424
```xml
2525
<dependency>
2626
<groupId>com.github.gwtmaterialdesign</groupId>
2727
<artifactId>gwt-material</artifactId>
28-
<version>2.7.1</version>
28+
<version>2.8.0</version>
2929
</dependency>
3030
```
3131
### Snapshot Version 2.8.0-SNAPSHOT

gwt-material/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<artifactId>gwt-material-parent</artifactId>
66
<groupId>com.github.gwtmaterialdesign</groupId>
7-
<version>2.7.1</version>
7+
<version>2.8.0</version>
88
</parent>
99
<modelVersion>4.0.0</modelVersion>
1010

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2023 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.client.base;
21+
22+
import gwt.material.design.client.constants.Color;
23+
import gwt.material.design.client.constants.SymbolType;
24+
25+
public interface HasSymbols {
26+
27+
void setType(SymbolType type);
28+
29+
void setSymbol(String symbol);
30+
31+
void setColor(Color color);
32+
33+
void setSymbolSize(String size);
34+
35+
void setFilled(boolean filled);
36+
37+
void setWeight(int weight);
38+
39+
void setGrade(int grade);
40+
41+
void setOpticalSize(int size);
42+
}

gwt-material/src/main/java/gwt/material/design/client/base/viewport/Resolution.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
public enum Resolution implements Boundary {
2323
ALL_DEVICES(new WidthBoundary(0, 2560)),
2424
ALL_MOBILE(new WidthBoundary(0, 425)),
25-
ALL_LAPTOP(new WidthBoundary(769, 2560)),
25+
ALL_LAPTOP(new WidthBoundary(769, 25000)),
2626
MOBILE_SMALL(new WidthBoundary(0, 320)),
2727
MOBILE_MEDIUM(new WidthBoundary(321, 375)),
2828
MOBILE_LARGE(new WidthBoundary(376, 425)),
2929
TABLET(new WidthBoundary(426, 768)),
3030
TABLET_AND_MOBILE(new WidthBoundary(0, 768)),
3131
LAPTOP(new WidthBoundary(769, 1024)),
3232
LAPTOP_LARGE(new WidthBoundary(1025, 1440)),
33-
LAPTOP_4K(new WidthBoundary(1441, 2560));
33+
LAPTOP_4K(new WidthBoundary(1441, 25000));
3434

3535
private final WidthBoundary boundary;
3636

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2023 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.client.constants;
21+
22+
import gwt.material.design.client.base.helper.EnumHelper;
23+
24+
public enum SymbolType implements CssType {
25+
26+
OUTLINED("material-symbols-outlined", "https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200"),
27+
ROUNDED("material-symbols-rounded", "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200"),
28+
SHARP("material-symbols-sharp", "https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,[email protected],100..700,0..1,-50..200");
29+
30+
protected String name;
31+
protected String cssLink;
32+
33+
SymbolType(String name, String cssLink) {
34+
this.name = name;
35+
this.cssLink = cssLink;
36+
}
37+
38+
@Override
39+
public String getCssName() {
40+
return name;
41+
}
42+
43+
public String getCssLink() {
44+
return cssLink;
45+
}
46+
47+
public static SymbolType fromStyleName(final String styleName) {
48+
return EnumHelper.fromStyleName(styleName, SymbolType.class, OUTLINED);
49+
}
50+
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
/*
2+
* #%L
3+
* GwtMaterial
4+
* %%
5+
* Copyright (C) 2015 - 2023 GwtMaterialDesign
6+
* %%
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
* #L%
19+
*/
20+
package gwt.material.design.client.ui;
21+
22+
import com.google.gwt.dom.client.Document;
23+
import com.google.gwt.dom.client.LinkElement;
24+
import gwt.material.design.client.base.HasSymbols;
25+
import gwt.material.design.client.base.MaterialWidget;
26+
import gwt.material.design.client.base.mixin.ColorsMixin;
27+
import gwt.material.design.client.base.mixin.CssNameMixin;
28+
import gwt.material.design.client.constants.Color;
29+
import gwt.material.design.client.constants.SymbolType;
30+
import gwt.material.design.client.ui.html.Span;
31+
32+
public class MaterialSymbol extends MaterialWidget implements HasSymbols {
33+
34+
protected Span span = new Span();
35+
protected static LinkElement linkElement = Document.get().createLinkElement();
36+
protected CssNameMixin<Span, SymbolType> symbolTypeMixin;
37+
protected ColorsMixin<MaterialSymbol> symbolColorsMixin;
38+
protected boolean filled;
39+
protected int weight = 400;
40+
protected int grade = 0;
41+
protected int opticalSize = 48;
42+
43+
static {
44+
linkElement.setRel("stylesheet");
45+
body().append(linkElement);
46+
}
47+
48+
public MaterialSymbol() {
49+
super(Document.get().createElement("div"));
50+
setType(SymbolType.OUTLINED);
51+
}
52+
53+
@Override
54+
protected void onLoad() {
55+
super.onLoad();
56+
57+
load();
58+
add(span);
59+
}
60+
61+
@Override
62+
public void setSymbol(String symbol) {
63+
span.setText(symbol);
64+
}
65+
66+
@Override
67+
public void setColor(Color color) {
68+
getSymbolColorsMixin().setTextColor(color);
69+
}
70+
71+
@Override
72+
public void setSymbolSize(String size) {
73+
span.getElement().getStyle().setProperty("fontSize", size);
74+
}
75+
76+
@Override
77+
public void setType(SymbolType type) {
78+
getSymbolTypeMixin().setCssName(type);
79+
linkElement.setHref(type.getCssLink());
80+
}
81+
82+
@Override
83+
public void setFilled(boolean filled) {
84+
this.filled = filled;
85+
}
86+
87+
@Override
88+
public void setWeight(int weight) {
89+
this.weight = weight;
90+
}
91+
92+
@Override
93+
public void setGrade(int grade) {
94+
this.grade = grade;
95+
}
96+
97+
@Override
98+
public void setOpticalSize(int size) {
99+
this.opticalSize = size;
100+
}
101+
102+
protected void load() {
103+
span.getElement().getStyle().setProperty("fontVariationSettings", "'FILL' " + (filled ? 1 : 0) + ", 'wght' " + weight + ", 'GRAD' " + grade + ", 'opsz' " + opticalSize);
104+
}
105+
106+
public ColorsMixin<MaterialSymbol> getSymbolColorsMixin() {
107+
if (symbolColorsMixin == null) {
108+
symbolColorsMixin = new ColorsMixin<>(this);
109+
}
110+
return symbolColorsMixin;
111+
}
112+
113+
public CssNameMixin<Span, SymbolType> getSymbolTypeMixin() {
114+
if (symbolTypeMixin == null) {
115+
symbolTypeMixin = new CssNameMixin<>(span);
116+
}
117+
return symbolTypeMixin;
118+
}
119+
}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.github.gwtmaterialdesign</groupId>
77
<artifactId>gwt-material-parent</artifactId>
8-
<version>2.7.1</version>
8+
<version>2.8.0</version>
99
<packaging>pom</packaging>
1010
<modules>
1111
<module>gwt-material</module>
@@ -75,7 +75,7 @@
7575
<connection>scm:git:[email protected]:GwtMaterialDesign/gwt-material.git</connection>
7676
<developerConnection>scm:git:[email protected]:GwtMaterialDesign/gwt-material.git</developerConnection>
7777
<url>http://github.com/GwtMaterialDesign/gwt-material</url>
78-
<tag>v2.7.1</tag>
78+
<tag>v2.8.0</tag>
7979
</scm>
8080

8181
<licenses>

0 commit comments

Comments
 (0)