mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-04-22 05:48:32 +00:00
Fixed sliding pane opening on resume issue
This commit is contained in:
parent
702504e1d5
commit
48db3d4aa2
2 changed files with 28 additions and 4 deletions
|
|
@ -44,6 +44,10 @@ class CallsFragment : GenericFragment() {
|
||||||
|
|
||||||
private lateinit var binding: CallsFragmentBinding
|
private lateinit var binding: CallsFragmentBinding
|
||||||
|
|
||||||
|
// Otherwise when going into StartCallFragment and going back,
|
||||||
|
// CallFragment will resume and ask to open the pane
|
||||||
|
private var preventSlidingPaneOpening = false
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
|
|
@ -64,6 +68,7 @@ class CallsFragment : GenericFragment() {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
postponeEnterTransition()
|
postponeEnterTransition()
|
||||||
|
preventSlidingPaneOpening = true
|
||||||
|
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
|
||||||
|
|
@ -99,8 +104,14 @@ class CallsFragment : GenericFragment() {
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
it.consume {
|
it.consume {
|
||||||
|
if (!preventSlidingPaneOpening) {
|
||||||
Log.i("$TAG Opening sliding pane")
|
Log.i("$TAG Opening sliding pane")
|
||||||
binding.slidingPaneLayout.openPane()
|
binding.slidingPaneLayout.openPane()
|
||||||
|
} else {
|
||||||
|
Log.i(
|
||||||
|
"$TAG We were asked to open the sliding pane but we aren't resumed yet, so not doing it"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -152,6 +163,7 @@ class CallsFragment : GenericFragment() {
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
preventSlidingPaneOpening = false
|
||||||
sharedViewModel.currentlyDisplayedFragment.value = R.id.callsFragment
|
sharedViewModel.currentlyDisplayedFragment.value = R.id.callsFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ class ContactsFragment : GenericFragment() {
|
||||||
|
|
||||||
private lateinit var binding: ContactsFragmentBinding
|
private lateinit var binding: ContactsFragmentBinding
|
||||||
|
|
||||||
|
// Otherwise when going into NewContactFragment and going back,
|
||||||
|
// ContactFragment will resume and ask to open the pane
|
||||||
|
private var preventSlidingPaneOpening = false
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
|
|
@ -64,6 +68,7 @@ class ContactsFragment : GenericFragment() {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
postponeEnterTransition()
|
postponeEnterTransition()
|
||||||
|
preventSlidingPaneOpening = true
|
||||||
|
|
||||||
binding.lifecycleOwner = viewLifecycleOwner
|
binding.lifecycleOwner = viewLifecycleOwner
|
||||||
|
|
||||||
|
|
@ -106,8 +111,14 @@ class ContactsFragment : GenericFragment() {
|
||||||
viewLifecycleOwner
|
viewLifecycleOwner
|
||||||
) {
|
) {
|
||||||
it.consume {
|
it.consume {
|
||||||
|
if (!preventSlidingPaneOpening) {
|
||||||
Log.i("$TAG Opening sliding pane")
|
Log.i("$TAG Opening sliding pane")
|
||||||
binding.slidingPaneLayout.openPane()
|
binding.slidingPaneLayout.openPane()
|
||||||
|
} else {
|
||||||
|
Log.i(
|
||||||
|
"$TAG We were asked to open the sliding pane but we aren't resumed yet, so not doing it"
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -161,6 +172,7 @@ class ContactsFragment : GenericFragment() {
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
|
preventSlidingPaneOpening = false
|
||||||
sharedViewModel.currentlyDisplayedFragment.value = R.id.contactsFragment
|
sharedViewModel.currentlyDisplayedFragment.value = R.id.contactsFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue