Skip to content

Commit 908e943

Browse files
authoredFeb 16, 2021
Fix SET default fade animation (wix#6964)
Fix shared element transition is broken when `content` property is missing. It should fallback to the default fade animation. Closes wix#6957
1 parent 1f4da12 commit 908e943

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed
 

‎lib/android/app/src/main/java/com/reactnativenavigation/options/FadeInAnimation.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ class FadeInAnimation : StackAnimationOptions() {
1010
alpha.put("from", 0)
1111
alpha.put("to", 1)
1212
alpha.put("duration", 300)
13-
val content = JSONObject()
14-
content.put("alpha", alpha)
13+
val enter = JSONObject()
14+
enter.put("alpha", alpha)
1515
val animation = JSONObject()
16-
animation.put("content", content)
17-
mergeWith(StackAnimationOptions(animation))
16+
animation.put("enter", enter)
17+
val content = JSONObject()
18+
content.put("content", animation)
19+
mergeWith(StackAnimationOptions(content))
1820
} catch (e: JSONException) {
1921
e.printStackTrace()
2022
}

‎lib/android/app/src/main/java/com/reactnativenavigation/options/FadeOutAnimation.kt

+6-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ class FadeOutAnimation : StackAnimationOptions() {
1010
alpha.put("from", 0)
1111
alpha.put("to", 1)
1212
alpha.put("duration", 300)
13-
val content = JSONObject()
14-
content.put("alpha", alpha)
13+
val enter = JSONObject()
14+
enter.put("alpha", alpha)
1515
val animation = JSONObject()
16-
animation.put("content", content)
17-
mergeWith(StackAnimationOptions(animation))
16+
animation.put("enter", enter)
17+
val content = JSONObject()
18+
content.put("content", animation)
19+
mergeWith(StackAnimationOptions(content))
1820
} catch (e: JSONException) {
1921
e.printStackTrace()
2022
}

0 commit comments

Comments
 (0)
Failed to load comments.