Skip to content

Commit

Permalink
fix(MainRecyclerAdapter.kt): 将原有的主界面中服务器IP隐藏的逻辑中的1.23.45.67替换为1.23.45…
Browse files Browse the repository at this point in the history
…***更新为1.23.45.*** (#3585)

Co-authored-by: xubeiyan <[email protected]>
  • Loading branch information
xubeiyan and xubeiyan authored Sep 23, 2024
1 parent 806290f commit dbe2684
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter<Mai
}
}

val strState = "${profile.server?.dropLast(3)}*** : ${profile.serverPort}"
// 替换服务器地址的'.'之后的内容为'***',例如将'1.23.45.67'替换为'1.23.45.***'
val parts = profile.server?.split('.')
val modifiedServer = parts?.dropLast(1)?.joinToString('.') + ".***"
val strState = "${modifiedServer} : ${profile.serverPort}"


holder.itemMainBinding.tvStatistics.text = strState

Expand Down

0 comments on commit dbe2684

Please sign in to comment.