Skip to content Skip to sidebar Skip to footer

Activity Transition Ignoring Toolbar

let's see if someone can help me with this. In my app I have successfully implemented slide transitions between most of my activities. All my activities layouts consist in a regula

Solution 1:

Alright, so I found the answer after some hours working on it. I'm having some issues in android 7.1. Other than that, it works in 5.x and 6.x

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

As you can see, you can add views to be ignored by the animation. In my case, the toolbar, status and navigation bar.

Then you can apply the animation the way you prefer, it will affect everything but the elements specified to be ignored.


Solution 2:

My suggestion is to make a single activity containg toolbar and a container layout, and place fragments inside container and do transition for fragments. It may solve your problem.


Solution 3:

try adding below code in your style. See if it works

<style name="your_theme_name" parent="your_theme">
<item name="android:windowActionBarOverlay">true</item>
</style>

Post a Comment for "Activity Transition Ignoring Toolbar"