Skip to content

Commit c57bf47

Browse files
author
MicroEJ GitHub Delivery
committed
Version 7.5.1
1 parent 676b6d8 commit c57bf47

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2590
-1804
lines changed

com.microej.demo.widget/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,24 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [7.5.1] - 2022-10-20
9+
10+
### Fixed
11+
12+
- Fix Widget library version in README.md.
13+
14+
## [7.5.0] - 2022-10-18
15+
16+
### Added
17+
18+
- Add CircularSlider widget and page.
19+
- Add DoubleTemperatureSlider widget and page.
20+
- Add FixedGrid page.
21+
22+
### Fixed
23+
24+
- Use Util.platformTimeMillis() instead of System.currentTimeMillis() for time elapsing computing.
25+
826
## [7.4.0] - 2022-01-21
927

1028
### Added

com.microej.demo.widget/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Overview
22

3-
This demo illustrates the widgets and containers available in the widget library: [ej.library.ui#widget-3.1.0](https://repository.microej.com/modules/ej/library/ui/widget/3.1.0/).
3+
This demo illustrates the widgets and containers available in the widget library: [ej.library.ui#widget-4.2.0](https://repository.microej.com/modules/ej/library/ui/widget/4.2.0/).
44

55
At startup, it shows a list of items.
66
Clicking on an item opens a new page showing a widget or a set of widgets.
@@ -20,8 +20,10 @@ Here are the pages:
2020
- `Label`: demonstrates the simple `Label` widget from the widget library.
2121
- `AutoscrollLabel`: demonstrates a label which autoscroll when the label text is longer than label length.
2222
- `Image Widget` : demonstrates how to display an image using `ImageWidget` from the widget library.
23-
- `Slider with value` : demonstrate a Slider with displayed value.
24-
- `Slider with progress` : demonstrate a Slider with progress.
23+
- `Slider with value` : demonstrates a slider with displayed value.
24+
- `Slider with progress` : demonstrates a slider with progress.
25+
- `Circular Slider` : demonstrates a circular slider.
26+
- `Double Temperature Slider` : demonstrates a double slider with a dynamic gradient.
2527
- `Button`: demonstrates different styles of the simple `Button` widget from the widget library.
2628
- `Checkbox`: demonstrates a `Checkbox` widget.
2729
- `Radio Button`: demonstrates a `RadioButton` widget.
@@ -36,6 +38,7 @@ Here are the pages:
3638
- `Carousel`: demonstrates a `Carousel` widget.
3739
- `List`: demonstrates the `List` container from the widget library.
3840
- `Grid`: demonstrates the `Grid` container from the widget library.
41+
- `Fixed Grid`: demonstrates the `FixedGrid` container from the widget library.
3942
- `Dock`: demonstrates the `Dock` container from the widget library.
4043
- `Split`: demonstrates a `Split` container.
4144
- `Scrollable List`: demonstrates a `ScrollableList` container.

com.microej.demo.widget/module.ivy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Use of this source code is governed by a BSD-style license that can be found with this software.
44
-->
55
<ivy-module version="2.0" xmlns:ea="http://www.easyant.org" xmlns:ej="https://developer.microej.com" ej:version="2.0.0">
6-
<info organisation="com.microej.demo" module="widget" status="integration" revision="7.4.0">
6+
<info organisation="com.microej.demo" module="widget" status="integration" revision="7.5.1">
77
<ea:build organisation="com.is2t.easyant.buildtypes" module="build-firmware-singleapp" revision="1.+"/>
88
<ea:property name="application.main.class" value="com.microej.demo.widget.common.Navigation"/>
99
<ea:property name="virtual.device.sim.only" value="set"/>
@@ -29,8 +29,8 @@
2929
<dependency org="ej.api" name="microui" rev="3.0.3"/>
3030
<dependency org="ej.api" name="drawing" rev="1.0.2"/>
3131

32-
<dependency org="ej.library.ui" name="mwt" rev="3.3.0"/>
33-
<dependency org="ej.library.ui" name="widget" rev="4.1.0"/>
32+
<dependency org="ej.library.ui" name="mwt" rev="3.3.1"/>
33+
<dependency org="ej.library.ui" name="widget" rev="4.2.0"/>
3434
<dependency org="ej.library.ui" name="motion" rev="4.0.0"/>
3535
<dependency org="ej.library.runtime" name="service" rev="1.1.1"/>
3636
</dependencies>

com.microej.demo.widget/src/main/java/com/microej/demo/widget/autoscrolllabel/widget/AutoscrollLabel.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
package com.microej.demo.widget.autoscrolllabel.widget;
66

7+
import ej.bon.Util;
78
import ej.microui.display.Font;
89
import ej.microui.display.GraphicsContext;
910
import ej.mwt.animation.Animation;
@@ -25,7 +26,7 @@ public class AutoscrollLabel extends Label implements Animation {
2526

2627
private int textWidth;
2728
private long startTime;
28-
private int elapsedTime;
29+
private long elapsedTime;
2930

3031
/**
3132
* Creates an autoscroll label.
@@ -68,7 +69,7 @@ protected void onShown() {
6869
this.textWidth = getStyle().getFont().stringWidth(this.getText());
6970

7071
if (this.textWidth > getContentBounds().getWidth()) {
71-
this.startTime = System.currentTimeMillis() + START_WAIT_PERIOD;
72+
this.startTime = Util.platformTimeMillis() + START_WAIT_PERIOD;
7273

7374
getDesktop().getAnimator().startAnimation(this);
7475
}
@@ -80,8 +81,8 @@ protected void onHidden() {
8081
}
8182

8283
@Override
83-
public boolean tick(long currentTimeMillis) {
84-
this.elapsedTime = (int) (System.currentTimeMillis() - this.startTime);
84+
public boolean tick(long platformTimeMillis) {
85+
this.elapsedTime = platformTimeMillis - this.startTime;
8586
requestRender();
8687
return true;
8788
}

com.microej.demo.widget/src/main/java/com/microej/demo/widget/barchart/BarChartPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import ej.mwt.stylesheet.selector.ClassSelector;
1818

1919
/**
20-
* This is the base for the Pages demonstrating the Chart Widgets.
20+
* Page showing a bar chart.
2121
*/
2222
public class BarChartPage implements Page {
2323

com.microej.demo.widget/src/main/java/com/microej/demo/widget/carousel/CarouselPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import ej.widget.container.List;
2626

2727
/**
28-
* This page illustrates a Carousel.
28+
* Page showing a carousel.
2929
*/
3030
public class CarouselPage implements Page {
3131

Lines changed: 100 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,100 @@
1-
/*
2-
* Copyright 2021-2022 MicroEJ Corp. All rights reserved.
3-
* Use of this source code is governed by a BSD-style license that can be found with this software.
4-
*/
5-
package com.microej.demo.widget.circulardottedprogress;
6-
7-
import com.microej.demo.widget.circulardottedprogress.widget.CircularDottedProgress;
8-
import com.microej.demo.widget.common.Page;
9-
10-
import ej.microui.display.Colors;
11-
import ej.motion.Motion;
12-
import ej.motion.circ.CircEaseInOutFunction;
13-
import ej.mwt.Widget;
14-
import ej.mwt.animation.Animation;
15-
import ej.mwt.style.EditableStyle;
16-
import ej.mwt.style.dimension.OptimalDimension;
17-
import ej.mwt.stylesheet.cascading.CascadingStylesheet;
18-
import ej.mwt.stylesheet.selector.TypeSelector;
19-
import ej.mwt.util.Alignment;
20-
import ej.widget.container.LayoutOrientation;
21-
import ej.widget.container.SimpleDock;
22-
23-
/**
24-
* Circular Dotted Progress page.
25-
*/
26-
public class CircularDottedProgressPage implements Page {
27-
28-
private static final int BAR_COLOR = 0xEE502E;
29-
private static final int CIRCULAR_SIZE = 100;
30-
private static final int DOT_SIZE = 5;
31-
private static final int START_ANGLE = 270;
32-
private static final int PROGRESS_MAX = 360;
33-
34-
@Override
35-
public String getName() {
36-
return "Circular Dotted Progress"; //$NON-NLS-1$
37-
}
38-
39-
@Override
40-
public void populateStylesheet(CascadingStylesheet stylesheet) {
41-
42-
EditableStyle style = stylesheet.getSelectorStyle(new TypeSelector(CircularDottedProgress.class));
43-
style.setColor(BAR_COLOR);
44-
style.setExtraInt(CircularDottedProgress.BACKGROUND_COLOR, Colors.BLACK);
45-
style.setExtraInt(CircularDottedProgress.PROGRESS_DIAMETER, CIRCULAR_SIZE);
46-
style.setExtraInt(CircularDottedProgress.DOT_SIZE, DOT_SIZE);
47-
style.setDimension(OptimalDimension.OPTIMAL_DIMENSION_XY);
48-
style.setHorizontalAlignment(Alignment.HCENTER);
49-
style.setVerticalAlignment(Alignment.VCENTER);
50-
51-
}
52-
53-
@Override
54-
public Widget getContentWidget() {
55-
SimpleDock dottedDock = new SimpleDock(LayoutOrientation.VERTICAL);
56-
57-
// circular dotted progress bar, progress clockwise
58-
AnimatedCircularDottedProgress dottedProgress = new AnimatedCircularDottedProgress(START_ANGLE, true);
59-
60-
dottedDock.setCenterChild(dottedProgress);
61-
62-
return dottedDock;
63-
}
64-
65-
private static class AnimatedCircularDottedProgress extends CircularDottedProgress implements Animation {
66-
67-
private static final int ANIMATION_DURATION = 5_000;
68-
69-
private final Motion progressMotion;
70-
private long startTime;
71-
72-
AnimatedCircularDottedProgress(float startAngle, boolean clockwise) {
73-
super(startAngle, clockwise);
74-
this.progressMotion = new Motion(CircEaseInOutFunction.INSTANCE, 0, PROGRESS_MAX, ANIMATION_DURATION);
75-
}
76-
77-
@Override
78-
protected void onShown() {
79-
this.startTime = System.currentTimeMillis();
80-
getDesktop().getAnimator().startAnimation(this);
81-
}
82-
83-
@Override
84-
protected void onHidden() {
85-
getDesktop().getAnimator().stopAnimation(this);
86-
}
87-
88-
@Override
89-
public boolean tick(long currentTimeMillis) {
90-
long elapsedTime = currentTimeMillis - this.startTime;
91-
float angle = this.progressMotion.getValue(elapsedTime);
92-
setProgress(angle);
93-
94-
requestRender();
95-
return elapsedTime < ANIMATION_DURATION;
96-
}
97-
}
98-
99-
}
1+
/*
2+
* Copyright 2021-2022 MicroEJ Corp. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be found with this software.
4+
*/
5+
package com.microej.demo.widget.circulardottedprogress;
6+
7+
import com.microej.demo.widget.circulardottedprogress.widget.CircularDottedProgress;
8+
import com.microej.demo.widget.common.Page;
9+
10+
import ej.bon.Util;
11+
import ej.microui.display.Colors;
12+
import ej.motion.Motion;
13+
import ej.motion.circ.CircEaseInOutFunction;
14+
import ej.mwt.Widget;
15+
import ej.mwt.animation.Animation;
16+
import ej.mwt.style.EditableStyle;
17+
import ej.mwt.style.dimension.OptimalDimension;
18+
import ej.mwt.stylesheet.cascading.CascadingStylesheet;
19+
import ej.mwt.stylesheet.selector.TypeSelector;
20+
import ej.mwt.util.Alignment;
21+
import ej.widget.container.LayoutOrientation;
22+
import ej.widget.container.SimpleDock;
23+
24+
/**
25+
* Page showing a circular dotted progress.
26+
*/
27+
public class CircularDottedProgressPage implements Page {
28+
29+
private static final int BAR_COLOR = 0xEE502E;
30+
private static final int CIRCULAR_SIZE = 100;
31+
private static final int DOT_SIZE = 5;
32+
private static final int START_ANGLE = 270;
33+
private static final int PROGRESS_MAX = 360;
34+
35+
@Override
36+
public String getName() {
37+
return "Circular Dotted Progress"; //$NON-NLS-1$
38+
}
39+
40+
@Override
41+
public void populateStylesheet(CascadingStylesheet stylesheet) {
42+
43+
EditableStyle style = stylesheet.getSelectorStyle(new TypeSelector(CircularDottedProgress.class));
44+
style.setColor(BAR_COLOR);
45+
style.setExtraInt(CircularDottedProgress.BACKGROUND_COLOR, Colors.BLACK);
46+
style.setExtraInt(CircularDottedProgress.PROGRESS_DIAMETER, CIRCULAR_SIZE);
47+
style.setExtraInt(CircularDottedProgress.DOT_SIZE, DOT_SIZE);
48+
style.setDimension(OptimalDimension.OPTIMAL_DIMENSION_XY);
49+
style.setHorizontalAlignment(Alignment.HCENTER);
50+
style.setVerticalAlignment(Alignment.VCENTER);
51+
52+
}
53+
54+
@Override
55+
public Widget getContentWidget() {
56+
SimpleDock dottedDock = new SimpleDock(LayoutOrientation.VERTICAL);
57+
58+
// circular dotted progress bar, progress clockwise
59+
AnimatedCircularDottedProgress dottedProgress = new AnimatedCircularDottedProgress(START_ANGLE, true);
60+
61+
dottedDock.setCenterChild(dottedProgress);
62+
63+
return dottedDock;
64+
}
65+
66+
private static class AnimatedCircularDottedProgress extends CircularDottedProgress implements Animation {
67+
68+
private static final int ANIMATION_DURATION = 5_000;
69+
70+
private final Motion progressMotion;
71+
private long startTime;
72+
73+
AnimatedCircularDottedProgress(float startAngle, boolean clockwise) {
74+
super(startAngle, clockwise);
75+
this.progressMotion = new Motion(CircEaseInOutFunction.INSTANCE, 0, PROGRESS_MAX, ANIMATION_DURATION);
76+
}
77+
78+
@Override
79+
protected void onShown() {
80+
this.startTime = Util.platformTimeMillis();
81+
getDesktop().getAnimator().startAnimation(this);
82+
}
83+
84+
@Override
85+
protected void onHidden() {
86+
getDesktop().getAnimator().stopAnimation(this);
87+
}
88+
89+
@Override
90+
public boolean tick(long platformTimeMillis) {
91+
long elapsedTime = platformTimeMillis - this.startTime;
92+
float angle = this.progressMotion.getValue(elapsedTime);
93+
setProgress(angle);
94+
95+
requestRender();
96+
return elapsedTime < ANIMATION_DURATION;
97+
}
98+
}
99+
100+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* Copyright 2021-2022 MicroEJ Corp. All rights reserved.
3-
* Use of this source code is governed by a BSD-style license that can be found with this software.
4-
*/
5-
6-
/**
7-
* Contains the Circular dotted progress page.
8-
*/
9-
@ej.annotation.NonNullByDefault
1+
/*
2+
* Copyright 2021-2022 MicroEJ Corp. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be found with this software.
4+
*/
5+
6+
/**
7+
* Contains the Circular dotted progress page.
8+
*/
9+
@ej.annotation.NonNullByDefault
1010
package com.microej.demo.widget.circulardottedprogress;

0 commit comments

Comments
 (0)