Skip to content

Commit 1c02f79

Browse files
authored
Packing RNTester bundle and images in assets (#34)
1 parent 3815668 commit 1c02f79

29 files changed

+406
-354
lines changed

RNTester/android/app/src/main/assets/RNTesterApp.android.bundle

Lines changed: 353 additions & 354 deletions
Large diffs are not rendered by default.
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Hello Bundled World</title>
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
6+
<meta name="viewport" content="width=320, user-scalable=no">
7+
<style type="text/css">
8+
body {
9+
margin: 0;
10+
padding: 0;
11+
font: 62.5% arial, sans-serif;
12+
background: #ccc;
13+
}
14+
h1 {
15+
padding: 45px;
16+
margin: 0;
17+
text-align: center;
18+
color: #f33;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<h1>Hello Bundled World</h1>
24+
</body>
25+
</html>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Messaging Test</title>
5+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
6+
<meta name="viewport" content="width=320, user-scalable=no">
7+
</head>
8+
<body>
9+
<p>Messages received from React Native: 0</p>
10+
<p>(No messages)</p>
11+
<button type="button">
12+
Send message to React Native
13+
</button>
14+
</body>
15+
<script>
16+
var messagesReceivedFromReactNative = 0;
17+
document.addEventListener('message', function(e) {
18+
messagesReceivedFromReactNative += 1;
19+
document.getElementsByTagName('p')[0].innerHTML =
20+
'Messages received from React Native: ' + messagesReceivedFromReactNative;
21+
document.getElementsByTagName('p')[1].innerHTML = e.data;
22+
});
23+
24+
document.getElementsByTagName('button')[0].addEventListener('click', function() {
25+
window.postMessage('"Hello" from the web view');
26+
});
27+
</script>
28+
</html>

0 commit comments

Comments
 (0)