mirror of
https://github.com/openlibrecommunity/olcng.git
synced 2026-07-03 14:05:17 +02:00
更新主页服务器地址ipv6隐藏效果 (#3615)
* Update MainRecyclerAdapter.kt * Update MainRecyclerAdapter.kt
This commit is contained in:
@@ -84,10 +84,12 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
|
||||
}
|
||||
}
|
||||
|
||||
// 替换服务器地址的'.'之后的内容为'***',例如将'1.23.45.67'替换为'1.23.45.***'
|
||||
val modifiedServer = profile.server?.split('.')?.dropLast(1)?.joinToString(".", postfix = ".***")
|
||||
val strState = "$modifiedServer : ${profile.serverPort}"
|
||||
|
||||
// 隐藏主页服务器地址为xxx:xxx:***/xxx.xxx.xxx.***
|
||||
val strState = "${profile.server?.let {
|
||||
if (it.contains(":"))
|
||||
it.split(":").take(2).joinToString(":") + ":***"
|
||||
else
|
||||
it.split('.').dropLast(1).joinToString(".", postfix = ".***") }} : ${profile.serverPort}"
|
||||
|
||||
holder.itemMainBinding.tvStatistics.text = strState
|
||||
|
||||
|
||||
Reference in New Issue
Block a user