in tv/src/main/java/com/github/shadowsocks/tv/ProfilesDialogFragment.kt [61:72]
override fun onBindViewHolder(holder: ProfileViewHolder, position: Int) {
val profile = profiles[position]
holder.widgetView.isChecked = profile.id == DataStore.profileId
holder.titleView.text = profile.formattedName
holder.itemView.findViewById<TextView>(android.R.id.summary).text = ArrayList<String>().apply {
if (!profile.name.isNullOrEmpty()) this += profile.formattedAddress
val id = PluginConfiguration(profile.plugin ?: "").selected
if (id.isNotEmpty()) this += getString(R.string.profile_plugin, id)
if (profile.tx > 0 || profile.rx > 0) this += getString(R.string.traffic,
Formatter.formatFileSize(activity, profile.tx), Formatter.formatFileSize(activity, profile.rx))
}.joinToString("\n")
}