mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
parent
4b2de05e5c
commit
a44bdd317d
|
@ -32,15 +32,6 @@ 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
|
// 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);
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,6 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
import com.google.android.material.transition.MaterialSharedAxis;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple {@link Fragment} subclass.
|
* A simple {@link Fragment} subclass.
|
||||||
* Use the {@link HomeTopFragment#newInstance} factory method to
|
* Use the {@link HomeTopFragment#newInstance} factory method to
|
||||||
|
@ -54,14 +52,15 @@ public class HomeTopFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
// Transition
|
||||||
MaterialSharedAxis enterTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, true);
|
TransitionInflater inflater = TransitionInflater.from(requireContext());
|
||||||
enterTransition.setDuration(500);
|
setEnterTransition(inflater.inflateTransition(android.R.transition.slide_top));
|
||||||
setEnterTransition(enterTransition);
|
setExitTransition(inflater.inflateTransition(android.R.transition.slide_bottom));
|
||||||
|
if (getArguments() != null) {
|
||||||
MaterialSharedAxis returnTransition = new MaterialSharedAxis(MaterialSharedAxis.Z, false);
|
mParam1 = getArguments().getString(ARG_PARAM1);
|
||||||
returnTransition.setDuration(500);
|
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||||
setReturnTransition(returnTransition);
|
} else {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user