Skip to content

Commit

Permalink
[Readme] 修改
Browse files Browse the repository at this point in the history
  • Loading branch information
F1ReKing committed Feb 3, 2018
1 parent 4fe3a93 commit 8c8d3a2
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# StatusLayout
[![](https://www.jitpack.io/v/F1ReKing/StatusLayout.svg)](https://www.jitpack.io/#F1ReKing/StatusLayout)

一个在Android上可切换状态的布局
一个在Android上可切换数据状态的布局,包含了加载布局,空数据布局,错误布局

## 预览图
<a href="res/statusLayout.gif"><img src="res/statusLayout.gif" width="30%"/></a>


## 引入

#### Step 1. Add the JitPack repository to your build file

```
allprojects {
repositories {
Expand Down
19 changes: 10 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

## Project-wide Gradle settings.
#
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Sat Feb 03 09:55:58 CST 2018
systemProp.http.proxyHost=127.0.0.1
org.gradle.jvmargs=-Xmx1536m
systemProp.http.proxyPort=1080
2 changes: 1 addition & 1 deletion library/src/main/res/layout/layout_loading.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>

<ProgressBar
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>

Expand Down
Binary file added res/statusLayout.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,19 @@ class MainActivity : AppCompatActivity() {
.setErrorClickText("重新加载...")
.setEmptyImg(R.drawable.ic_empty_sample)
.setErrorImg(R.drawable.ic_error_sample)
.setLoadingTextColor(R.color.material_blue_grey_900)
.setErrorTextColor(R.color.material_blue_grey_900)
.setErrorClickTextColor(R.color.material_blue_grey_900)
.setEmptyTextColor(R.color.material_blue_grey_900)
.setEmptyClickTextColor(R.color.material_blue_grey_900)
.setStatusClickListener(object : StatusClickListener {
override fun onEmptyClick(view: View) {
println("数据空")
Toast.makeText(this@MainActivity, "数据空", Toast.LENGTH_SHORT)
Toast.makeText(this@MainActivity, "点击了数据空", Toast.LENGTH_SHORT)
.show()
}

override fun onErrorClick(view: View) {
println("错误")
Toast.makeText(this@MainActivity, "错误", Toast.LENGTH_SHORT)
Toast.makeText(this@MainActivity, "点击了错误", Toast.LENGTH_SHORT)
.show()
}
})
Expand Down

0 comments on commit 8c8d3a2

Please sign in to comment.