mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
アニメーションを全部に追加する WIP
This commit is contained in:
parent
470d3cca27
commit
c5081f73be
|
@ -31,20 +31,10 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
NavHostFragment navHostFragment = (NavHostFragment) supportFragmentManager.findFragmentById(R.id.nav_host_fragment);
|
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);
|
BottomNavigationView bottomNavigationView = findViewById(R.id.bottom_nav);
|
||||||
|
|
||||||
NavController navController = navHostFragment.getNavController();
|
NavController navController = navHostFragment.getNavController();
|
||||||
|
|
||||||
NavigationUI.setupWithNavController(bottomNavigationView, navController);
|
NavigationUI.setupWithNavController(bottomNavigationView, navController);
|
||||||
|
|
||||||
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/app_main_nav"
|
android:id="@+id/app_main_nav"
|
||||||
app:startDestination="@id/feature_debug_navigation">
|
app:startDestination="@id/feature_home_navigation">
|
||||||
|
|
||||||
<include app:graph="@navigation/feature_debug_navigation" />
|
<include app:graph="@navigation/feature_debug_navigation" />
|
||||||
|
|
||||||
|
@ -10,5 +10,4 @@
|
||||||
|
|
||||||
<include app:graph="@navigation/feature_home_navigation" />
|
<include app:graph="@navigation/feature_home_navigation" />
|
||||||
|
|
||||||
|
|
||||||
</navigation>
|
</navigation>
|
|
@ -40,7 +40,7 @@ public class DebugMenuTopFragment extends Fragment {
|
||||||
enterTransition.setDuration(500);
|
enterTransition.setDuration(500);
|
||||||
setEnterTransition(enterTransition);
|
setEnterTransition(enterTransition);
|
||||||
|
|
||||||
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false);
|
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true);
|
||||||
returnTransition.setDuration(500);
|
returnTransition.setDuration(500);
|
||||||
setReturnTransition(returnTransition);
|
setReturnTransition(returnTransition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class HomeTopFragment extends Fragment {
|
||||||
enterTransition.setDuration(500);
|
enterTransition.setDuration(500);
|
||||||
setEnterTransition(enterTransition);
|
setEnterTransition(enterTransition);
|
||||||
|
|
||||||
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false);
|
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true);
|
||||||
returnTransition.setDuration(500);
|
returnTransition.setDuration(500);
|
||||||
setReturnTransition(returnTransition);
|
setReturnTransition(returnTransition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class LibraryTopFragment extends Fragment {
|
||||||
enterTransition.setDuration(500);
|
enterTransition.setDuration(500);
|
||||||
setEnterTransition(enterTransition);
|
setEnterTransition(enterTransition);
|
||||||
|
|
||||||
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false);
|
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true);
|
||||||
returnTransition.setDuration(500);
|
returnTransition.setDuration(500);
|
||||||
setReturnTransition(returnTransition);
|
setReturnTransition(returnTransition);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Base.Theme.Lacerta" parent="Theme.Material3.DayNight.NoActionBar">
|
<style name="Base.Theme.Lacerta" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
<!-- Customize your light theme here. -->
|
|
||||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.Lacerta" parent="Base.Theme.Lacerta" >
|
<style name="Theme.Lacerta" parent="Base.Theme.Lacerta" >
|
||||||
|
|
Loading…
Reference in New Issue
Block a user