Fixed navigation issue
This commit is contained in:
parent
35729e5726
commit
7deef26f80
5 changed files with 7 additions and 36 deletions
|
@ -33,7 +33,6 @@ import android.webkit.MimeTypeMap
|
||||||
import android.widget.PopupWindow
|
import android.widget.PopupWindow
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.content.FileProvider
|
import androidx.core.content.FileProvider
|
||||||
import androidx.core.view.doOnPreDraw
|
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
@ -163,6 +162,7 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
postponeEnterTransition()
|
||||||
|
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
|
||||||
|
@ -208,11 +208,6 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
view.doOnPreDraw {
|
|
||||||
// Notifies fragment is ready to be drawn
|
|
||||||
sharedViewModel.chatRoomFragmentOpenedEvent.value = Event(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
Compatibility.setLocusIdInContentCaptureSession(binding.root, chatRoom)
|
Compatibility.setLocusIdInContentCaptureSession(binding.root, chatRoom)
|
||||||
|
|
||||||
isSecure = chatRoom.currentParams.isEncryptionEnabled
|
isSecure = chatRoom.currentParams.isEncryptionEnabled
|
||||||
|
@ -800,6 +795,8 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
sharedViewModel.isPendingMessageForward.value = false
|
sharedViewModel.isPendingMessageForward.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startPostponedEnterTransition()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun deleteItems(indexesOfItemToDelete: ArrayList<Int>) {
|
override fun deleteItems(indexesOfItemToDelete: ArrayList<Int>) {
|
||||||
|
|
|
@ -115,15 +115,6 @@ class MasterChatRoomsFragment : MasterFragment<ChatRoomMasterFragmentBinding, Ch
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// Chat room loading can take some time, so wait until it is ready before opening the pane
|
|
||||||
sharedViewModel.chatRoomFragmentOpenedEvent.observe(
|
|
||||||
viewLifecycleOwner
|
|
||||||
) {
|
|
||||||
it.consume {
|
|
||||||
binding.slidingPane.openPane()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sharedViewModel.layoutChangedEvent.observe(
|
sharedViewModel.layoutChangedEvent.observe(
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
|
@ -280,6 +271,7 @@ class MasterChatRoomsFragment : MasterFragment<ChatRoomMasterFragmentBinding, Ch
|
||||||
sharedViewModel
|
sharedViewModel
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
binding.slidingPane.openPane()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,6 @@ import android.content.Intent
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.core.view.doOnPreDraw
|
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import org.linphone.LinphoneApplication.Companion.coreContext
|
import org.linphone.LinphoneApplication.Companion.coreContext
|
||||||
import org.linphone.R
|
import org.linphone.R
|
||||||
|
@ -48,6 +47,7 @@ class DetailContactFragment : GenericFragment<ContactDetailFragmentBinding>() {
|
||||||
|
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
postponeEnterTransition()
|
||||||
|
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
|
||||||
|
@ -140,10 +140,7 @@ class DetailContactFragment : GenericFragment<ContactDetailFragmentBinding>() {
|
||||||
}
|
}
|
||||||
viewModel.updateNumbersAndAddresses()
|
viewModel.updateNumbersAndAddresses()
|
||||||
|
|
||||||
view.doOnPreDraw {
|
startPostponedEnterTransition()
|
||||||
// Notifies fragment is ready to be drawn
|
|
||||||
sharedViewModel.contactFragmentOpenedEvent.value = Event(true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
|
|
@ -98,14 +98,6 @@ class MasterContactsFragment : MasterFragment<ContactMasterFragmentBinding, Cont
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sharedViewModel.contactFragmentOpenedEvent.observe(
|
|
||||||
viewLifecycleOwner
|
|
||||||
) {
|
|
||||||
it.consume {
|
|
||||||
binding.slidingPane.openPane()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sharedViewModel.layoutChangedEvent.observe(
|
sharedViewModel.layoutChangedEvent.observe(
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
|
@ -230,6 +222,7 @@ class MasterContactsFragment : MasterFragment<ContactMasterFragmentBinding, Cont
|
||||||
sipUriToAdd = null
|
sipUriToAdd = null
|
||||||
} else {
|
} else {
|
||||||
navigateToContact()
|
navigateToContact()
|
||||||
|
binding.slidingPane.openPane()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,10 +39,6 @@ class SharedMainViewModel : ViewModel() {
|
||||||
|
|
||||||
/* Chat */
|
/* Chat */
|
||||||
|
|
||||||
val chatRoomFragmentOpenedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
|
||||||
MutableLiveData<Event<Boolean>>()
|
|
||||||
}
|
|
||||||
|
|
||||||
val selectedChatRoom = MutableLiveData<ChatRoom>()
|
val selectedChatRoom = MutableLiveData<ChatRoom>()
|
||||||
var destructionPendingChatRoom: ChatRoom? = null
|
var destructionPendingChatRoom: ChatRoom? = null
|
||||||
|
|
||||||
|
@ -75,10 +71,6 @@ class SharedMainViewModel : ViewModel() {
|
||||||
|
|
||||||
/* Contacts */
|
/* Contacts */
|
||||||
|
|
||||||
val contactFragmentOpenedEvent: MutableLiveData<Event<Boolean>> by lazy {
|
|
||||||
MutableLiveData<Event<Boolean>>()
|
|
||||||
}
|
|
||||||
|
|
||||||
val selectedContact = MutableLiveData<Friend>()
|
val selectedContact = MutableLiveData<Friend>()
|
||||||
|
|
||||||
// For correct animations directions
|
// For correct animations directions
|
||||||
|
|
Loading…
Reference in a new issue