-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathFadeAnimation.kt
More file actions
31 lines (25 loc) · 856 Bytes
/
FadeAnimation.kt
File metadata and controls
31 lines (25 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.reactnativenavigation.options
import org.json.JSONObject
const val FADE_DURATION = 300
object FadeAnimation : StackAnimationOptions() {
init {
val enterAlpha = JSONObject()
enterAlpha.put("from", 0)
enterAlpha.put("to", 1)
enterAlpha.put("duration", FADE_DURATION)
val enter = JSONObject()
enter.put("alpha", enterAlpha)
val exitAlpha = JSONObject()
exitAlpha.put("from", 1)
exitAlpha.put("to", 0)
exitAlpha.put("duration", FADE_DURATION)
val exit = JSONObject()
exit.put("alpha", exitAlpha)
val animation = JSONObject()
animation.put("enter", enter)
animation.put("exit", exit)
val content = JSONObject()
content.put("content", animation)
mergeWith(StackAnimationOptions(content))
}
}