Skip to content

Commit d6db63f

Browse files
committed
fix bugs
1 parent ff6d22a commit d6db63f

File tree

8 files changed

+7
-18
lines changed

8 files changed

+7
-18
lines changed

app/src/main/assets/lottie/live_loading.json

Lines changed: 0 additions & 1 deletion
This file was deleted.
-4.07 KB
Binary file not shown.

app/src/main/assets/refresh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"v":"5.1.20","fr":12,"ip":0,"op":16,"w":160,"h":160,"nm":"合成 1","ddd":0,"assets":[{"id":"image_0","w":228,"h":216,"u":"images/","p":"img_0.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"编组 2@[email protected]","cl":"png","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":0,"s":[80,153.28,0],"e":[80,83.28,0],"to":[0,-11.6666669845581,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":4.667,"s":[80,83.28,0],"e":[80,153.28,0],"to":[0,0,0],"ti":[0,-3.66666674613953,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"n":"0p667_1_0p333_0","t":8,"s":[80,153.28,0],"e":[80,105.28,0],"to":[0,3.66666674613953,0],"ti":[0,0,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.333,"y":0},"n":"0p833_0p833_0p333_0","t":11.667,"s":[80,105.28,0],"e":[80,153.28,0],"to":[0,0,0],"ti":[0,-8,0]},{"t":14}],"ix":2},"a":{"a":0,"k":[114,216,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":0,"s":[33,33,100],"e":[30,36,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":4,"s":[30,36,100],"e":[38,30,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":8,"s":[38,30,100],"e":[31,35,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":11,"s":[31,35,100],"e":[36,30,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":14,"s":[36,30,100],"e":[33,33,100]},{"t":16}],"ix":6}},"ao":0,"ip":0,"op":36,"st":0,"bm":0}],"markers":[]}

app/src/main/assets/refresh/img_0.png

26.3 KB
Loading

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
android:orientation="vertical"
1212
tools:context="com.lxj.demo1.MainActivity">
1313

14-
15-
<include layout="@layout/layout_loading"/>
16-
17-
1814
<Button
1915
android:id="@+id/btn_loading"
2016
android:layout_width="match_parent"
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<!--<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
3-
<!-- xmlns:app="http://schemas.android.com/apk/res-auto"-->
4-
<!-- android:layout_width="match_parent"-->
5-
<!-- android:layout_height="match_parent">-->
6-
7-
<com.airbnb.lottie.LottieAnimationView xmlns:android="http://schemas.android.com/apk/res/android"
2+
<com.airbnb.lottie.LottieAnimationView xmlns:android="http://schemas.android.com/apk/res/android"
83
xmlns:app="http://schemas.android.com/apk/res-auto"
94
android:layout_width="60pt"
105
android:layout_height="60pt"
116
android:layout_gravity="center"
127
android:layout_margin="5pt"
138
app:lottie_autoPlay="true"
14-
app:lottie_fileName="lottie/refresh.json"
15-
app:lottie_imageAssetsFolder="lottie/refresh"
9+
app:lottie_fileName="refresh.json"
10+
app:lottie_imageAssetsFolder="refresh"
1611
app:lottie_loop="true"
1712
app:lottie_speed="1" />
18-
19-
<!--</FrameLayout>-->

statelayout-library/src/main/java/com/lxj/statelayout/StateLayout.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class StateLayout @JvmOverloads constructor(context: Context, attributeSet: Attr
2424
var emptyView: View? = null
2525
var errorView: View? = null
2626
var contentView: View? = null
27-
var animDuration = 250L
27+
var animDuration = 120L
2828
var useContentBgWhenLoading = false //是否在Loading状态使用内容View的背景
2929
var enableLoadingShadow = false //是否启用加载状态时的半透明阴影
3030
var emptyText: String = ""
@@ -171,7 +171,7 @@ class StateLayout @JvmOverloads constructor(context: Context, attributeSet: Attr
171171

172172
private fun switch(v: View?) {
173173
if (switchTask != null) {
174-
removeCallbacks(switchTask)
174+
mHandler.removeCallbacks(switchTask)
175175
}
176176
switchTask = SwitchTask(v)
177177
mHandler.post(switchTask)

statelayout-library/src/main/java/com/lxj/statelayout/StateLayoutConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package com.lxj.statelayout
44
* 全局配置,对所有实例生效,但会被实例自己的配置覆盖
55
*/
66
object StateLayoutConfig {
7-
var animDuration = 250L
7+
var animDuration = 120L
88
var useContentBgWhenLoading = false //是否在Loading状态使用内容View的背景
99
var enableLoadingShadow = false //是否启用加载状态时的半透明阴影
1010
var emptyText: String = "暂无数据"

0 commit comments

Comments
 (0)