Skip to content

Commit f47bf01

Browse files
committed
完善路由
1 parent 29b4246 commit f47bf01

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

app/src/main/java/com/flyjingfish/modulecommunication/MainActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import android.os.Bundle
66
import android.util.Log
77
import androidx.activity.ComponentActivity
88
import com.flyjingfish.login.LoginActivity
9+
import com.flyjingfish.module_communication_intercept.RouterInterceptManager
10+
import com.flyjingfish.module_communication_intercept.intercept.RouterIntercept
911
import com.flyjingfish.modulecommunication.databinding.ActivityMainBinding
1012
import com.flyjingfish.user.UserActivity
1113

lib-user/src/main/java/com/flyjingfish/user/UserIntercept.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ class UserIntercept : RouterIntercept {
1111
}
1212

1313
override fun order(): Int {
14-
return 2
14+
return 3
1515
}
1616
}

module-communication-intercept/src/main/java/com/flyjingfish/module_communication_intercept/RouterInterceptManager.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ object RouterInterceptManager {
88

99
fun addIntercept(intercept: RouterIntercept) {
1010
intercepts.add(intercept)
11+
val newIntercept = intercepts.sortedBy { it.order() }
12+
intercepts.clear()
13+
intercepts.addAll(newIntercept)
1114
}
1215

1316
fun addAllIntercept(intercepts: MutableSet<RouterIntercept>) {

0 commit comments

Comments
 (0)