-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Organize routing files names (#3717)
* Organize routing files names Organize routing files names * Use enum for routing type Use enum for routing type
- Loading branch information
1 parent
3de3070
commit ca849fb
Showing
2 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
V2rayNG/app/src/main/kotlin/com/v2ray/ang/dto/RoutingType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.v2ray.ang.dto | ||
|
||
enum class RoutingType(val fileName: String) { | ||
WHITE("custom_routing_white"), | ||
BLACK("custom_routing_black"), | ||
GLOBAL("custom_routing_global"), | ||
WHITE_IRAN("custom_routing_white_iran"); | ||
|
||
companion object { | ||
fun fromIndex(index: Int): RoutingType { | ||
return when (index) { | ||
0 -> WHITE | ||
1 -> BLACK | ||
2 -> GLOBAL | ||
3 -> WHITE_IRAN | ||
else -> WHITE | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters