OverridePendingTransition other than intent flags

I use a slide in animation to open actions in my application using overridePendingTransition. Previously, when I used it after startActivity (intention) with flags without intentions, it worked fine. It didn’t work with intent flags, so I used overridePendingTransition in the onResume () method now that the action is triggered for the first time, when the animation is beautiful, but when the same instance is highlighted due to the destination flag, the animation works, but not smooth; smooth. The second time, the action begins with the right slide (which is correct), but appears with a jerk.

These are the flags of intent that I use

intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); 

What needs to be done to solve this problem. Help Plz

This is the code that I use for slides in the animation ie enter_anim

 <translate android:duration="200" android:fromXDelta="100%" android:fromYDelta="0%" android:toXDelta="0%" android:toYDelta="0%" /> 

since I do not want to give exit_anim

 <translate android:duration="200" android:fromXDelta="0%" android:fromYDelta="0%" android:toXDelta="0%" android:toYDelta="0%" /> 

+3
source share
2 answers

try the following code

 overridePendingTransition(R.anim.slide_in_left_first, R.anim.slide_out_left_first); slide_in_left_first:- <?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200" android:fromXDelta="100%p" android:toXDelta="0%p" /> slide_out_left_first:- <?xml version="1.0" encoding="utf-8"?> <translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="200" android:fromXDelta="0%" android:toXDelta="0%" /> 
+2
source

So try the code below in your manifest: - in the application add this

  android:hardwareAccelerated="true" 
+1
source

Source: https://habr.com/ru/post/981618/


All Articles