MaterialPageStateLayout
PageStateLayout could let you show [Loading][Empty][Error][Succeed][Requesting] state in Activity, Fragment, ViewGroup as you want.
Install / Use
/learn @Syehunter/MaterialPageStateLayoutREADME
PageStateLayout
PageStateLayout could let you show [Loading][Empty][Error][Succeed][Requesting] state in Activity, Fragment, ViewGroup as you want.
Improt library:
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
compile 'com.github.Syehunter:PageStateLayout:0.1.2.2'
}

U can use the layout wherever u want!
Following Methods are supported:
//replace activity.setContentView()
pageStateLayout.load(activity, succeedView);
//parent instanceof ViewGroup
pageStateLayout.load(parent, suuccedView);
//use this if u don't want any containers
//such as in fragment.onCreateView, just return pageStateLayout
pageStateLayout.load(succeedView);
It has 5 states:
onLoading();
onEmpty();
onError();
onSucceed();
//In some activities u may want to show both the progressbar and succeedView, such as LoginActivity, then switch on this state
onRequesting();
If u wan't to replace these pages with some others designed by yourself(you'd better do it in you application or BaseActivity)
PageStateLayout.Builder.setLoadingView(resId);
PageStateLayout.Builder.setEmptyView(resId);
PageSateLayout.Builder.setErrorView(resId);
U can use other methods in PageStateLayout.Builder to change the progressColor, the errorImage, the emptyPromt and so on;
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
84.7kCommit, push, and open a PR
