File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
ptr-lib/src/main/java/wtf/s1/android/ptr Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -15,22 +15,10 @@ interface NSPtrConfig {
1515 fun pullFriction (type : Int ): Float = 0.56f
1616
1717 fun generateTouchReleaseEvent (): NSPtrLayout .Event ? {
18- return when (requireLayout().stateMachine.state) {
19- is NSPtrLayout .State .DRAG -> {
20- if (overToRefreshPosition()) {
21- NSPtrLayout .Event .ReleaseToRefreshing
22- } else {
23- NSPtrLayout .Event .ReleaseToIdle
24- }
25- }
26- is NSPtrLayout .State .REFRESHING -> {
27- if (! overToRefreshPosition()) {
28- NSPtrLayout .Event .ReleaseToIdle
29- } else {
30- null
31- }
32- }
33- else -> null
18+ return if (overToRefreshPosition()) {
19+ NSPtrLayout .Event .ReleaseToRefreshing
20+ } else {
21+ NSPtrLayout .Event .ReleaseToIdle
3422 }
3523 }
3624
You can’t perform that action at this time.
0 commit comments