LogoLogo
v7.0.0
v7.0.0
  • TotalCross Overview
  • TotalCross Javadoc
  • TotalCross Changelog
  • Roadmap
  • Documentation
    • Getting Started
      • First embedded project with TotalCross
    • Components
      • Accordion
      • Aligned Labels
      • Button
      • Check
      • ComboBox
      • Dynamic Scroll
      • Edit
      • Floating Button
      • Gpiod
      • Grid
      • GridContainer
      • Image
      • ImageControl
      • ImageList
      • Label
      • Material Icons
      • Material Window
      • MessageBox
      • Multi Edit
      • Progress Bar
      • Progress Box
      • Radio
      • Radio Group
      • Scroll Container
      • Side Menu
      • Slider
      • Sliding Window
      • Spin List
      • Spinner
      • Switch
      • Tabbed Container
      • Velocimeter
    • APIs
      • API Overview
      • API Rest
      • Asynchronous Task
      • Camera
      • Control
        • Main Window
        • Window
        • Container
      • GPS
      • HTTPS and SSL
      • JSON
      • Maps
        • Maps - Deprecated
        • Static Map
      • Material Design Standards
      • Ninepath
      • Notifications
      • PrinterManager
      • Push Notification Firebase
      • Scanner
      • SOAP
      • Socket
      • SocketServer
      • SQLite Encryption
      • QR Code Generator
      • totalcross.sys
      • Youtube API
    • Creating an Issue
    • Contributing
      • Branch workflow
      • Writing documentation
    • Guides
      • App Architecture
        • Suggested Architecture
        • Why do Design Patterns help with the application's organization?
          • MVC Architecture Pattern
          • Template Pattern
          • Data Persistence: DAO Pattern.
        • Separation of concepts: What is the best way to create UI interfaces?
        • Positioning
          • Manual Positioning
        • Relative Positioning
        • Best practices to improve project maintenance
      • Device Simulator
      • Package your app from scratch
        • TotalCross SDK
        • Environment Variables in IDE
          • Eclipse
          • IntelliJ
        • Deploy your app with a dependecy TC
        • Deploy iOS
          • Using Development certificate to test your apps
      • Understanding TotalCross for Linux ARM
      • Running C++ applications with TotalCross
      • Web Services
    • Miscelaneous
      • Java JDK 8
      • Maven
      • Installing Visual Studio Code
    • FAQ
      • IMEI in Android 10
Powered by GitBook
On this page
  • Overview
  • Source Code
  • Methods
  • References

Was this helpful?

  1. Documentation
  2. Components

Material Window

PreviousMaterial IconsNextMessageBox

Last updated 6 years ago

Was this helpful?

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 specifications.

Source Code

Button btn1 = new Button("Sign Up");
btn1.setBackForeColors(Colors.P_500, Colors.ON_P_500);
vbox.addControl(btn1);
btn1.addPressListener((e) -> {
    MaterialWindow mw = new MaterialWindow("Sign Up",new Presenter() {
        @Override
        public Container getView() {

            return new Container() {
                @Override
                public void initUI() {
                    //put all the window content here
                }
            };
        }
    });
    mw.popup();
});
Button btn2 = new Button("Sign in");
btn2.setBackForeColors(Colors.P_500, Colors.ON_P_500);
vbox.addControl(btn2);
btn2.addPressListener((e) -> {
    MaterialWindow mw = new MaterialWindow("Sign in",new Presenter() {
        @Override
        public Container getView() {
            return new Container() {
                @Override
                public void initUI() {
                    //put all the window content here 
                    
                }
            };
        }
    });
    mw.popup();
});

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

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

See also our tutorial of how a material window

See the for more information.

click here
quick video
Label Java Docs
Google Material Design