Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
junixapp committed Dec 8, 2021
1 parent ff6d22a commit d6db63f
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 18 deletions.
1 change: 0 additions & 1 deletion app/src/main/assets/lottie/live_loading.json

This file was deleted.

Binary file removed app/src/main/assets/lottie/live_loading/img_0.png
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/assets/refresh.json
Original file line number Diff line number Diff line change
@@ -0,0 +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@3x@3x.png","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":[]}
Binary file added app/src/main/assets/refresh/img_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
android:orientation="vertical"
tools:context="com.lxj.demo1.MainActivity">


<include layout="@layout/layout_loading"/>


<Button
android:id="@+id/btn_loading"
android:layout_width="match_parent"
Expand Down
13 changes: 3 additions & 10 deletions app/src/main/res/layout/layout_loading.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
<!-- xmlns:app="http://schemas.android.com/apk/res-auto"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent">-->

<com.airbnb.lottie.LottieAnimationView xmlns:android="http://schemas.android.com/apk/res/android"
<com.airbnb.lottie.LottieAnimationView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="60pt"
android:layout_height="60pt"
android:layout_gravity="center"
android:layout_margin="5pt"
app:lottie_autoPlay="true"
app:lottie_fileName="lottie/refresh.json"
app:lottie_imageAssetsFolder="lottie/refresh"
app:lottie_fileName="refresh.json"
app:lottie_imageAssetsFolder="refresh"
app:lottie_loop="true"
app:lottie_speed="1" />

<!--</FrameLayout>-->
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class StateLayout @JvmOverloads constructor(context: Context, attributeSet: Attr
var emptyView: View? = null
var errorView: View? = null
var contentView: View? = null
var animDuration = 250L
var animDuration = 120L
var useContentBgWhenLoading = false //是否在Loading状态使用内容View的背景
var enableLoadingShadow = false //是否启用加载状态时的半透明阴影
var emptyText: String = ""
Expand Down Expand Up @@ -171,7 +171,7 @@ class StateLayout @JvmOverloads constructor(context: Context, attributeSet: Attr

private fun switch(v: View?) {
if (switchTask != null) {
removeCallbacks(switchTask)
mHandler.removeCallbacks(switchTask)
}
switchTask = SwitchTask(v)
mHandler.post(switchTask)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package com.lxj.statelayout
* 全局配置,对所有实例生效,但会被实例自己的配置覆盖
*/
object StateLayoutConfig {
var animDuration = 250L
var animDuration = 120L
var useContentBgWhenLoading = false //是否在Loading状态使用内容View的背景
var enableLoadingShadow = false //是否启用加载状态时的半透明阴影
var emptyText: String = "暂无数据"
Expand Down

0 comments on commit d6db63f

Please sign in to comment.