Skip to content

Commit

Permalink
Animations on App launch & resume (#606)
Browse files Browse the repository at this point in the history
* lottie working

* added fadeIn / out effect

* finally fix crash in debug mode

* added fadeIn to other views

* update unit tests

* fix lock screen

* adjust timing

* more timing stuff

* fix timing stuff

* use optimized bounce animation

* fix for android

* update snapshots

* use exact versions
  • Loading branch information
Bruno Barbieri authored Apr 16, 2019
1 parent a6cd49b commit 5e98fdc
Show file tree
Hide file tree
Showing 27 changed files with 16,873 additions and 116 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ android {
}

dependencies {
implementation project(':lottie-react-native')
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-push-notification')
implementation project(':react-native-background-timer')
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/io/metamask/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import com.crashlytics.android.Crashlytics;
import com.facebook.react.ReactApplication;
import com.airbnb.android.react.lottie.LottiePackage;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
import com.ocetnik.timer.BackgroundTimerPackage;
Expand Down Expand Up @@ -48,6 +49,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new LottiePackage(),
new AsyncStoragePackage(),
new ReactNativePushNotificationPackage(),
new BackgroundTimerPackage(),
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'MetaMask'
include ':lottie-react-native'
project(':lottie-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/lottie-react-native/src/android')
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
include ':react-native-push-notification'
Expand Down
367 changes: 367 additions & 0 deletions app/animations/bounce.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
{
"v": "5.1.13",
"fr": 30,
"ip": 0,
"op": 20,
"w": 1125,
"h": 2436,
"nm": "Bounce",
"ddd": 0,
"assets": [
{
"id": "comp_0",
"layers": [
{
"ddd": 0,
"ind": 1,
"ty": 4,
"nm": "Romb_shadow",
"sr": 1,
"ks": {
"o": { "a": 0, "k": 100, "ix": 11 },
"r": { "a": 0, "k": 0, "ix": 10 },
"p": {
"a": 1,
"k": [
{
"i": { "x": 0.833, "y": 0.833 },
"o": { "x": 0.167, "y": 0.167 },
"n": "0p833_0p833_0p167_0p167",
"t": 0,
"s": [562.688, 850.992, 0],
"e": [562.688, 730.992, 0],
"to": [0, -20, 0],
"ti": [0, 0, 0]
},
{
"i": { "x": 0.833, "y": 0.833 },
"o": { "x": 0.167, "y": 0.167 },
"n": "0p833_0p833_0p167_0p167",
"t": 12,
"s": [562.688, 730.992, 0],
"e": [562.688, 850.992, 0],
"to": [0, 0, 0],
"ti": [0, -20, 0]
},
{ "t": 22 }
],
"ix": 2
},
"a": { "a": 0, "k": [0.188, -367.008, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100, 100], "ix": 6 }
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"ind": 0,
"ty": "sh",
"ix": 1,
"ks": {
"a": 1,
"k": [
{
"i": { "x": 0.667, "y": 1 },
"o": { "x": 0.333, "y": 0 },
"n": "0p667_1_0p333_0",
"t": 0,
"s": [
{
"i": [[0, 0], [0, 0], [0, 0], [0, 0]],
"o": [[0, 0], [0, 0], [0, 0], [0, 0]],
"v": [
[-52.392, -367.008],
[0.188, -271.228],
[-52.232, -367.008],
[0.188, -462.788]
],
"c": true
}
],
"e": [
{
"i": [[0, 0], [0, 0], [0, 0], [0, 0]],
"o": [[0, 0], [0, 0], [0, 0], [0, 0]],
"v": [
[52.608, -367.008],
[0.188, -271.228],
[-52.232, -367.008],
[0.188, -462.788]
],
"c": true
}
]
},
{
"i": { "x": 0.833, "y": 1 },
"o": { "x": 0.167, "y": 0 },
"n": "0p833_1_0p167_0",
"t": 10,
"s": [
{
"i": [[0, 0], [0, 0], [0, 0], [0, 0]],
"o": [[0, 0], [0, 0], [0, 0], [0, 0]],
"v": [
[52.608, -367.008],
[0.188, -271.228],
[-52.232, -367.008],
[0.188, -462.788]
],
"c": true
}
],
"e": [
{
"i": [[0, 0], [0, 0], [0, 0], [0, 0]],
"o": [[0, 0], [0, 0], [0, 0], [0, 0]],
"v": [
[52.608, -367.008],
[0.188, -271.228],
[51.768, -367.008],
[0.188, -462.788]
],
"c": true
}
]
},
{ "t": 12 }
],
"ix": 2
},
"nm": "Path 1",
"mn": "ADBE Vector Shape - Group",
"hd": false
},
{
"ty": "fl",
"c": { "a": 0, "k": [0.745802696078, 0.358373754165, 0.146384325214, 1], "ix": 4 },
"o": { "a": 0, "k": 100, "ix": 5 },
"r": 1,
"nm": "Fill 1",
"mn": "ADBE Vector Graphic - Fill",
"hd": false
},
{
"ty": "tr",
"p": { "a": 0, "k": [0, 0], "ix": 2 },
"a": { "a": 0, "k": [0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100], "ix": 3 },
"r": { "a": 0, "k": 0, "ix": 6 },
"o": { "a": 0, "k": 100, "ix": 7 },
"sk": { "a": 0, "k": 0, "ix": 4 },
"sa": { "a": 0, "k": 0, "ix": 5 },
"nm": "Transform"
}
],
"nm": "Group 1",
"np": 2,
"cix": 2,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false
}
],
"ip": 0,
"op": 23,
"st": 0,
"bm": 0
},
{
"ddd": 0,
"ind": 2,
"ty": 4,
"nm": "Romb",
"sr": 1,
"ks": {
"o": { "a": 0, "k": 100, "ix": 11 },
"r": { "a": 0, "k": 0, "ix": 10 },
"p": {
"a": 1,
"k": [
{
"i": { "x": 0.833, "y": 0.833 },
"o": { "x": 0.167, "y": 0.167 },
"n": "0p833_0p833_0p167_0p167",
"t": 0,
"s": [562.688, 850.992, 0],
"e": [562.688, 730.992, 0],
"to": [0, -20, 0],
"ti": [0, 0, 0]
},
{
"i": { "x": 0.833, "y": 0.833 },
"o": { "x": 0.167, "y": 0.167 },
"n": "0p833_0p833_0p167_0p167",
"t": 12,
"s": [562.688, 730.992, 0],
"e": [562.688, 850.992, 0],
"to": [0, 0, 0],
"ti": [0, -20, 0]
},
{ "t": 22 }
],
"ix": 2
},
"a": { "a": 0, "k": [0.188, -367.008, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100, 100], "ix": 6 }
},
"ao": 0,
"shapes": [
{
"ty": "gr",
"it": [
{
"ind": 0,
"ty": "sh",
"ix": 1,
"ks": {
"a": 0,
"k": {
"i": [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]],
"o": [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]],
"v": [
[52.608, -367.018],
[52.608, -367.008],
[52.598, -366.998],
[0.188, -271.228],
[-52.232, -367.008],
[0.188, -462.788]
],
"c": true
},
"ix": 2
},
"nm": "Path 1",
"mn": "ADBE Vector Shape - Group",
"hd": false
},
{
"ty": "st",
"c": { "a": 0, "k": [0.960784375668, 0.517647087574, 0.121568635106, 1], "ix": 3 },
"o": { "a": 0, "k": 100, "ix": 4 },
"w": {
"a": 1,
"k": [
{
"i": { "x": [0.833], "y": [0.833] },
"o": { "x": [0.167], "y": [0.167] },
"n": ["0p833_0p833_0p167_0p167"],
"t": 27,
"s": [0],
"e": [2]
},
{ "t": 30 }
],
"ix": 5
},
"lc": 1,
"lj": 1,
"ml": 4,
"nm": "Stroke 1",
"mn": "ADBE Vector Graphic - Stroke",
"hd": false
},
{
"ty": "fl",
"c": { "a": 0, "k": [0.960784316063, 0.517647087574, 0.121568627656, 1], "ix": 4 },
"o": { "a": 0, "k": 100, "ix": 5 },
"r": 1,
"nm": "Fill 1",
"mn": "ADBE Vector Graphic - Fill",
"hd": false
},
{
"ty": "tr",
"p": { "a": 0, "k": [0, 0], "ix": 2 },
"a": { "a": 0, "k": [0, 0], "ix": 1 },
"s": { "a": 0, "k": [100, 100], "ix": 3 },
"r": { "a": 0, "k": 0, "ix": 6 },
"o": { "a": 0, "k": 100, "ix": 7 },
"sk": { "a": 0, "k": 0, "ix": 4 },
"sa": { "a": 0, "k": 0, "ix": 5 },
"nm": "Transform"
}
],
"nm": "Group 1",
"np": 3,
"cix": 2,
"ix": 1,
"mn": "ADBE Vector Group",
"hd": false
}
],
"ip": 0,
"op": 23,
"st": 0,
"bm": 0
}
]
}
],
"layers": [
{
"ddd": 0,
"ind": 1,
"ty": 0,
"nm": "Bounce_no_easing",
"refId": "comp_0",
"sr": 1,
"ks": {
"o": { "a": 0, "k": 100, "ix": 11 },
"r": { "a": 0, "k": 0, "ix": 10 },
"p": { "a": 0, "k": [562.5, 1218, 0], "ix": 2 },
"a": { "a": 0, "k": [562.5, 1218, 0], "ix": 1 },
"s": { "a": 0, "k": [65, 65, 100], "ix": 6 }
},
"ao": 0,
"tm": {
"a": 1,
"k": [
{
"i": { "x": [0], "y": [1] },
"o": { "x": [0.064], "y": [0] },
"n": ["0_1_0p064_0"],
"t": 0,
"s": [0],
"e": [0.4]
},
{
"i": { "x": [1], "y": [1] },
"o": { "x": [1], "y": [0] },
"n": ["1_1_1_0"],
"t": 10,
"s": [0.4],
"e": [0.733]
},
{
"i": { "x": [0.858], "y": [1] },
"o": { "x": [0.158], "y": [0] },
"n": ["0p858_1_0p158_0"],
"t": 20,
"s": [0.733],
"e": [0.733]
},
{
"i": { "x": [0.833], "y": [0.833] },
"o": { "x": [0.037], "y": [0] },
"n": ["0p833_0p833_0p037_0"],
"t": 102,
"s": [0.733],
"e": [10]
},
{ "t": 300 }
],
"ix": 2
},
"w": 1125,
"h": 2436,
"ip": 0,
"op": 21,
"st": 0,
"bm": 0
}
],
"markers": [{ "tm": 95, "cm": "1", "dr": 0 }]
}
Loading

0 comments on commit 5e98fdc

Please sign in to comment.