Search…
Material Window

Overview

Material window is a window with a top bar and a return button that supports slide animations with their entire layout made based on the Google Material Design specifications.
Because this is a more complex example, they choose to only sample part of the main interface and a call from the Material Window. To see the complete example click here

Source Code

1
Button btn1 = new Button("Sign Up");
2
btn1.setBackForeColors(Colors.P_500, Colors.ON_P_500);
3
vbox.addControl(btn1);
4
btn1.addPressListener((e) -> {
5
MaterialWindow mw = new MaterialWindow("Sign Up",new Presenter() {
6
@Override
7
public Container getView() {
8
9
return new Container() {
10
@Override
11
public void initUI() {
12
//put all the window content here
13
}
14
};
15
}
16
});
17
mw.popup();
18
});
19
Button btn2 = new Button("Sign in");
20
btn2.setBackForeColors(Colors.P_500, Colors.ON_P_500);
21
vbox.addControl(btn2);
22
btn2.addPressListener((e) -> {
23
MaterialWindow mw = new MaterialWindow("Sign in",new Presenter() {
24
@Override
25
public Container getView() {
26
return new Container() {
27
@Override
28
public void initUI() {
29
//put all the window content here
30
31
}
32
};
33
}
34
});
35
mw.popup();
36
});
Copied!

Methods

Type
Name
Description
Constructor
MaterialWindow(Presenter<Container> provider)
Creates an MaterialWindow that receives a provider that provides the components to be inserted in the window.
Constructor
MaterialWindow(boolean delayInitUI, Presenter<Container> provider)
Creates an MaterialWindow, that may have a initUI delay, which receives a provider that provides the components to be inserted in the window
Construtor
MaterialWindow(String title, boolean delayInitUI, Presenter<Container> provider)
Creates an MaterialWindow, that may have a initUI delay, with the given title that receives a provider that provides the components to be inserted in the window
void
setBarFont(Font f)
Sets the bar font.
void
setTitle(String title)
Sets the title.
String
getTitle()
Returns the Title.
void
unpop( )
Unpop the MaterialWindow.
void
popup( )
Popup the MaterialWindow.

References

Last modified 2yr ago