public class Gloading
extends java.lang.Object
usage:
//if set true, logs will print into logcat
Gloading.debug(trueOrFalse);
//init the default loading status view creator (Gloading.Adapter)
Gloading.initDefault(adapter);
//wrap an activity. return the holder
Holder holder = Gloading.getDefault().wrap(activity);
//wrap an activity and set retry task. return the holder
Holder holder = Gloading.getDefault().wrap(activity).withRetry(retryTask);
holder.showLoading() //show loading status view by holder
holder.showLoadSuccess() //show load success status view by holder (frequently, hide gloading)
holder.showFailed() //show load failed status view by holder (frequently, needs retry task)
holder.showEmpty() //show empty status view by holder. (load completed, but data is empty)
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
Gloading.Adapter
Status view to show current page loading status
|
static class |
Gloading.Holder
Gloading holder
create by
wrap(Activity) or wrap(View)
the core API for showing all status view |
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
STATUS_EMPTY_DATA |
static int |
STATUS_LOAD_FAILED |
static int |
STATUS_LOAD_SUCCESS |
static int |
STATUS_LOADING |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
debug(boolean debug)
set debug mode or not
|
static Gloading |
from(Gloading.Adapter adapter)
Create a new Gloading different from the default one
|
static Gloading |
getDefault()
get default Gloading object for global usage in whole app
|
static void |
initDefault(Gloading.Adapter adapter)
init the default loading status view creator (
Gloading.Adapter) |
Gloading.Holder |
wrap(android.app.Activity activity)
Gloading(loading status view) wrap the whole activity
wrapper is android.R.id.content
|
Gloading.Holder |
wrap(android.view.View view)
Gloading(loading status view) wrap the specific view.
|
public static final int STATUS_LOADING
public static final int STATUS_LOAD_SUCCESS
public static final int STATUS_LOAD_FAILED
public static final int STATUS_EMPTY_DATA
public static void debug(boolean debug)
debug - true:debug mode, false:not debug modepublic static Gloading from(Gloading.Adapter adapter)
adapter - another adapter different from the default onepublic static Gloading getDefault()
public static void initDefault(Gloading.Adapter adapter)
Gloading.Adapter)adapter - adapter to create all status viewspublic Gloading.Holder wrap(android.app.Activity activity)
activity - current activity objectpublic Gloading.Holder wrap(android.view.View view)
view - view to be wrapped