-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJavaExamples.js
More file actions
66 lines (64 loc) · 1.62 KB
/
JavaExamples.js
File metadata and controls
66 lines (64 loc) · 1.62 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import React from 'react';
import {NativeModules} from 'react-native';
import {Title, AppButton} from './components';
const {JavaTestModule} = NativeModules;
export const JavaExamples = () => (
<>
<Title>JAVA</Title>
<AppButton
title="java voidStaticMethod"
onPress={async () => {
console.log(await JavaTestModule.voidStaticMethod());
}}
/>
<AppButton
title="java intStaticMethod"
onPress={async () => {
console.log(await JavaTestModule.intStaticMethod());
}}
/>
<AppButton
title="java doubleStaticMethod"
onPress={async () => {
console.log(await JavaTestModule.doubleStaticMethod());
}}
/>
<AppButton
title="java voidMethod"
onPress={async () => {
console.log(await JavaTestModule.voidMethod());
}}
/>
<AppButton
title="java intMethod"
onPress={async () => {
console.log(await JavaTestModule.intMethod(101));
}}
/>
<AppButton
title="java doubleMethod"
onPress={async () => {
console.log(await JavaTestModule.doubleMethod(20.2));
}}
/>
<AppButton
title="java stringMethod"
onPress={async () => {
console.log(await JavaTestModule.stringMethod('string', 3));
}}
/>
<AppButton
title="java listString"
onPress={async () => {
console.log(await JavaTestModule.listString([3]));
}}
/>
<AppButton
title="java mapString"
onPress={async () => {
console.log(await JavaTestModule.mapString({size: 3}));
}}
/>
</>
);
JavaExamples.KEY = 'JavaExamples';