diff --git a/README.md b/README.md new file mode 100644 index 0000000..5e7ae00 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# NetworkCue + 自定义占位布局,封装到Base页面,使用更方便。基于StateView扩展了占位布局作为参数,以及空数据页面时点击也会回调(原生库并没有直接给空页面重试回调)。 + + +# 功能 + +参考StateView,inject的时候可以额外添加一个布局R.layout.xxxx作为参数,实现底部占位布局效果。 + + +# 使用方法: +``` + stateView = StateView.inject(this, R.layout.skeletona); + stateView.setAnimatorProvider(new RotateAnimatorProvider()); + stateView.showLoading(); +``` + +版本说明 + +# 当前版本 + +[![release](https://img.shields.io/badge/release-v1.0-orange.svg)](https://github.com/xuxinjiang/NetworkCue-/blob/master/update.md) + +## build.gradle设置 +``` +dependencies { +implementation 'com.github.xuxinjiang:NetworkCue:1.0' +} +``` +# 演示(请star支持) + +![image text](https://github.com/xuxinjiang/NetworkCue-/blob/master/gif/zjl.gif) + +# 联系方式 + +本群旨在为使用我github项目的人提供方便,如果遇到问题欢迎在群里提问。 + +### 欢迎加入QQ交流群(Q群574181465) + +![image text](https://github.com/xuxinjiang/NetworkCue-/blob/master/gif/qqqun.png) + + + diff --git a/app/src/main/java/com/skl/scheduleapp_master/MainActivity.java b/app/src/main/java/com/skl/scheduleapp_master/MainActivity.java index 7de0995..08417ba 100644 --- a/app/src/main/java/com/skl/scheduleapp_master/MainActivity.java +++ b/app/src/main/java/com/skl/scheduleapp_master/MainActivity.java @@ -2,15 +2,20 @@ import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; + import com.github.nukc.stateview.StateView; public class MainActivity extends AppCompatActivity { private StateView stateView; + private ImageView dataImage; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + dataImage = findViewById(R.id.dataImage); stateView = StateView.inject(this, R.layout.skeletona); stateView.setAnimatorProvider(new RotateAnimatorProvider()); stateView.showLoading(); @@ -19,7 +24,7 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void run() { try { - Thread.sleep(10000); + Thread.sleep(3000); } catch (InterruptedException e) { e.printStackTrace(); } @@ -28,6 +33,7 @@ public void run() { @Override public void run() { stateView.showContent(); + dataImage.setVisibility(View.VISIBLE); } } ); diff --git a/app/src/main/res/drawable/xinwen.jpg b/app/src/main/res/drawable/xinwen.jpg new file mode 100644 index 0000000..51127e8 Binary files /dev/null and b/app/src/main/res/drawable/xinwen.jpg differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 84f1951..27a7aca 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,18 +1,16 @@ - + \ No newline at end of file diff --git a/gif/dd.gif b/gif/dd.gif new file mode 100644 index 0000000..6629cd5 Binary files /dev/null and b/gif/dd.gif differ diff --git a/gif/qqqun.png b/gif/qqqun.png new file mode 100644 index 0000000..a1d2006 Binary files /dev/null and b/gif/qqqun.png differ diff --git a/update.md b/update.md new file mode 100644 index 0000000..9d3df77 --- /dev/null +++ b/update.md @@ -0,0 +1,5 @@ +## 更新日志 +### 2019-07-15 +V1.0 +- 初始版本上传 +