1

The title might appeal to a general question but my issue is more specific.

As luck would have it, I am working on a project that supports only lollipop and next. There are bunch of API related to Material Design that I never used before and today I am facing one of them: the new transition system with shared elements.

But my problem is way simpler. I need to start an activity that must appear from the bottom, but not completely (50%p) with a fading animation along.

Coming from a pre-Lollipop experience, I intended to use the overridePendingTransition method with the following XML in res/anim :

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true">
    <alpha android:fromAlpha="0" android:toAlpha="1"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:duration="1500"/>
    <translate
        android:duration="1500"
        android:fromYDelta="50%p"
        android:toYDelta="0%p"
        android:interpolator="@android:anim/accelerate_interpolator"/>
</set>

But the problem is that the whole screen is animating, which means the status bar and the navigation bar is also animated and I don't want that at all.

So I started looking for solutions.

Way before KitKat came out with the first Scene and Transition APIs I faced a similar problem and I think I found the solution at the time, however for the life of me I can't today: most findings pointed me to the new transition system.

So now I have the following XML in res/transition :

<?xml version="1.0" encoding="utf-8"?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
    android:transitionOrdering="together"
    android:interpolator="@android:interpolator/accelerate_quad">

    <slide android:slideEdge="bottom" android:duration="1000"/>
    <fade android:fadingMode="fade_in" android:duration="1000"/>

</transitionSet>

Following this solution I managed to prevent the status and navigation bar to animate. However, I can't seem to find a way to tweak the slide transition much like I could with Animations.

So my question (finally) is : Is there a way to exclude the status and navigation bar using overridePendingTransition ? If yes, how ?? If no ... how can I tweak the slide animation ?

Thanks !

Community
  • 1
  • 1
Mackovich
  • 3,319
  • 6
  • 35
  • 73

0 Answers0