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

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

111
   },
111
   },
112
   imageContainer: {
112
   imageContainer: {
113
     position: 'absolute',
113
     position: 'absolute',
114
-    top: 0
114
+    top: 0,
115
+    left: 0,
116
+    right: 0,
115
   },
117
   },
116
   image: {
118
   image: {
117
     height: 190
119
     height: 190