-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKotlinExamples.js
More file actions
66 lines (64 loc) · 1.66 KB
/
KotlinExamples.js
File metadata and controls
66 lines (64 loc) · 1.66 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 {KotlinTestModule} = NativeModules;
export const KotlinExamples = () => (
<>
<Title>Kotlin</Title>
<AppButton
title="kotlin voidStaticMethod"
onPress={async () => {
console.log(await KotlinTestModule.voidStaticMethod());
}}
/>
<AppButton
title="kotlin intStaticMethod"
onPress={async () => {
console.log(await KotlinTestModule.intStaticMethod());
}}
/>
<AppButton
title="kotlin doubleStaticMethod"
onPress={async () => {
console.log(await KotlinTestModule.doubleStaticMethod());
}}
/>
<AppButton
title="kotlin voidMethod"
onPress={async () => {
console.log(await KotlinTestModule.voidMethod());
}}
/>
<AppButton
title="kotlin intMethod"
onPress={async () => {
console.log(await KotlinTestModule.intMethod(101));
}}
/>
<AppButton
title="kotlin doubleMethod"
onPress={async () => {
console.log(await KotlinTestModule.doubleMethod(20.2));
}}
/>
<AppButton
title="kotlin stringMethod"
onPress={async () => {
console.log(await KotlinTestModule.stringMethod('string', 3));
}}
/>
<AppButton
title="kotlin listString"
onPress={async () => {
console.log(await KotlinTestModule.listString([3]));
}}
/>
<AppButton
title="kotlin mapString"
onPress={async () => {
console.log(await KotlinTestModule.mapString({size: 3}));
}}
/>
</>
);
KotlinExamples.KEY = 'KotlinExamples';