【文件属性】:
文件名称:ProgressLayout-数据载入状态布局.zip
文件大小:157KB
文件格式:ZIP
更新时间:2022-10-13 20:12:01
开源项目
数据载入状态布局集成allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}dependencies {
compile 'com.github.nguyenhoanglam:ProgressLayout:1.0.1'
}使用像使用RelativeLayout一样(其实ProgressLayout继承了RelativeLayout):<?xml version="1.0" encoding="utf-8"?>
切换状态progressLayout.showLoading();//????
progressLayout.showEmpty();//????
progressLayout.showError();//????设置监听List skipIds = new ArrayList<>();
skipIds.add(R.id.toolbar);
progressLayout.showLoading(skipIds);
progressLayout.showEmpty(ContextCompat.getDrawable(this, R.drawable.ic_empty), "Empty data",skipIds);
// progressLayout.showError(ContextCompat.getDrawable(this, R.drawable.ic_no_connection), "No connection", "RETRY", new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Toast.makeText(MainActivity.this, "Reloading...", Toast.LENGTH_SHORT).show();
// }
// },skipIds);
// Show progress layout, hide all main views
// progressLayout.showLoading();
// progressLayout.showEmpty(ContextCompat.getDrawable(this, R.drawable.ic_empty), "Empty data");
// progressLayout.showError(ContextCompat.getDrawable(this, R.drawable.ic_no_connection), "No connection", "RETRY", new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// Toast.makeText(MainActivity.this, "Reloading...", Toast.LENGTH_SHORT).show();
// }
// });skipIds是ProgressLayout中显示的view id列表
【文件预览】:
ProgressLayout-master
----.gitignore(530B)
----gradle()
--------wrapper()
----README.md(5KB)
----progresslayout()
--------.gitignore(7B)
--------build.gradle(572B)
--------proguard-rules.pro(684B)
--------src()
----build.gradle(498B)
----gradlew.bat(2KB)
----gradlew(5KB)
----LICENSE(11KB)
----gradle.properties(855B)
----sample()
--------.gitignore(7B)
--------build.gradle(611B)
--------proguard-rules.pro(684B)
--------src()
----settings.gradle(37B)