Fixed navigation issue after saving changes in contact editor

This commit is contained in:
Sylvain Berfini 2021-01-21 18:02:00 +01:00
parent 2dd034cfbd
commit 400e64e18e
3 changed files with 15 additions and 3 deletions

View file

@ -445,8 +445,13 @@ internal fun MasterContactsFragment.navigateToContactEditor(sipUriToAdd: String?
}
internal fun ContactEditorFragment.navigateToContact(contact: NativeContact) {
val deepLink = "linphone-android://contact/view/${contact.nativeId}"
findMasterNavController().navigate(Uri.parse(deepLink), getRightToLeftAnimationNavOptions())
val bundle = Bundle()
bundle.putString("id", contact.nativeId)
findNavController().navigate(
R.id.action_contactEditorFragment_to_detailContactFragment,
bundle,
getRightToLeftAnimationNavOptions(R.id.detailContactFragment, true)
)
}
internal fun DetailContactFragment.navigateToChatRoom(args: Bundle?) {

View file

@ -24,6 +24,9 @@
android:name="SipUri"
app:argType="string"
app:nullable="true" />
<action
android:id="@+id/action_contactEditorFragment_to_detailContactFragment"
app:destination="@id/detailContactFragment" />
</fragment>
<fragment

View file

@ -25,6 +25,10 @@
android:id="@+id/contactEditorFragment"
android:name="org.linphone.activities.main.contact.fragments.ContactEditorFragment"
tools:layout="@layout/contact_editor_fragment"
android:label="ContactEditorFragment" />
android:label="ContactEditorFragment" >
<action
android:id="@+id/action_contactEditorFragment_to_detailContactFragment"
app:destination="@id/detailContactFragment" />
</fragment>
</navigation>