Управление навигацией с анимацией показывает быстрый экран при быстром нажатии кнопки назад - PullRequest
0 голосов
/ 23 сентября 2019
I am facing an issue in Android Navigation Component when user press back button before slide animation finish.

<?xml version="1.0" encoding="utf-8"?>
<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/invitation_nav_graph"
    app:startDestination="@id/invitationBacklogFragment">

    <fragment
        android:id="@+id/invitationBacklogFragment"
        android:name="com.InvitationBacklogFragment"
        android:label="@string/inviteByPhysicalMail"
        tools:layout="@layout/fragment_invitation_backlog">

        <action
            android:id="@+id/actionGoToSendInvitation"
            app:destination="@+id/sendInvitationFragment"
            app:enterAnim="@anim/slide_in"
            app:exitAnim="@anim/slide_out"
            app:popEnterAnim="@anim/slide_in"
            app:popExitAnim="@anim/slide_out" />
    </fragment>

    <fragment
        android:id="@+id/sendInvitationFragment"
        android:name="com.SendInvitationFragment"
        android:label="@string/createInvitation"
        tools:layout="@layout/fragment_send_invitation" />
</navigation>

and my main nav fragment is
 <fragment
        android:id="@+id/invitation_nav_host_fragment"
        android:name="androidx.navigation.fragment.NavHostFragment"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:defaultNavHost="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navGraph="@navigation/invitation_nav_graph" />


It use to load content properly in normal circumstances,but if you press back button quick(i.e before finish animation) it shows blank white screen. 
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...