Skip to content

Commit

Permalink
v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
892505102@qq.com committed May 14, 2019
1 parent 0c775e8 commit 9d9c66e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 30 deletions.
75 changes: 46 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,44 @@
# scorpio
[ ![Download](https://api.bintray.com/packages/danyon/maven/scorpio/images/download.svg) ](https://bintray.com/danyon/maven/scorpio/_latestVersion)[![License](https://img.shields.io/badge/license-Apache%202-lightgrey.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)

#### 项目介绍
状态切换框架,内置数据为空,错误,加载中三种默认布局。
一行代码切换状态布局,内置数据为空,错误,加载中三种默认布局。


#### 安装教程
## gradle依赖

```groovy
implementation 'com.lnysky.tech:scorpio:0.0.1'
implementation 'com.lnysky.tech:scorpio:Latest Version'
```

#### 使用说明

#### 使用
- 加载中
```java
Scorpio.loading(this).setTips("加载中...").show();
```
- 数据为空
```java
Scorpio.empty(this).setTips("主页面空空的~~").show();
```
- 加载出错
```java
public class MainActivity extends AppCompatActivity {
Scorpio.error(this)
.setRetryText("重新加载")
.setOnRetryListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Scorpio.loading(MainActivity.this).show();
}
}).show();
```
- 自定义状态布局

@Override
```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//Scorpio.content(this).show();
Scorpio.loading(this).setTips("加载中...").show();
//Scorpio.empty(this).setTips("主页面空空的~~").show();
//Scorpio.error(this).setRetryText("重新加载")
// .setOnRetryListener(new View.OnClickListener() {
// @Override
// public void onClick(View v) {
// Scorpio.loading(MainActivity.this).show();
// }
// }).show();
//Scorpio.with(this).get(CustomState.class).show();
Scorpio.with(this).get(CustomState.class).show();
}
}
```

```java
public static class CustomState extends State<CustomState.ViewHolder> {

public CustomState(StateSwitcher switcher) {
super(switcher);
}
public class CustomState extends State<CustomState.ViewHolder> {

@Override
protected ViewHolder onCreateStateViewHolder(LayoutInflater inflater, ViewGroup parent) {
Expand Down Expand Up @@ -68,3 +67,21 @@ public static class CustomState extends State<CustomState.ViewHolder> {
}
}
```
## License

```
Copyright (C) 2017 - present, Danyon Liu.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

2 changes: 1 addition & 1 deletion config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ext {
]

bintray = [
version : "0.0.1", // 指定库的版本号
version : "0.0.2", // 指定库的版本号
group : "com.lnysky.tech", // 库的group名,确定好之后不能修改

siteUrl : "https://github.com/lnysky/scorpio.git", // 项目开源地址
Expand Down

0 comments on commit 9d9c66e

Please sign in to comment.