overridePendingTransition shows second activity too quickly

前端 未结 2 1577
名媛妹妹
名媛妹妹 2021-02-19 22:12

i have 2 activities, and i want to create an animated transition between the two activities such that both activities\'s views slides up as if the second activity is pushing the

相关标签:
2条回答
  • 2021-02-19 22:34

    Nevermind, that was a dumb error - i didn't understand what the documentation meant by "entering animation" vs "exiting animation". i need to swap the xmls by changing:

    FirstActivity.this.overridePendingTransition(R.anim.slide, R.anim.slide2);
    

    into

    FirstActivity.this.overridePendingTransition(R.anim.slide2, R.anim.slide);
    
    0 讨论(0)
  • 2021-02-19 22:40

    just add these to your slide2.xml:

    android:startOffset="2000"
    

    this way the animation for the 2nd activity will only start right after your 1st activity's animation is complete.

    0 讨论(0)
提交回复
热议问题