mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
Code formatting
This commit is contained in:
1 parent
8e23bb3239
commit
916950353b
1 file changed
+10
-10
+10
-10
@@ -9,33 +9,33 @@ import com.google.gwt.dom.client.Style.Overflow;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
|
||||
public class CollapseAnimation extends Animation {
|
||||
|
||||
|
||||
private Element elementToAnimate;
|
||||
|
||||
|
||||
private boolean show = true;
|
||||
private int effectiveHeight;
|
||||
|
||||
public CollapseAnimation(Element elementToAnimate) {
|
||||
this(elementToAnimate, true);
|
||||
}
|
||||
|
||||
|
||||
public CollapseAnimation(Element elementToAnimate, int effectiveHeight) {
|
||||
this(elementToAnimate, false);
|
||||
this.effectiveHeight = effectiveHeight;
|
||||
}
|
||||
|
||||
|
||||
public CollapseAnimation(Element elementToAnimate, boolean showInitial) {
|
||||
this.elementToAnimate = elementToAnimate;
|
||||
this.show = showInitial;
|
||||
elementToAnimate.getStyle().setOverflow(Overflow.HIDDEN);
|
||||
if(!showInitial) {
|
||||
if (!showInitial) {
|
||||
elementToAnimate.getStyle().setDisplay(Display.NONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onComplete() {
|
||||
if(!show) {
|
||||
if (!show) {
|
||||
elementToAnimate.getStyle().setDisplay(Display.NONE);
|
||||
} else {
|
||||
elementToAnimate.getStyle().clearHeight();
|
||||
@@ -44,14 +44,14 @@ public class CollapseAnimation extends Animation {
|
||||
|
||||
@Override
|
||||
protected void onUpdate(double progress) {
|
||||
if(!show) {
|
||||
if (!show) {
|
||||
progress = 1.0 - progress;
|
||||
}
|
||||
elementToAnimate.getStyle().setHeight(effectiveHeight * progress, Unit.PX);
|
||||
}
|
||||
|
||||
|
||||
public void animate(boolean show) {
|
||||
if(show && effectiveHeight == 0) {
|
||||
if (show && effectiveHeight == 0) {
|
||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||
@Override
|
||||
public void execute() {
|
||||
|
||||
Reference in new issue
Block a user