Issue
Transitions not working even after setting the enter, exit, popEnter and popExit transitions.
<fragment
android:id="@+id/introFragment"
android:name="IntroFragment"
android:label="IntroFragment" >
<action
android:id="@+id/action_introFragment_to_signinFragment"
app:destination="@id/signinFragment"
app:enterAnim="@anim/slide_from_right"
app:exitAnim="@anim/slide_to_left"
app:popEnterAnim="@anim/slide_from_left"
app:popExitAnim="@anim/slide_to_right"
app:popUpTo="@+id/nav_graph" />
<action
android:id="@+id/action_introFragment_to_signupFragment"
app:destination="@id/signupFragment"
app:enterAnim="@anim/slide_from_right"
app:exitAnim="@anim/slide_to_left"
app:popEnterAnim="@anim/slide_from_left"
app:popExitAnim="@anim/slide_to_right"
app:popUpTo="@+id/nav_graph" />
</fragment>
I am using
def nav_version = "1.0.0-alpha05"
// Navigation Component - Jetpack
implementation "android.arch.navigation:navigation-fragment-ktx:$nav_version"
implementation "android.arch.navigation:navigation-ui-ktx:$nav_version"
androidTestImplementation "android.arch.navigation:navigation-testing-ktx:$nav_version"
My navigate code is
button.setOnClickListener(
Navigation.createNavigateOnClickListener(R.id.signinFragment))
What am I missing?
Solution
The issue is with my navigation code. I have to change my destination id to action id for my transitions to work!
button.setOnClickListener(Navigation.createNavigateOnClickListener(
R.id.action_introFragment_to_signinFragment))
May be this is due to multiple actions on my destination.
Answered By - Kalyan Dechiraju
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.