diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 000000000..93c9b4e7b --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 26c2c7611..8ae73c3b1 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -83,6 +83,9 @@ dependencies { // https://github.com/GetStream/avatarview-android/blob/main/LICENSE Apache v2.0 implementation "io.getstream:avatarview-coil:1.0.7" + // https://github.com/akexorcist/RoundCornerProgressBar/blob/master/LICENSE.txt + implementation 'com.akexorcist:round-corner-progress-bar:2.2.1' + implementation platform('com.google.firebase:firebase-bom:30.3.2') implementation 'com.google.firebase:firebase-messaging' diff --git a/app/src/main/java/org/linphone/ui/contacts/model/ContactDeviceModel.kt b/app/src/main/java/org/linphone/ui/contacts/model/ContactDeviceModel.kt new file mode 100644 index 000000000..59cab2ca5 --- /dev/null +++ b/app/src/main/java/org/linphone/ui/contacts/model/ContactDeviceModel.kt @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2010-2020 Belledonne Communications SARL. + * + * This file is part of linphone-android + * (see https://www.linphone.org). + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.linphone.ui.contacts.model + +class ContactDeviceModel( + val name: String, + val trusted: Boolean +) diff --git a/app/src/main/java/org/linphone/ui/contacts/ContactNumberOrAddressModel.kt b/app/src/main/java/org/linphone/ui/contacts/model/ContactNumberOrAddressModel.kt similarity index 97% rename from app/src/main/java/org/linphone/ui/contacts/ContactNumberOrAddressModel.kt rename to app/src/main/java/org/linphone/ui/contacts/model/ContactNumberOrAddressModel.kt index d8693b99f..bfe5c2778 100644 --- a/app/src/main/java/org/linphone/ui/contacts/ContactNumberOrAddressModel.kt +++ b/app/src/main/java/org/linphone/ui/contacts/model/ContactNumberOrAddressModel.kt @@ -17,7 +17,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package org.linphone.ui.contacts +package org.linphone.ui.contacts.model import androidx.lifecycle.MutableLiveData import org.linphone.core.Address diff --git a/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactViewModel.kt b/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactViewModel.kt index 0b0f2c7e5..129711614 100644 --- a/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactViewModel.kt +++ b/app/src/main/java/org/linphone/ui/contacts/viewmodel/ContactViewModel.kt @@ -23,9 +23,10 @@ import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import org.linphone.LinphoneApplication.Companion.coreContext import org.linphone.core.Address -import org.linphone.ui.contacts.ContactNumberOrAddressClickListener -import org.linphone.ui.contacts.ContactNumberOrAddressModel +import org.linphone.ui.contacts.model.ContactDeviceModel import org.linphone.ui.contacts.model.ContactModel +import org.linphone.ui.contacts.model.ContactNumberOrAddressClickListener +import org.linphone.ui.contacts.model.ContactNumberOrAddressModel import org.linphone.utils.Event class ContactViewModel : ViewModel() { @@ -33,6 +34,8 @@ class ContactViewModel : ViewModel() { val sipAddressesAndPhoneNumbers = MutableLiveData>() + val devices = MutableLiveData>() + val company = MutableLiveData() val showBackButton = MutableLiveData() @@ -63,6 +66,7 @@ class ContactViewModel : ViewModel() { } override fun onLongPress(model: ContactNumberOrAddressModel) { + // UI thread showLongPressMenuForNumberOrAddress.value = Event(model) } } @@ -106,6 +110,15 @@ class ContactViewModel : ViewModel() { addressesAndNumbers.add(data) } sipAddressesAndPhoneNumbers.postValue(addressesAndNumbers) + + val devicesList = arrayListOf() + // TODO FIXME + devicesList.add(ContactDeviceModel("Pixel 6 Pro de Sylvain", true)) + devicesList.add(ContactDeviceModel("Sylvain Galaxy Tab S9 Pro+ Ultra", true)) + devicesList.add(ContactDeviceModel("MacBook Pro de Marcel", false)) + devicesList.add(ContactDeviceModel("sylvain@fedora-linux-38", true)) + devices.postValue(devicesList) + contactFoundEvent.postValue(Event(true)) } } diff --git a/app/src/main/res/drawable/shape_round_orange_background.xml b/app/src/main/res/drawable/shape_round_orange_background.xml new file mode 100644 index 000000000..4ed69d22c --- /dev/null +++ b/app/src/main/res/drawable/shape_round_orange_background.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/trusted.xml b/app/src/main/res/drawable/trusted.xml new file mode 100644 index 000000000..de46bb278 --- /dev/null +++ b/app/src/main/res/drawable/trusted.xml @@ -0,0 +1,23 @@ + + + + + diff --git a/app/src/main/res/drawable/warning.xml b/app/src/main/res/drawable/warning.xml new file mode 100644 index 000000000..49302ddf2 --- /dev/null +++ b/app/src/main/res/drawable/warning.xml @@ -0,0 +1,13 @@ + + + diff --git a/app/src/main/res/layout/contact_device_trust_list_cell.xml b/app/src/main/res/layout/contact_device_trust_list_cell.xml new file mode 100644 index 000000000..0abfd2c9c --- /dev/null +++ b/app/src/main/res/layout/contact_device_trust_list_cell.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/contact_fragment.xml b/app/src/main/res/layout/contact_fragment.xml index 782d77f8a..46895dcd9 100644 --- a/app/src/main/res/layout/contact_fragment.xml +++ b/app/src/main/res/layout/contact_fragment.xml @@ -1,6 +1,7 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:bind="http://schemas.android.com/tools"> @@ -78,7 +79,7 @@ android:id="@+id/avatar" android:layout_width="72dp" android:layout_height="72dp" - android:layout_marginTop="38dp" + android:layout_marginTop="32dp" android:adjustViewBounds="true" contactAvatar="@{viewModel.contact}" app:avatarViewBorderWidth="0dp" @@ -95,7 +96,7 @@ app:avatarViewShape="circle" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@id/background" /> + app:layout_constraintTop_toTopOf="parent" /> + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/trust_background"/> + type="org.linphone.ui.contacts.model.ContactNumberOrAddressModel" /> #09C5F4 #DFECF2 #F4F4F7 + #4AA8FF + #FFEACB #6C7A87 #F9F9F9