Skip to content

Commit

Permalink
Merge pull request #44 from shubham423/fragment_transition_animations
Browse files Browse the repository at this point in the history
added fragment transition animations
  • Loading branch information
justdvnsh authored Oct 5, 2021
2 parents af7315f + cd97406 commit cf8b0a3
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 4 deletions.
6 changes: 6 additions & 0 deletions app/src/main/res/anim/from_left.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

<translate android:fromXDelta="-100%" android:toXDelta="0%" android:duration="300"/>

</set>
6 changes: 6 additions & 0 deletions app/src/main/res/anim/from_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

<translate android:fromXDelta="100%" android:toXDelta="0%" android:duration="400"/>

</set>
6 changes: 6 additions & 0 deletions app/src/main/res/anim/to_left.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

<translate android:fromXDelta="0%" android:toXDelta="-100%" android:duration="300"/>

</set>
6 changes: 6 additions & 0 deletions app/src/main/res/anim/to_right.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">

<translate android:fromXDelta="0%" android:toXDelta="100%" android:duration="300"/>

</set>
25 changes: 21 additions & 4 deletions app/src/main/res/navigation/home_navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,19 @@
android:label="HomeFragment" >
<action
android:id="@+id/action_homeFragment_to_searchFragment"
app:destination="@id/searchFragment" />
app:destination="@id/searchFragment"
app:enterAnim="@anim/from_left"
app:exitAnim="@anim/to_right"
app:popEnterAnim="@anim/from_right"
app:popExitAnim="@anim/to_left"
/>
<action
android:id="@+id/action_homeFragment_to_animeDetailFragment"
app:destination="@id/animeDetailFragment" />
app:destination="@id/animeDetailFragment"
app:enterAnim="@anim/from_left"
app:exitAnim="@anim/to_right"
app:popEnterAnim="@anim/from_right"
app:popExitAnim="@anim/to_left"/>
</fragment>
<activity
android:id="@+id/playerActivity"
Expand All @@ -32,7 +41,11 @@
android:label="SearchFragment" >
<action
android:id="@+id/action_searchFragment_to_animeDetailFragment"
app:destination="@id/animeDetailFragment" />
app:destination="@id/animeDetailFragment"
app:enterAnim="@anim/from_left"
app:exitAnim="@anim/to_right"
app:popEnterAnim="@anim/from_right"
app:popExitAnim="@anim/to_left"/>
</fragment>
<fragment
android:id="@+id/shopFragment"
Expand All @@ -49,7 +62,11 @@

<action
android:id="@+id/action_global_playerActivity"
app:destination="@id/playerActivity" />
app:destination="@id/playerActivity"
app:enterAnim="@anim/from_left"
app:exitAnim="@anim/to_right"
app:popEnterAnim="@anim/from_right"
app:popExitAnim="@anim/to_left" />
<fragment
android:id="@+id/animeDetailFragment"
android:name="divyansh.tech.animeclassroom.animeDetail.AnimeDetailFragment"
Expand Down

0 comments on commit cf8b0a3

Please sign in to comment.