mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
This should prevent empty fragment visible sometimes
This commit is contained in:
parent
fd088fdbc8
commit
006fa3fa4a
2 changed files with 7 additions and 14 deletions
|
|
@ -68,7 +68,7 @@ abstract class AbstractTopBarFragment : GenericFragment() {
|
|||
viewLifecycleOwner
|
||||
) {
|
||||
it.consume {
|
||||
if (slidingPane.isOpen) {
|
||||
if (slidingPane.isOpen && slidingPane.isSlideable) {
|
||||
Log.i("$TAG Closing sliding pane")
|
||||
slidingPane.closePane()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,34 +23,21 @@ import android.os.Bundle
|
|||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import androidx.annotation.UiThread
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.transition.AutoTransition
|
||||
import org.linphone.R
|
||||
import org.linphone.databinding.EmptyFragmentBinding
|
||||
|
||||
@UiThread
|
||||
class EmptyFragment : Fragment() {
|
||||
private lateinit var binding: EmptyFragmentBinding
|
||||
|
||||
override fun onCreateAnimation(transit: Int, enter: Boolean, nextAnim: Int): Animation? {
|
||||
if (findNavController().currentDestination?.id == R.id.newContactFragment) {
|
||||
// Holds fragment in place while new fragment slides over it
|
||||
return AnimationUtils.loadAnimation(activity, R.anim.hold)
|
||||
}
|
||||
return super.onCreateAnimation(transit, enter, nextAnim)
|
||||
}
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
binding = EmptyFragmentBinding.inflate(layoutInflater)
|
||||
sharedElementEnterTransition = AutoTransition()
|
||||
return binding.root
|
||||
}
|
||||
|
||||
|
|
@ -59,4 +46,10 @@ class EmptyFragment : Fragment() {
|
|||
|
||||
binding.lifecycleOwner = viewLifecycleOwner
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue