Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
linphone-android
Commits
db2ce910
Commit
db2ce910
authored
5 months ago
by
Sylvain Berfini
Browse files
Options
Download
Patches
Plain Diff
Fixed pre-selected contacts not having the checkmark in participants list edition
parent
0baceddf
master
feature/show_unsecure_conversation_event_at_top
feature/use_theme_main_color_for_icon_and_splashscreen
fix/insistent_notification
fix/restore_previous_release_ringtone_player
fix/telecom_default_audio_endpoint
release/6.0
6.1.0-alpha
6.0.0
6.0.0-beta
1 merge request
!1528
Fixed pre-selected contacts not having the checkmark in participants list edition
Pipeline
#83267
passed with stage
in 9 minutes and 34 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/src/main/java/org/linphone/ui/main/fragment/AddParticipantsFragment.kt
+4
-3
.../org/linphone/ui/main/fragment/AddParticipantsFragment.kt
app/src/main/java/org/linphone/ui/main/viewmodel/AddParticipantsViewModel.kt
+4
-0
...rg/linphone/ui/main/viewmodel/AddParticipantsViewModel.kt
app/src/main/java/org/linphone/ui/main/viewmodel/AddressSelectionViewModel.kt
+11
-0
...g/linphone/ui/main/viewmodel/AddressSelectionViewModel.kt
with
19 additions
and
3 deletions
app/src/main/java/org/linphone/ui/main/fragment/AddParticipantsFragment.kt
+
4
−
3
View file @
db2ce910
...
...
@@ -81,13 +81,14 @@ class AddParticipantsFragment : GenericAddressPickerFragment() {
setupRecyclerView
(
binding
.
contactsList
)
val
participants
=
args
.
selectedParticipants
if
(!
participants
.
isNullOrEmpty
())
{
viewModel
.
addSelectedParticipants
(
participants
)
}
viewModel
.
modelsList
.
observe
(
viewLifecycleOwner
)
{
if
(!
participants
.
isNullOrEmpty
())
{
viewModel
.
addSelectedParticipants
(
participants
)
}
Log
.
i
(
"$TAG Contacts & suggestions list is ready with [${it.size}] items"
)
adapter
.
submitList
(
it
)
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/org/linphone/ui/main/viewmodel/AddParticipantsViewModel.kt
+
4
−
0
View file @
db2ce910
...
...
@@ -23,6 +23,7 @@ import androidx.annotation.UiThread
import
androidx.lifecycle.MutableLiveData
import
org.linphone.LinphoneApplication.Companion.coreContext
import
org.linphone.R
import
org.linphone.core.Address
import
org.linphone.core.tools.Log
import
org.linphone.ui.main.model.SelectedAddressModel
import
org.linphone.utils.AppUtils
...
...
@@ -45,6 +46,7 @@ class AddParticipantsViewModel @UiThread constructor() : AddressSelectionViewMod
coreContext
.
postOnCoreThread
{
core
->
Log
.
i
(
"$TAG Adding [${participants.size}] pre-selected participants"
)
val
list
=
arrayListOf
<
SelectedAddressModel
>()
val
addresses
=
arrayListOf
<
Address
>()
for
(
uri
in
participants
)
{
val
address
=
core
.
interpretUrl
(
uri
,
false
)
...
...
@@ -52,6 +54,7 @@ class AddParticipantsViewModel @UiThread constructor() : AddressSelectionViewMod
Log
.
e
(
"$TAG Failed to parse participant URI [$uri] as address!"
)
continue
}
addresses
.
add
(
address
)
val
avatarModel
=
coreContext
.
contactsManager
.
getContactAvatarModelForAddress
(
address
...
...
@@ -70,6 +73,7 @@ class AddParticipantsViewModel @UiThread constructor() : AddressSelectionViewMod
)
)
selection
.
postValue
(
list
)
updateSelectedParticipants
(
addresses
)
}
}
...
...
This diff is collapsed.
Click to expand it.
app/src/main/java/org/linphone/ui/main/viewmodel/AddressSelectionViewModel.kt
+
11
−
0
View file @
db2ce910
...
...
@@ -28,6 +28,7 @@ import org.linphone.LinphoneApplication.Companion.coreContext
import
org.linphone.LinphoneApplication.Companion.corePreferences
import
org.linphone.R
import
org.linphone.contacts.ContactsManager
import
org.linphone.core.Address
import
org.linphone.core.ChatRoom
import
org.linphone.core.Friend
import
org.linphone.core.MagicSearch
...
...
@@ -135,6 +136,16 @@ abstract class AddressSelectionViewModel @UiThread constructor() : DefaultAccoun
)
}
@WorkerThread
fun
updateSelectedParticipants
(
selectedAddresses
:
List
<
Address
>)
{
for
(
address
in
selectedAddresses
)
{
val
found
=
modelsList
.
value
.
orEmpty
().
find
{
it
.
address
.
weakEqual
(
address
)
}
found
?.
selected
?.
postValue
(
true
)
}
}
@WorkerThread
fun
addAddressModelToSelection
(
model
:
SelectedAddressModel
)
{
val
actual
=
selection
.
value
.
orEmpty
()
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets