mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-21 13:48:11 +00:00
Improved switch between contacts & calls lists with postpone at parent level, added animation for account profile fragment
This commit is contained in:
parent
52238e5d27
commit
64c29d495d
8 changed files with 41 additions and 4 deletions
|
|
@ -52,6 +52,14 @@ class CallsFragment : GenericFragment() {
|
|||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
postponeEnterTransition()
|
||||
|
||||
sharedViewModel.callsListReadyToBeDisplayedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
binding.root.doOnPreDraw {
|
||||
val slidingPane = binding.slidingPaneLayout
|
||||
slidingPane.lockMode = SlidingPaneLayout.LOCK_MODE_LOCKED
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ import android.view.animation.Animation
|
|||
import android.view.animation.AnimationUtils
|
||||
import android.widget.PopupWindow
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.navGraphViewModels
|
||||
|
|
@ -122,7 +123,11 @@ class CallsListFragment : GenericFragment() {
|
|||
|
||||
listViewModel.callLogs.observe(viewLifecycleOwner) {
|
||||
adapter.submitList(it)
|
||||
startPostponedEnterTransition()
|
||||
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
sharedViewModel.callsListReadyToBeDisplayedEvent.value = Event(true)
|
||||
}
|
||||
}
|
||||
|
||||
listViewModel.historyDeletedEvent.observe(viewLifecycleOwner) {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,14 @@ class ContactsFragment : GenericFragment() {
|
|||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
|
||||
postponeEnterTransition()
|
||||
|
||||
sharedViewModel.contactsListReadyToBeDisplayedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
}
|
||||
|
||||
binding.root.doOnPreDraw {
|
||||
val slidingPane = binding.slidingPaneLayout
|
||||
slidingPane.lockMode = SlidingPaneLayout.LOCK_MODE_LOCKED
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ class ContactsListFragment : GenericFragment() {
|
|||
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
sharedViewModel.contactsListReadyToBeDisplayedEvent.value = Event(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import android.view.ViewGroup
|
|||
import androidx.activity.result.PickVisualMediaRequest
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.databinding.ViewDataBinding
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
|
@ -153,7 +154,10 @@ class EditContactFragment : GenericFragment() {
|
|||
for (items in viewModel.phoneNumbers) {
|
||||
addCell(items)
|
||||
}
|
||||
startPostponedEnterTransition()
|
||||
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import android.view.ViewGroup
|
|||
import androidx.activity.result.PickVisualMediaRequest
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.core.view.doOnPreDraw
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.navigation.fragment.navArgs
|
||||
|
|
@ -98,7 +99,9 @@ class AccountProfileFragment : GenericFragment() {
|
|||
viewModel.accountFoundEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { found ->
|
||||
if (found) {
|
||||
startPostponedEnterTransition()
|
||||
(view.parent as? ViewGroup)?.doOnPreDraw {
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
} else {
|
||||
Log.e(
|
||||
"$TAG Failed to find an account matching this identity address [$identity]"
|
||||
|
|
|
|||
|
|
@ -59,6 +59,8 @@ class SharedMainViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
/* Contacts related */
|
||||
|
||||
val contactsListReadyToBeDisplayedEvent = MutableLiveData<Event<Boolean>>()
|
||||
|
||||
val showContactEvent: MutableLiveData<Event<String>> by lazy {
|
||||
MutableLiveData<Event<String>>()
|
||||
}
|
||||
|
|
@ -71,6 +73,8 @@ class SharedMainViewModel @UiThread constructor() : ViewModel() {
|
|||
|
||||
/* Call logs related */
|
||||
|
||||
val callsListReadyToBeDisplayedEvent = MutableLiveData<Event<Boolean>>()
|
||||
|
||||
val showCallLogEvent: MutableLiveData<Event<String>> by lazy {
|
||||
MutableLiveData<Event<String>>()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,11 @@
|
|||
|
||||
<action
|
||||
android:id="@+id/action_global_accountProfileFragment"
|
||||
app:destination="@id/accountProfileFragment" />
|
||||
app:destination="@id/accountProfileFragment"
|
||||
app:enterAnim="@anim/slide_in_right"
|
||||
app:exitAnim="@anim/slide_out_left"
|
||||
app:popEnterAnim="@anim/slide_in_left"
|
||||
app:popExitAnim="@anim/slide_out_right" />
|
||||
|
||||
<fragment
|
||||
android:id="@+id/settingsFragment"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue