From 79cd9b8158a0ebaa352e86df911dfac3d88226c8 Mon Sep 17 00:00:00 2001 From: Kevzlou7979 Date: Tue, 29 Nov 2016 11:11:21 +0800 Subject: [PATCH 01/35] Iteration for 2.0-SNAPSHOT --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index a2754aae8..e69b80ee2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,24 +4,24 @@ gwt-material-parent com.github.gwtmaterialdesign - 2.0-rc3 + 2.0-SNAPSHOT gwt-material-addins Gwt Material Addins - 2.0-rc3 + 2.0-SNAPSHOT Extra Components of GWT Material Framework - 2.0-rc3 + 2.0-SNAPSHOT scm:git:git@github.com:GwtMaterialDesign/gwt-material-addins.git scm:git:git@github.com:GwtMaterialDesign/gwt-material-addins.git http://github.com/GwtMaterialDesign/gwt-material-addins - v2.0-rc3 + v2.0-SNAPSHOT From 15a9b2f61ff98a8783f0707c363721fc0c0ba596 Mon Sep 17 00:00:00 2001 From: BenDol Date: Thu, 1 Dec 2016 20:53:07 +1300 Subject: [PATCH 02/35] Fix build issues with Debug builds. --- .../client/richeditor/MaterialRichEditor.java | 2 - .../addins/client/window/MaterialWindow.java | 9 ++--- .../design/addins/GwtMaterialAddins.gwt.xml | 14 +------ .../addins/GwtMaterialAddinsBase.gwt.xml | 38 +++++++++++++++++++ .../addins/GwtMaterialAddinsDebug.gwt.xml | 3 +- 5 files changed, 44 insertions(+), 22 deletions(-) create mode 100644 src/main/resources/gwt/material/design/addins/GwtMaterialAddinsBase.gwt.xml diff --git a/src/main/java/gwt/material/design/addins/client/richeditor/MaterialRichEditor.java b/src/main/java/gwt/material/design/addins/client/richeditor/MaterialRichEditor.java index 2446142a9..36ff56f39 100644 --- a/src/main/java/gwt/material/design/addins/client/richeditor/MaterialRichEditor.java +++ b/src/main/java/gwt/material/design/addins/client/richeditor/MaterialRichEditor.java @@ -89,8 +89,6 @@ public MaterialRichEditor(String placeholder, String value) { setValue(value); } - private boolean initialized; - @Override protected void onLoad() { super.onLoad(); diff --git a/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java b/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java index 2d4f1ea65..2ed40797b 100644 --- a/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java +++ b/src/main/java/gwt/material/design/addins/client/window/MaterialWindow.java @@ -101,8 +101,6 @@ public class MaterialWindow extends MaterialPanel implements HasCloseHandlers toolbarColorMixin = new ColorsMixin<>(toolbar); private final ToggleStyleMixin maximizeMixin = new ToggleStyleMixin<>(this, AddinsCssName.MAXIMIZE); private final ToggleStyleMixin openMixin = new ToggleStyleMixin<>(this, AddinsCssName.OPEN); @@ -183,7 +181,7 @@ protected void initialize() { // Add a draggable header dnd = MaterialDnd.draggable(this, JsDragOptions.create( - new Restriction("body", true, 0, 0, 1.2, 1))); + new Restriction("body", true, 0, 0, 1.2, 1))); dnd.ignoreFrom(".content, .window-action"); } @@ -301,11 +299,10 @@ public void close() { } public Color getToolbarColor() { - return toolbarColor; + return toolbarColorMixin.getBackgroundColor(); } public void setToolbarColor(Color toolbarColor) { - this.toolbarColor = toolbarColor; toolbarColorMixin.setBackgroundColor(toolbarColor); } @@ -396,4 +393,4 @@ public void setDndArea(Object dndArea) { dnd.draggable(JsDragOptions.create(new Restriction(dndArea, true, 0, 0, 1.2, 1))); } } -} \ No newline at end of file +} diff --git a/src/main/resources/gwt/material/design/addins/GwtMaterialAddins.gwt.xml b/src/main/resources/gwt/material/design/addins/GwtMaterialAddins.gwt.xml index 11e2e92f6..fe96f000e 100644 --- a/src/main/resources/gwt/material/design/addins/GwtMaterialAddins.gwt.xml +++ b/src/main/resources/gwt/material/design/addins/GwtMaterialAddins.gwt.xml @@ -22,18 +22,6 @@ - - - - - - - - - - - - - + diff --git a/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsBase.gwt.xml b/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsBase.gwt.xml new file mode 100644 index 000000000..5995b7691 --- /dev/null +++ b/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsBase.gwt.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsDebug.gwt.xml b/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsDebug.gwt.xml index ae112cf9f..6970235fc 100644 --- a/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsDebug.gwt.xml +++ b/src/main/resources/gwt/material/design/addins/GwtMaterialAddinsDebug.gwt.xml @@ -26,5 +26,6 @@ - + + From 18c9fefd79171e9ad66264f365abe4fc846f31fb Mon Sep 17 00:00:00 2001 From: Kevzlou7979 Date: Tue, 6 Dec 2016 21:33:15 +0800 Subject: [PATCH 03/35] Added useful duration properties on Path Animator. --- .../pathanimator/MaterialPathAnimator.java | 51 ++++++++++++++++++- .../pathanimator/js/JsPathAnimator.java | 6 +++ .../js/JsPathAnimatorOptions.java | 37 ++++++++++++++ 3 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimatorOptions.java diff --git a/src/main/java/gwt/material/design/addins/client/pathanimator/MaterialPathAnimator.java b/src/main/java/gwt/material/design/addins/client/pathanimator/MaterialPathAnimator.java index 27fd151f9..0d1a59732 100644 --- a/src/main/java/gwt/material/design/addins/client/pathanimator/MaterialPathAnimator.java +++ b/src/main/java/gwt/material/design/addins/client/pathanimator/MaterialPathAnimator.java @@ -19,11 +19,13 @@ */ package gwt.material.design.addins.client.pathanimator; +import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style; import com.google.gwt.user.client.ui.Widget; import gwt.material.design.addins.client.MaterialAddins; import gwt.material.design.addins.client.pathanimator.js.JsPathAnimator; +import gwt.material.design.addins.client.pathanimator.js.JsPathAnimatorOptions; import gwt.material.design.client.MaterialDesignBase; import gwt.material.design.jquery.client.api.Functions; @@ -68,6 +70,10 @@ public class MaterialPathAnimator { private Element targetElement; private Functions.Func animateCallback; private Functions.Func reverseCallback; + private double duration = 0.3; + private double targetShowDuration = 0; + private double extraTransitionDuration = 1; + private JsPathAnimatorOptions options = new JsPathAnimatorOptions(); public MaterialPathAnimator() { } @@ -77,7 +83,15 @@ public MaterialPathAnimator() { */ public void animate() { $("document").ready(() -> { - JsPathAnimator.cta(sourceElement, targetElement, () -> { + options.duration = duration; + options.targetShowDuration = targetShowDuration; + options.extraTransitionDuration = extraTransitionDuration; + + GWT.log("Duration " + duration); + GWT.log("Target Show Duration " + targetShowDuration); + GWT.log("Extra Transition Duration " + extraTransitionDuration); + + JsPathAnimator.cta(sourceElement, targetElement, options, () -> { if (animateCallback != null) { animateCallback.call(); } else { @@ -146,7 +160,7 @@ public void reverseAnimate() { targetElement.getStyle().setVisibility(Style.Visibility.HIDDEN); targetElement.getStyle().setOpacity(0); } - JsPathAnimator.cta(targetElement, sourceElement); + JsPathAnimator.cta(targetElement, sourceElement, options); }); } @@ -251,4 +265,37 @@ public Functions.Func getReverseCallback() { public void setReverseCallback(Functions.Func reverseCallback) { this.reverseCallback = reverseCallback; } + + public double getDuration() { + return duration; + } + + /** + * Duration (in seconds) of animation. Default is 0.3 seconds. + */ + public void setDuration(double duration) { + this.duration = duration; + } + + public double getTargetShowDuration() { + return targetShowDuration; + } + + /** + * Duration (in seconds) of targetElement to become visible, if hidden initially. The library will automatically try to figure this out from the element's computed styles. Default is 0 seconds. + */ + public void setTargetShowDuration(double targetShowDuration) { + this.targetShowDuration = targetShowDuration; + } + + public double getExtraTransitionDuration() { + return extraTransitionDuration; + } + + /** + * Extra duration (in seconds) of targetElement to provide visual continuity between the animation and the rendering of the targetElement. Default is 1 second + */ + public void setExtraTransitionDuration(double extraTransitionDuration) { + this.extraTransitionDuration = extraTransitionDuration; + } } \ No newline at end of file diff --git a/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimator.java b/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimator.java index 296d59215..9ed7126ff 100644 --- a/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimator.java +++ b/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimator.java @@ -37,6 +37,12 @@ public class JsPathAnimator extends JQueryElement { @JsMethod(namespace = JsPackage.GLOBAL) public static native void cta(Element source, Element target, Functions.Func callback); + @JsMethod(namespace = JsPackage.GLOBAL) + public static native void cta(Element source, Element target, JsPathAnimatorOptions options, Functions.Func callback); + @JsMethod(namespace = JsPackage.GLOBAL) public static native void cta(Element source, Element target); + + @JsMethod(namespace = JsPackage.GLOBAL) + public static native void cta(Element source, Element target, JsPathAnimatorOptions options); } diff --git a/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimatorOptions.java b/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimatorOptions.java new file mode 100644 index 000000000..e2e9322b6 --- /dev/null +++ b/src/main/java/gwt/material/design/addins/client/pathanimator/js/JsPathAnimatorOptions.java @@ -0,0 +1,37 @@ +/* + * #%L + * GwtMaterial + * %% + * Copyright (C) 2015 - 2016 GwtMaterialDesign + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * #L% + */ +package gwt.material.design.addins.client.pathanimator.js; + +import jsinterop.annotations.JsPackage; +import jsinterop.annotations.JsProperty; +import jsinterop.annotations.JsType; + +@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) +public class JsPathAnimatorOptions { + + @JsProperty + public double duration; + + @JsProperty + public double targetShowDuration; + + @JsProperty + public double extraTransitionDuration; +} From 732b246a637c1ea7597d266bb065b1eadcc03814 Mon Sep 17 00:00:00 2001 From: Kevzlou7979 Date: Wed, 7 Dec 2016 11:00:47 +0800 Subject: [PATCH 04/35] Overlay - Added new recent duration options to pathanimator. --- .../client/overlay/MaterialOverlay.java | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/main/java/gwt/material/design/addins/client/overlay/MaterialOverlay.java b/src/main/java/gwt/material/design/addins/client/overlay/MaterialOverlay.java index f9b19c695..ec35fcb37 100644 --- a/src/main/java/gwt/material/design/addins/client/overlay/MaterialOverlay.java +++ b/src/main/java/gwt/material/design/addins/client/overlay/MaterialOverlay.java @@ -68,6 +68,7 @@ public class MaterialOverlay extends MaterialWidget implements HasOpenHandlers