mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 11:28:06 +00:00
Added logs & fixed nav graph id
This commit is contained in:
parent
619ab8a6ed
commit
702504e1d5
5 changed files with 16 additions and 5 deletions
|
|
@ -38,6 +38,10 @@ import org.linphone.utils.SlidingPaneBackPressedCallback
|
|||
|
||||
@UiThread
|
||||
class CallsFragment : GenericFragment() {
|
||||
companion object {
|
||||
private const val TAG = "[Calls Fragment]"
|
||||
}
|
||||
|
||||
private lateinit var binding: CallsFragmentBinding
|
||||
|
||||
override fun onCreateView(
|
||||
|
|
@ -65,6 +69,7 @@ class CallsFragment : GenericFragment() {
|
|||
|
||||
sharedViewModel.callsListReadyToBeDisplayedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.i("$TAG Calls list is ready, starting postponed enter transition")
|
||||
startPostponedEnterTransition()
|
||||
}
|
||||
}
|
||||
|
|
@ -85,6 +90,7 @@ class CallsFragment : GenericFragment() {
|
|||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume {
|
||||
Log.i("$TAG Closing sliding pane")
|
||||
binding.slidingPaneLayout.closePane()
|
||||
}
|
||||
}
|
||||
|
|
@ -93,12 +99,14 @@ class CallsFragment : GenericFragment() {
|
|||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume {
|
||||
Log.i("$TAG Opening sliding pane")
|
||||
binding.slidingPaneLayout.openPane()
|
||||
}
|
||||
}
|
||||
|
||||
sharedViewModel.showStartCallEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.i("$TAG Navigating to start call fragment")
|
||||
findNavController().navigate(R.id.action_global_startCallFragment)
|
||||
}
|
||||
}
|
||||
|
|
@ -107,7 +115,7 @@ class CallsFragment : GenericFragment() {
|
|||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume { callId ->
|
||||
Log.i("[Calls Fragment] Displaying call log with call ID [$callId]")
|
||||
Log.i("$TAG Displaying call log with call ID [$callId]")
|
||||
val navController = binding.callsNavContainer.findNavController()
|
||||
val action = CallFragmentDirections.actionGlobalCallFragment(
|
||||
callId
|
||||
|
|
|
|||
|
|
@ -130,6 +130,7 @@ class CallsListFragment : GenericFragment() {
|
|||
|
||||
adapter.callLogClickedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume { model ->
|
||||
Log.i("$TAG Show details for call log with ID [${model.id}]")
|
||||
sharedViewModel.showCallLogEvent.value = Event(model.id ?: "")
|
||||
}
|
||||
}
|
||||
|
|
@ -147,6 +148,7 @@ class CallsListFragment : GenericFragment() {
|
|||
binding.callsList.layoutManager = layoutManager
|
||||
|
||||
listViewModel.callLogs.observe(viewLifecycleOwner) {
|
||||
Log.i("$TAG Call logs ready with [${it.size}] items")
|
||||
adapter.submitList(it)
|
||||
binding.callsList.scrollToPosition(0)
|
||||
|
||||
|
|
@ -158,6 +160,7 @@ class CallsListFragment : GenericFragment() {
|
|||
|
||||
listViewModel.historyDeletedEvent.observe(viewLifecycleOwner) {
|
||||
it.consume {
|
||||
Log.w("$TAG Deleting all call history")
|
||||
// TODO FIXME: show translated string
|
||||
(requireActivity() as MainActivity).showGreenToast(
|
||||
"Historique supprimé",
|
||||
|
|
|
|||
|
|
@ -58,11 +58,11 @@ class StartCallFragment : GenericFragment() {
|
|||
private lateinit var binding: CallStartFragmentBinding
|
||||
|
||||
private val viewModel: StartCallViewModel by navGraphViewModels(
|
||||
R.id.voip_nav_graph
|
||||
R.id.main_nav_graph
|
||||
)
|
||||
|
||||
private val contactsListViewModel: ContactsListViewModel by navGraphViewModels(
|
||||
R.id.voip_nav_graph
|
||||
R.id.main_nav_graph
|
||||
)
|
||||
|
||||
private lateinit var contactsAdapter: ContactsListAdapter
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/calls_right_nav_graph"
|
||||
android:id="@+id/calls_nav_graph"
|
||||
app:startDestination="@id/emptyFragment">
|
||||
|
||||
<fragment
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/contact_right_nav_graph"
|
||||
android:id="@+id/contact_nav_graph"
|
||||
app:startDestination="@id/emptyFragment">
|
||||
|
||||
<fragment
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue