androidandroid-fragmentsfragment-transitions

Android - Laggy fragment transition with full hd display


i have a simple animated fragment transition in login section of my app - see anim.xml . Fragments have background set from drawables in xml and everything works just fine unless I test it on my smartphone with full hd display. Transition suddenly becomes laggy. Anyone knows what could be causing this ? Both backgrounds have 1080*1920 resolution.

anim.xml - example of animation (have 4 of them for in and out animation from both sides)

<?xml version="1.0" encoding="utf-8"?>
<set>
  <translate xmlns:android="http://schemas.android.com/apk/res/android"
   android:fromXDelta="-100%"
   android:toXDelta="0"
   android:interpolator="@android:anim/decelerate_interpolator"
   android:duration="250"/>
</set>

Solution

  • Few years of experience later - put your image in drawable-nodpi

    nodpi

    These are density-independent resources. The system does not scale resources tagged with this qualifier, regardless of the current screen's density.

    What Is The Difference Between -anydpi And -nodpi?