Skip to content

Commit 8216c73

Browse files
committed
重复state则return
1 parent a0b7dea commit 8216c73

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class StateLayout @JvmOverloads constructor(context: Context, attributeSet: Attr
100100
}
101101

102102
private fun switchLayout(s: State) {
103+
if(state==s)return
103104
state = s
104105
when (state) {
105106
Loading -> {

0 commit comments

Comments
 (0)