Hello I'm adding animation left to right and right to left when opening and finishing activities but when I put the overridePendingIntent
it shows a black screen...
This is my left_to_right.xml animation
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="500"
android:fromXDelta="-100%"
android:fromYDelta="0%"
android:toXDelta="0%"
android:toYDelta="0%" />
</set>
This is the right_to_left.xml animation
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="500"
android:fromXDelta="0%"
android:fromYDelta="0%"
android:toXDelta="100%"
android:toYDelta="0%" />
</set>
I'm starting the Activity like this :
startActivity(Intent(this, SignInActivity::class.java))
overridePendingTransition(R.anim.left_to_right, R.anim.right_to_left)
and finishing it like this :
finish()
overridePendingTransition(R.anim.right_to_left, R.anim.left_to_right)
But when doing it is showing black screen...
This is my theme
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.MyTheme" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
<item name="android:windowDisablePreview">true</item>
</style>
</resources>
And on my Activities I'm using
android:theme="@style/Theme.MaterialComponents.Light.NoActionBar"
What I'm missing?