Skip to content

Commit

Permalink
更新MD
Browse files Browse the repository at this point in the history
  • Loading branch information
Xxj-star committed Jul 30, 2019
1 parent 3f2953f commit b1aeb8a
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 10 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)



Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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();
}
Expand All @@ -28,6 +33,7 @@ public void run() {
@Override
public void run() {
stateView.showContent();
dataImage.setVisibility(View.VISIBLE);
}
}
);
Expand Down
Binary file added app/src/main/res/drawable/xinwen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 7 additions & 9 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/dataImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/xinwen"
android:visibility="gone" />

</android.support.constraint.ConstraintLayout>
Binary file added gif/dd.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gif/qqqun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions update.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 更新日志
### 2019-07-15
V1.0
- 初始版本上传

0 comments on commit b1aeb8a

Please sign in to comment.