百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
L

LoadingLayout

> 编程语言
开源

Android LoadingLayout

191 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Android LoadingLayout

LoadingLayout

方便的切换到加载中,空页面,出错页面和内容页面

LoadingLayout集成自Framelayout,默认把第一个子view当做内容视图,其他的子view会被忽略

使用如下:


  
    
  

可以通过代码来切换到不同的view

final LoadingLayout loadingLayout = (LoadingLayout) findViewById(R.id.loading_layout);
findViewById(R.id.btn_show_content).setOnClickListener((view) -> loadingLayout.showContent());
findViewById(R.id.btn_show_error).setOnClickListener((view) -> loadingLayout.showError());
findViewById(R.id.btn_show_empty).setOnClickListener((view) -> loadingLayout.showEmpty());
findViewById(R.id.btn_show_loading).setOnClickListener((view) -> loadingLayout.showLoading());

另外,针对errorView和emptyView,提供了两个重新加载的按钮。 需要注意的是,这里的重新加载的按钮的id必须是btn_error_retry或者btn_empty_retry

loadingLayout.setOnRetryClickListener((view) -> loadingLayout.showLoading());

当然,你也可以自己自定义各种视图


    
      
    

Gradle中使用

推荐使用jitpack

repositories {
    // ...
    maven { url "https://jitpack.io" }
}

dependencies {
    compile 'com.github.lzyzsd:XMFE-TEAM:LoadingLayout:0.1.0'
}

License

MIT

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

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