Skip to content

Commit 116e7f3

Browse files
Valenreynoso17javier-godoy
authored andcommitted
style: apply code formatter
1 parent 9cc4e83 commit 116e7f3

File tree

5 files changed

+77
-41
lines changed

5 files changed

+77
-41
lines changed

src/main/java/com/flowingcode/vaadin/addons/carousel/Carousel.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
import com.vaadin.flow.shared.Registration;
3333

3434
/**
35-
* A component that displays a slideshow of slides.
36-
* By default the slides will be displayed with navigation buttons, autoplay and swipe enabled.
37-
* You can configure the slideshow by adding custom parameters, such as duration of transition,
38-
* start position, maximum height and disabling swipe.
35+
* A component that displays a slideshow of slides. By default the slides will be displayed with
36+
* navigation buttons, autoplay and swipe enabled. You can configure the slideshow by adding custom
37+
* parameters, such as duration of transition, start position, maximum height and disabling swipe.
3938
*/
4039
@SuppressWarnings("serial")
4140
@Tag("l2t-paper-slider")
@@ -92,35 +91,35 @@ public void setAutoProgress(boolean autoProgress) {
9291
}
9392

9493
public int getSlideDuration() {
95-
return this.getElement().getProperty(SLIDE_DURATION, 0);
94+
return this.getElement().getProperty(SLIDE_DURATION, 0);
9695
}
9796

9897
public void setSlideDuration(int slideDuration) {
99-
this.getElement().setProperty(SLIDE_DURATION, slideDuration);
98+
this.getElement().setProperty(SLIDE_DURATION, slideDuration);
10099
}
101100

102101
public int getStartPosition() {
103102
return this.getElement().getProperty(POSITION, 0);
104103
}
105104

106105
public void setStartPosition(int startPosition) {
107-
this.getElement().setAttribute(POSITION, "" + startPosition);
106+
this.getElement().setAttribute(POSITION, "" + startPosition);
108107
}
109108

110109
public boolean isDisableSwipe() {
111110
return this.getElement().getProperty(DISABLE_SWIPE, false);
112111
}
113112

114113
public void setDisableSwipe(boolean disableSwipe) {
115-
this.getElement().setAttribute(DISABLE_SWIPE, disableSwipe);
114+
this.getElement().setAttribute(DISABLE_SWIPE, disableSwipe);
116115
}
117116

118117
public boolean isHideNavigation() {
119118
return this.getElement().getProperty(HIDE_NAV, false);
120119
}
121120

122121
public void setHideNavigation(boolean hideNavigation) {
123-
this.getElement().setAttribute(HIDE_NAV, hideNavigation);
122+
this.getElement().setAttribute(HIDE_NAV, hideNavigation);
124123
}
125124

