mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
feat: display the instance uptime on initial instance selection
This commit is contained in:
parent
c545d744bd
commit
1a5b74cab3
@ -29,13 +29,15 @@ class InstancesAdapter(
|
|||||||
override fun onBindViewHolder(holder: InstancesViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: InstancesViewHolder, position: Int) {
|
||||||
val instance = instances[position]
|
val instance = instances[position]
|
||||||
holder.binding.apply {
|
holder.binding.apply {
|
||||||
var instanceText = "${instance.name} ${instance.locations}"
|
var instanceText = "${instance.name} ${instance.locations}"
|
||||||
if (instance.cdn) instanceText += " (\uD83C\uDF10 CDN)"
|
if (instance.cdn) instanceText += " (\uD83C\uDF10 CDN)"
|
||||||
if (instance.registrationDisabled) {
|
if (instance.registrationDisabled) {
|
||||||
instanceText +=
|
instanceText +=
|
||||||
" (${root.context.getString(R.string.registration_disabled)})"
|
" (${root.context.getString(R.string.registration_disabled)})"
|
||||||
}
|
}
|
||||||
|
instanceText += ", " + root.context.getString(R.string.uptime, instance.uptimeMonth)
|
||||||
radioButton.text = instanceText
|
radioButton.text = instanceText
|
||||||
|
|
||||||
radioButton.setOnCheckedChangeListener(null)
|
radioButton.setOnCheckedChangeListener(null)
|
||||||
radioButton.isChecked = selectedInstanceIndex == position
|
radioButton.isChecked = selectedInstanceIndex == position
|
||||||
radioButton.setOnCheckedChangeListener { _, isChecked ->
|
radioButton.setOnCheckedChangeListener { _, isChecked ->
|
||||||
|
@ -500,6 +500,7 @@
|
|||||||
<string name="time_in_minutes">Time in minutes</string>
|
<string name="time_in_minutes">Time in minutes</string>
|
||||||
<string name="invalid_input">Invalid input</string>
|
<string name="invalid_input">Invalid input</string>
|
||||||
<string name="add_to_group">Add to group</string>
|
<string name="add_to_group">Add to group</string>
|
||||||
|
<string name="uptime">%.2f%% uptime</string>
|
||||||
|
|
||||||
<!-- Notification channel strings -->
|
<!-- Notification channel strings -->
|
||||||
<string name="download_channel_name">Download Service</string>
|
<string name="download_channel_name">Download Service</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user