mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 09:43:15 +00:00
parent
c5081f73be
commit
8e34ba7939
|
@ -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();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<navigation xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/app_main_nav"
|
||||
app:startDestination="@id/feature_home_navigation">
|
||||
app:startDestination="@id/feature_debug_navigation">
|
||||
|
||||
<include app:graph="@navigation/feature_debug_navigation" />
|
||||
|
||||
|
@ -10,4 +10,5 @@
|
|||
|
||||
<include app:graph="@navigation/feature_home_navigation" />
|
||||
|
||||
|
||||
</navigation>
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<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 name="Theme.Lacerta" parent="Base.Theme.Lacerta" >
|
||||
|
|
Loading…
Reference in New Issue
Block a user