public class MaterialLoader extends Object
If you have content that will take a long time to load, you should give the user feedback. For this reason we provide a number activity + progress indicators.
// FOR CIRCULAR LOADER
MaterialLoader.showLoading(true);
// FOR PROGRESS LOADER
MaterialLoader.showProgress(true);
// INSTANTIATE THE LOADER COMPONENT
MaterialLoader loader = new MaterialLoader();
loader.setContainer(target);
loader.setType(LoaderType.CIRCULAR);
loader.setScrollDisabled(true);
loader.show();
Timer t = new Timer()
{ @Override
public void run() {
loader.hide();
}
};
t.schedule(2000);
Constructor and Description |
---|
MaterialLoader() |
MaterialLoader(LoaderType type) |
Modifier and Type | Method and Description |
---|---|
protected void |
build() |
com.google.gwt.user.client.ui.Panel |
getContainer()
Get the Container that wraps the MaterialLoader (Default RootPanel)
|
LoaderType |
getType()
Get the type of the MaterialLoader (Default CIRCULAR)
|
void |
hide()
Hides the Loader component
|
boolean |
isScrollDisabled()
Get the value whether the scroll is enabled or disabled (Default false)
|
static void |
loading(boolean visible)
Static helper class that shows / hides a circular loader
|
static void |
loading(boolean visible,
com.google.gwt.user.client.ui.Panel container)
Static helper class that shows / hides a circular loader within a container
|
static void |
progress(boolean visible)
Static helper class that shows / hides a progress loader
|
static void |
progress(boolean visible,
com.google.gwt.user.client.ui.Panel container)
Static helper class that shows / hides a progress loader within a container
|
void |
setContainer(com.google.gwt.user.client.ui.Panel container)
Set the Container of the MaterialLoader
|
void |
setScrollDisabled(boolean scrollDisabled)
Set whether the loader will allow a body scroll when it is shown
|
void |
setType(LoaderType type)
Set the type of the MaterialLoader
|
void |
show()
Shows the Loader component
|
public MaterialLoader(LoaderType type)
public MaterialLoader()
protected void build()
public void show()
public void hide()
public static void loading(boolean visible)
public static void loading(boolean visible, com.google.gwt.user.client.ui.Panel container)
public static void progress(boolean visible)
public static void progress(boolean visible, com.google.gwt.user.client.ui.Panel container)
public LoaderType getType()
public void setType(LoaderType type)
type
- There are two types of Loader (CIRCULAR and PROGRESS)public com.google.gwt.user.client.ui.Panel getContainer()
public void setContainer(com.google.gwt.user.client.ui.Panel container)
public boolean isScrollDisabled()
public void setScrollDisabled(boolean scrollDisabled)
Copyright © 2018. All rights reserved.