From 8e34ba7939ae3a936d89285252a3c12d366450e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 18 Dec 2023 13:12:48 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E3=82=A2=E3=83=8B=E3=83=A1=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92=E5=85=A8=E9=83=A8=E3=81=AB?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B=20WIP"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit c5081f73be11a974d734a834ab11ce6de892eccd. --- app/src/main/java/one/nem/lacerta/MainActivity.java | 12 +++++++++++- app/src/main/res/navigation/main_nav.xml | 3 ++- .../lacerta/feature/debug/DebugMenuTopFragment.java | 2 +- .../nem/lacerta/feature/home/HomeTopFragment.java | 2 +- .../lacerta/feature/library/LibraryTopFragment.java | 2 +- shared/ui/src/main/res/values/themes.xml | 4 ++-- 6 files changed, 18 insertions(+), 7 deletions(-) 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 @@