Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

Gloading

> 编程语言
Open source

Show global loading status view in a low coupling way for Android App(超轻量级,深度解耦Android App中全局加载中、加载失败及空数据视图)

1.4K stars0 likes1 views
WebsiteGitHub

About

Gloading

中文文档

Show global loading status view in a low coupling way for Android App.

JavaDocs | Download Demo

Latest Version:

Lightweight: aar is less than 6KB, just 170 code lines and 104 comment lines within only 1 java file.

Design as Adapter pattern,with good compatibility: most third-party LoadingViews can be used as Gloading views in the Adapter

Demo

Wrap activity page

Load success Load failed and click retry Load success with empty data This loading status UI is special

Wrap view(s)

Wrap single view Wrap views Wrap in GridView Wrap in RecyclerView
No words below

Usage

groovy
compile 'com.billy.android:gloading:1.0.0'

1. Provide global loading status views

For global usage, create an Adapter to provide views for all status via getView(...) method

Note: Activity/Fragment/View reused in 2 or more apps with different loading status views?

Just provide a different Adapter for each app.
No need to change any usage code

demo

…

See demo code

2. Init Gloading by Adapter before use it

java
Gloading.initDefault(new GlobalAdapter());

Note: Use AutoRegister to decoupling this step.

3. Show global loading status views in all pages

3.1 Wrap something and return a Gloading.Holder object

java
//Gloading wrapped whole activity, wrapper view: android.R.id.content
Gloading.Holder holder = Gloading.getDefault().wrap(activity);

//with load failed retry task
Gloading.Holder holder = Gloading.getDefault().wrap(activity).withRetry(retryTask);

or

java
//Gloading will create a FrameLayout to wrap it
Gloading.Holder holder = Gloading.getDefault().wrap(view);

//with load failed retry task
Gloading.Holder holder = Gloading.getDefault().wrap(view).withRetry(retryTask);

3.1.1 Cover something within RelativeLayout (or ConstraintLayout) (since: v1.1.0)

java
//Gloading will create a FrameLayout to cover it
Gloading.Holder holder = Gloading.getDefault().cover(view);

//with load failed retry task
Gloading.Holder holder = Gloading.getDefault().cover(view).withRetry(retryTask);

3.2 Show status views for loading/loadFailed/empty/... by Gloading.Holder

java
//show loading status view by holder
holder.showLoading() 

//show load success status view by holder (frequently, hide gloading)
holder.showLoadSuccess()

//show load failed status view by holder (frequently, needs retry task)
holder.showFailed()

//show empty status view by holder. (load completed, but data is empty)
holder.showEmpty()

More Gloading.Holder APIs

Practice

1. Wrap into BaseActivity/BaseFragment

…

2. Call super methods inside subclasses

…

Debug mode

java
//debug mode. if set true, logs will print into logcat
Gloading.debug(trueOrFalse);

Thanks

Pictures in demo app all from: https://www.thiswaifudoesnotexist.net/

Global LoadingView pictures used in demo all from: https://www.iconfont.cn/

Special LoadingView UI used in demo from: https://github.com/ldoublem/LoadingView/

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言