126125
// FLUENT API
@@ -152,7 +151,7 @@ public Carousel withStartPosition(int startPosition) {
152151
// SIZING
153152
@Override
154153
public void setHeight(String height) {
155-
HasSize.super.setHeight(height);
154+
HasSize.super.setHeight(height);
156155
getElement().getStyle().set("--paper-slide-height", height);
157156
}
158157

src/test/java/com/flowingcode/vaadin/addons/carousel/AutoProgressDemo.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
package com.flowingcode.vaadin.addons.carousel;
2121

2222
import com.flowingcode.vaadin.addons.demo.DemoSource;
23-
import com.vaadin.flow.component.Component;
24-
import com.vaadin.flow.component.html.H1;
2523
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
2624
import com.vaadin.flow.router.PageTitle;
2725
import com.vaadin.flow.router.Route;
@@ -33,11 +31,26 @@
3331
public class AutoProgressDemo extends VerticalLayout {
3432

3533
public AutoProgressDemo() {
36-
Slide s1 = new Slide(CarouselDemoView.createSlideContent("Slide 1", "https://www.flowingcode.com/wp-content/uploads/2018/04/birthday-3021071_640.jpg"));
37-
Slide s2 = new Slide(CarouselDemoView.createSlideContent("Slide 2", "https://2.bp.blogspot.com/-nvtIfgN8duc/XKUQh9VEyFI/AAAAAAAABT8/mE7P45E2uqwWlkKimAmes7fT2rdW9UDWwCEwYBhgL/s320/anniversary_1.jpg"));
38-
Slide s3 = new Slide(CarouselDemoView.createSlideContent("Slide 3", "https://www.flowingcode.com/wp-content/uploads/2020/04/photo4blog-300x300.jpg"));
39-
Slide s4 = new Slide(CarouselDemoView.createSlideContent("Slide 4", "https://www.flowingcode.com/wp-content/uploads/2021/03/happy_birthday_2.jpg"));
40-
34+
Slide s1 =
35+
new Slide(
36+
CarouselDemoView.createSlideContent(
37+
"Slide 1",
38+
"https://www.flowingcode.com/wp-content/uploads/2018/04/birthday-3021071_640.jpg"));
39+
Slide s2 =
40+
new Slide(
41+
CarouselDemoView.createSlideContent(
42+
"Slide 2",
43+
"https://2.bp.blogspot.com/-nvtIfgN8duc/XKUQh9VEyFI/AAAAAAAABT8/mE7P45E2uqwWlkKimAmes7fT2rdW9UDWwCEwYBhgL/s320/anniversary_1.jpg"));
44+
Slide s3 =
45+
new Slide(
46+
CarouselDemoView.createSlideContent(
47+
"Slide 3",
48+
"https://www.flowingcode.com/wp-content/uploads/2020/04/photo4blog-300x300.jpg"));
49+
Slide s4 =
50+
new Slide(
51+
CarouselDemoView.createSlideContent(
52+
"Slide 4",
53+
"https://www.flowingcode.com/wp-content/uploads/2021/03/happy_birthday_2.jpg"));
4154

4255
Carousel c =
4356
new Carousel(s1, s2, s3, s4)
@@ -49,5 +62,4 @@ public AutoProgressDemo() {
4962

5063
add(c);
5164
}
52-
5365
}

src/test/java/com/flowingcode/vaadin/addons/carousel/CarouselDemoView.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public CarouselDemoView() {
3939
addDemo(SlideButtonsDemo.class);
4040
setSizeFull();
4141
}
42-
42+
4343
public static Component createSlideContent(String string, String image) {
44-
Div result = new Div();
45-
result.getStyle().set("width", "auto");
46-
result.getStyle().set("height", "100%");
47-
result.getStyle().set("background-image", "url('" + image + "')");
48-
result.getStyle().set("background-size", "cover");
49-
result.getStyle().set("background-repeat", "no-repeat");
50-
result.getStyle().set("background-position", "50% 50%");
44+
Div result = new Div();
45+
result.getStyle().set("width", "auto");
46+
result.getStyle().set("height", "100%");
47+
result.getStyle().set("background-image", "url('" + image + "')");
48+
result.getStyle().set("background-size", "cover");
49+
result.getStyle().set("background-repeat", "no-repeat");
50+
result.getStyle().set("background-position", "50% 50%");
5151
return result;
5252
}
5353
}

src/test/java/com/flowingcode/vaadin/addons/carousel/ListenerDemo.java

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
package com.flowingcode.vaadin.addons.carousel;
2121

2222
import com.flowingcode.vaadin.addons.demo.DemoSource;
23-
import com.vaadin.flow.component.Component;
24-
import com.vaadin.flow.component.html.Div;
2523
import com.vaadin.flow.component.notification.Notification;
2624
import com.vaadin.flow.component.notification.Notification.Position;
2725
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
@@ -35,16 +33,31 @@
3533
public class ListenerDemo extends VerticalLayout {
3634

3735
public ListenerDemo() {
38-
Slide s1 = new Slide(CarouselDemoView.createSlideContent("Slide 1", "https://www.flowingcode.com/wp-content/uploads/2018/04/birthday-3021071_640.jpg"));
39-
Slide s2 = new Slide(CarouselDemoView.createSlideContent("Slide 2", "https://2.bp.blogspot.com/-nvtIfgN8duc/XKUQh9VEyFI/AAAAAAAABT8/mE7P45E2uqwWlkKimAmes7fT2rdW9UDWwCEwYBhgL/s320/anniversary_1.jpg"));
40-
Slide s3 = new Slide(CarouselDemoView.createSlideContent("Slide 3", "https://www.flowingcode.com/wp-content/uploads/2020/04/photo4blog-300x300.jpg"));
41-
Slide s4 = new Slide(CarouselDemoView.createSlideContent("Slide 4", "https://www.flowingcode.com/wp-content/uploads/2021/03/happy_birthday_2.jpg"));
36+
Slide s1 =
37+
new Slide(
38+
CarouselDemoView.createSlideContent(
39+
"Slide 1",
40+
"https://www.flowingcode.com/wp-content/uploads/2018/04/birthday-3021071_640.jpg"));
41+
Slide s2 =
42+
new Slide(
43+
CarouselDemoView.createSlideContent(
44+
"Slide 2",
45+
"https://2.bp.blogspot.com/-nvtIfgN8duc/XKUQh9VEyFI/AAAAAAAABT8/mE7P45E2uqwWlkKimAmes7fT2rdW9UDWwCEwYBhgL/s320/anniversary_1.jpg"));
46+
Slide s3 =
47+
new Slide(
48+
CarouselDemoView.createSlideContent(
49+
"Slide 3",
50+
"https://www.flowingcode.com/wp-content/uploads/2020/04/photo4blog-300x300.jpg"));
51+
Slide s4 =
52+
new Slide(
53+
CarouselDemoView.createSlideContent(
54+
"Slide 4",
55+
"https://www.flowingcode.com/wp-content/uploads/2021/03/happy_birthday_2.jpg"));
4256

4357
Carousel c = new Carousel(s1, s2, s3, s4);
4458
c.setSizeFull();
4559
c.addChangeListener(e -> Notification.show("Slide Changed!", 1000, Position.BOTTOM_START));
4660

4761
add(c);
4862
}
49-
5063
}

src/test/java/com/flowingcode/vaadin/addons/carousel/SlideButtonsDemo.java

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
package com.flowingcode.vaadin.addons.carousel;
2121

2222
import com.flowingcode.vaadin.addons.demo.DemoSource;
23-
import com.vaadin.flow.component.Component;
2423
import com.vaadin.flow.component.button.Button;
25-
import com.vaadin.flow.component.html.H1;
2624
import com.vaadin.flow.component.notification.Notification;
2725
import com.vaadin.flow.component.notification.Notification.Position;
2826
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
@@ -37,11 +35,26 @@
3735
public class SlideButtonsDemo extends VerticalLayout {
3836

3937
public SlideButtonsDemo() {
40-
Slide s1 = new Slide(CarouselDemoView.createSlideContent("Slide 1", "https://www.flowingcode.com/wp-content/uploads/2018/04/birthday-3021071_640.jpg"));
41-
Slide s2 = new Slide(CarouselDemoView.createSlideContent("Slide 2", "https://2.bp.blogspot.com/-nvtIfgN8duc/XKUQh9VEyFI/AAAAAAAABT8/mE7P45E2uqwWlkKimAmes7fT2rdW9UDWwCEwYBhgL/s320/anniversary_1.jpg"));
42-
Slide s3 = new Slide(CarouselDemoView.createSlideContent("Slide 3", "https://www.flowingcode.com/wp-content/uploads/2020/04/photo4blog-300x300.jpg"));
43-
Slide s4 = new Slide(CarouselDemoView.createSlideContent("Slide 4", "https://www.flowingcode.com/wp-content/uploads/2021/03/happy_birthday_2.jpg"));
44-
38+
Slide s1 =
39+
new Slide(
40+
CarouselDemoView.createSlideContent(
41+
"Slide 1",
42+
"https://www.flowingcode.com/wp-content/uploads/2018/04/birthday-3021071_640.jpg"));
43+
Slide s2 =
44+
new Slide(
45+
CarouselDemoView.createSlideContent(
46+
"Slide 2",
47+
"https://2.bp.blogspot.com/-nvtIfgN8duc/XKUQh9VEyFI/AAAAAAAABT8/mE7P45E2uqwWlkKimAmes7fT2rdW9UDWwCEwYBhgL/s320/anniversary_1.jpg"));
48+
Slide s3 =
49+
new Slide(
50+
CarouselDemoView.createSlideContent(
51+
"Slide 3",
52+
"https://www.flowingcode.com/wp-content/uploads/2020/04/photo4blog-300x300.jpg"));
53+
Slide s4 =
54+
new Slide(
55+
CarouselDemoView.createSlideContent(
56+
"Slide 4",
57+
"https://www.flowingcode.com/wp-content/uploads/2021/03/happy_birthday_2.jpg"));
4558

4659
final Carousel cf = new Carousel(s1, s2, s3, s4).withoutNavigation();
4760
cf.setSizeFull();
@@ -61,5 +74,4 @@ public SlideButtonsDemo() {
6174
btns.setWidthFull();
6275
add(cf, btns);
6376
}
64-
6577
}

0 commit comments

Comments
 (0)