mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 03:18:06 +00:00
Expand contact's devices for trust by default unless at 100%
This commit is contained in:
parent
409baab7c4
commit
137e8941cb
2 changed files with 9 additions and 10 deletions
|
|
@ -47,7 +47,6 @@ import org.linphone.ui.main.contacts.model.ContactAvatarModel
|
|||
import org.linphone.ui.main.contacts.model.ContactDeviceModel
|
||||
import org.linphone.ui.main.contacts.model.ContactNumberOrAddressClickListener
|
||||
import org.linphone.ui.main.contacts.model.ContactNumberOrAddressModel
|
||||
import org.linphone.ui.main.model.isEndToEndEncryptionMandatory
|
||||
import org.linphone.utils.AppUtils
|
||||
import org.linphone.utils.Event
|
||||
import org.linphone.utils.FileUtils
|
||||
|
|
@ -259,14 +258,11 @@ class ContactViewModel
|
|||
chatDisabled.postValue(corePreferences.disableChat)
|
||||
videoCallDisabled.postValue(!core.isVideoEnabled)
|
||||
|
||||
val defaultDomain = LinphoneUtils.getDefaultAccount()?.params?.domain == corePreferences.defaultDomain
|
||||
// Only show contact's devices for Linphone accounts
|
||||
showContactTrustAndDevices.postValue(
|
||||
LinphoneUtils.getDefaultAccount()?.params?.domain == corePreferences.defaultDomain
|
||||
)
|
||||
// Only expand contacts' devices & trust by default if in E2E encrypted mode
|
||||
expandDevicesTrust.postValue(
|
||||
isEndToEndEncryptionMandatory()
|
||||
)
|
||||
showContactTrustAndDevices.postValue(defaultDomain)
|
||||
|
||||
expandDevicesTrust.postValue(defaultDomain)
|
||||
coreContext.contactsManager.addListener(contactsListener)
|
||||
}
|
||||
}
|
||||
|
|
@ -643,6 +639,9 @@ class ContactViewModel
|
|||
} else {
|
||||
trustedDevicesPercentageFloat.postValue(percentage / 100f / 2)
|
||||
}
|
||||
if (percentage == 100) {
|
||||
expandDevicesTrust.postValue(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -102,8 +102,8 @@
|
|||
<androidx.constraintlayout.widget.Group
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:constraint_referenced_ids="trusted_devices_count, trusted_devices_progress, devices, trusted_devices_progress_label"
|
||||
android:visibility="@{viewModel.showContactTrustAndDevices ? (viewModel.expandDevicesTrust && viewModel.devices.size() > 0 ? View.VISIBLE : View.GONE) : View.GONE}" />
|
||||
app:constraint_referenced_ids="trusted_devices_count, trusted_devices_progress, devices, trusted_devices_progress_label, trusted_devices_progress_background"
|
||||
android:visibility="@{viewModel.showContactTrustAndDevices ? (viewModel.expandDevicesTrust && viewModel.devices.size() > 0 ? View.VISIBLE : View.GONE) : View.GONE, default=gone}" />
|
||||
|
||||
<include
|
||||
android:id="@+id/avatar"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue