Browse Source

Update example app (#996)

* Temporarily disable shared element screens in example app

* Fix card positioning when transitioning
Guy Carmeli 7 years ago
parent
commit
c19d4d1c0a
2 changed files with 13 additions and 3 deletions
  1. 10
    2
      example/src/app.js
  2. 3
    1
      example/src/screens/set/InformationScreen.js

+ 10
- 2
example/src/app.js View File

@@ -7,8 +7,10 @@ import {Navigation} from 'react-native-navigation';
7 7
 import {registerScreens} from './screens';
8 8
 registerScreens();
9 9
 
10
+const SHOW_SHARED_ELEMENT_SCREENS = false;
11
+
10 12
 const createTabs = () => {
11
-  let tabs = [
13
+  const sharedElementScreens = [
12 14
     {
13 15
       label: 'Card',
14 16
       screen: 'example.CardScreen',
@@ -20,7 +22,10 @@ const createTabs = () => {
20 22
       screen: 'example.ListScreen',
21 23
       icon: require('../img/list.png'),
22 24
       title: 'Shared Element Transition'
23
-    },
25
+    }
26
+  ];
27
+
28
+  let tabs = [
24 29
     {
25 30
       label: 'One',
26 31
       screen: 'example.FirstTabScreen',
@@ -46,6 +51,9 @@ const createTabs = () => {
46 51
       icon: require('../img/one.png'),
47 52
       title: 'Collapsing',
48 53
     });
54
+    if (SHOW_SHARED_ELEMENT_SCREENS) {
55
+      tabs = [...sharedElementScreens, ...tabs];
56
+    }
49 57
   }
50 58
   return tabs;
51 59
 };

+ 3
- 1
example/src/screens/set/InformationScreen.js View File

@@ -111,7 +111,9 @@ const styles = StyleSheet.create({
111 111
   },
112 112
   imageContainer: {
113 113
     position: 'absolute',
114
-    top: 0
114
+    top: 0,
115
+    left: 0,
116
+    right: 0,
115 117
   },
116 118
   image: {
117 119
     height: 190