2

I want to lock toolbar when activities is changed. Is it possible using fragment? or anything way?

I want this process

enter image description here

Aniruddh Parihar
  • 3,072
  • 3
  • 21
  • 39
Geendy
  • 21
  • 1

1 Answers1

0

You can use shared element transition and add toolbar and statusbar.

Transition fade = new Fade();
fade.excludeTarget(android.R.id.statusBarBackground, true);
fade.excludeTarget(android.R.id.navigationBarBackground, true);
getWindow().setExitTransition(fade);
getWindow().setEnterTransition(fade);

This transition could also be declared in the activity's theme using XML (i.e. in your own res/transition/window_fade.xml file):

<?xml version="1.0" encoding="utf-8"?>
<fade xmlns:android="http://schemas.android.com/apk/res/android">
    <targets>
        <target android:excludeId="@android:id/statusBarBackground"/>
        <target android:excludeId="@android:id/navigationBarBackground"/>
    </targets>
</fade>

There are other good answers, check here How do I prevent the status bar and navigation bar from animating during an activity scene animation transition?

karan
  • 8,637
  • 3
  • 41
  • 78