srctree

Robin Linden parent a6418358 d52cb499
Display contacts' connection statuses

This is mainly a debug thing, but it gives you an idea of if you canexpect fast or slow file transfers and high or low voice call latency.

inlinesplit
atox/src/main/kotlin/ui/contact_profile/ContactProfileFragment.kt added: 17, removed: 3, total 14
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2019-2021 aTox contributors
// SPDX-FileCopyrightText: 2019-2022 aTox contributors
//
// SPDX-License-Identifier: GPL-3.0-only
 
@@ -18,6 +18,7 @@ import ltd.evilcorp.atox.ui.BaseFragment
import ltd.evilcorp.atox.ui.chat.CONTACT_PUBLIC_KEY
import ltd.evilcorp.atox.ui.colorByContactStatus
import ltd.evilcorp.atox.vmFactory
import ltd.evilcorp.core.vo.ConnectionStatus
import ltd.evilcorp.domain.tox.PublicKey
 
class ContactProfileFragment : BaseFragment<FragmentContactProfileBinding>(FragmentContactProfileBinding::inflate) {
@@ -47,6 +48,11 @@ class ContactProfileFragment : BaseFragment<FragmentContactProfileBinding>(Fragm
contactPublicKey.text = contact.publicKey
contactName.text = contact.name
contactStatusMessage.text = contact.statusMessage
contactConnectionStatus.text = when (contact.connectionStatus) {
ConnectionStatus.None -> getText(R.string.atox_offline)
ConnectionStatus.TCP -> getText(R.string.atox_connected_with_tcp)
ConnectionStatus.UDP -> getText(R.string.atox_connected_with_udp)
}
}
}
}
 
atox/src/main/res/layout/fragment_contact_profile.xml added: 17, removed: 3, total 14
@@ -60,6 +60,14 @@
android:textIsSelectable="true"
tools:text="Contact status message"/>
 
<TextView android:id="@+id/contactConnectionStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginBottom="8dp"
android:textIsSelectable="true"
tools:text="Contact connection status"/>
 
<View android:layout_width="match_parent"
android:layout_height="1px"
android:layout_margin="8dp"