diff --git a/app/src/main/java/one/nem/lacerta/MainActivity.java b/app/src/main/java/one/nem/lacerta/MainActivity.java index e4aecd88..b89f58d7 100644 --- a/app/src/main/java/one/nem/lacerta/MainActivity.java +++ b/app/src/main/java/one/nem/lacerta/MainActivity.java @@ -31,10 +31,20 @@ public class MainActivity extends AppCompatActivity { NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment); + // Animation + if (navHostFragment != null) { + MaterialSharedAxis exitTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true); + exitTransition.setDuration(500); + navHostFragment.setExitTransition(exitTransition); + + MaterialSharedAxis reenterTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false); + reenterTransition.setDuration(500); + navHostFragment.setReenterTransition(reenterTransition); + } + BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav); NavController navController = navHostFragment.getNavController(); - NavigationUI.setupWithNavController(bottomNavigationView, navController); Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/res/navigation/main_nav.xml b/app/src/main/res/navigation/main_nav.xml index 499af12b..c1e9ce8c 100644 --- a/app/src/main/res/navigation/main_nav.xml +++ b/app/src/main/res/navigation/main_nav.xml @@ -2,7 +2,7 @@ + app:startDestination="@id/feature_debug_navigation"> @@ -10,4 +10,5 @@ + \ No newline at end of file diff --git a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuTopFragment.java b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuTopFragment.java index 47dcee4b..ba2e6386 100644 --- a/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuTopFragment.java +++ b/feature/debug/src/main/java/one/nem/lacerta/feature/debug/DebugMenuTopFragment.java @@ -40,7 +40,7 @@ public class DebugMenuTopFragment extends Fragment { enterTransition.setDuration(500); setEnterTransition(enterTransition); - MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true); + MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false); returnTransition.setDuration(500); setReturnTransition(returnTransition); } diff --git a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java index 9db88557..8dca969c 100644 --- a/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java +++ b/feature/home/src/main/java/one/nem/lacerta/feature/home/HomeTopFragment.java @@ -59,7 +59,7 @@ public class HomeTopFragment extends Fragment { enterTransition.setDuration(500); setEnterTransition(enterTransition); - MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true); + MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false); returnTransition.setDuration(500); setReturnTransition(returnTransition); } diff --git a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java index 9ed56561..d10e5842 100644 --- a/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java +++ b/feature/library/src/main/java/one/nem/lacerta/feature/library/LibraryTopFragment.java @@ -55,7 +55,7 @@ public class LibraryTopFragment extends Fragment { enterTransition.setDuration(500); setEnterTransition(enterTransition); - MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true); + MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false); returnTransition.setDuration(500); setReturnTransition(returnTransition); } diff --git a/shared/ui/src/main/res/values/themes.xml b/shared/ui/src/main/res/values/themes.xml index 93697985..310dfc06 100644 --- a/shared/ui/src/main/res/values/themes.xml +++ b/shared/ui/src/main/res/values/themes.xml @@ -1,8 +1,8 @@