Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
banma_credit
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hik_rn
project
banma_credit
Commits
142f06bb
Commit
142f06bb
authored
Aug 19, 2020
by
leiyongsheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加native module调试
parent
422c2056
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
2 deletions
+64
-2
App.js
+52
-1
android
+1
-1
ui.js
+11
-0
No files found.
App.js
View file @
142f06bb
...
@@ -8,13 +8,17 @@
...
@@ -8,13 +8,17 @@
import
React
from
'react'
;
import
React
from
'react'
;
import
{
import
{
NativeModules
,
SafeAreaView
,
SafeAreaView
,
StyleSheet
,
StyleSheet
,
ScrollView
,
ScrollView
,
View
,
View
,
Text
,
Text
,
Button
,
StatusBar
,
StatusBar
,
Alert
,
}
from
'react-native'
;
}
from
'react-native'
;
import
BMCUI
from
'./ui.js'
import
{
import
{
Header
,
Header
,
...
@@ -39,6 +43,49 @@ const App: () => React$Node = () => {
...
@@ -39,6 +43,49 @@ const App: () => React$Node = () => {
<
/View
>
<
/View
>
)}
)}
<
View
style
=
{
styles
.
body
}
>
<
View
style
=
{
styles
.
body
}
>
<
View
style
=
{
styles
.
buttonContainer
}
>
<
Button
style
=
{
styles
.
buttonStyle
}
onPress
=
{()
=>
{
// BMCUI.show('"你点击了按钮!");\
console
.
log
(
NativeModules
);
NativeModules
.
BMCUI
.
show
(
"你点击了按钮111!"
);
// NativeModules.BMCUI.showWithDuration("你点击了按钮!", NativeModules.BMCUI.SHORT);
// Alert.alert("你点击了按钮");
}}
title
=
"吐司"
/>
<
/View
>
<
View
style
=
{
styles
.
buttonContainer
}
>
<
Button
style
=
{
styles
.
buttonStyle
}
onPress
=
{()
=>
{
BMCUI
.
showConfirmDialogWithCancelable
(
false
,
"你点击了按钮222!"
,
"确定"
,
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
});
// BMCUI.showConfirmDialog("你点击了按钮222!", "确定", (result) => {
// console.log("你点击了确定,结果为:" + result);
// });
// BMCUI.showConfirmDialogWithCancelableError((result) => {
// console.log("你点击了确定,结果为:" + result);
// }, true, "你点击了按钮222!", "确定");
}}
title
=
"单按钮提示框"
/>
<
/View
>
<
View
style
=
{
styles
.
buttonContainer
}
>
<
Button
style
=
{
styles
.
buttonStyle
}
onPress
=
{()
=>
{
BMCUI
.
showConfirmVsCancelDialog
(
"你点击了按钮333!"
,
"取消"
,
"确定"
,
(
result
)
=>
{
console
.
log
(
"你点击了取消单按钮,结果为:"
+
result
);
},
(
result
)
=>
{
console
.
log
(
"你点击了取确定按钮,结果为:"
+
result
);
});
}}
title
=
"双按钮提示框"
/>
<
/View
>
<
View
style
=
{
styles
.
sectionContainer
}
>
<
View
style
=
{
styles
.
sectionContainer
}
>
<
Text
style
=
{
styles
.
sectionTitle
}
>
Step
One
111
<
/Text
>
<
Text
style
=
{
styles
.
sectionTitle
}
>
Step
One
111
<
/Text
>
<
Text
style
=
{
styles
.
sectionDescription
}
>
<
Text
style
=
{
styles
.
sectionDescription
}
>
...
@@ -85,7 +132,11 @@ const styles = StyleSheet.create({
...
@@ -85,7 +132,11 @@ const styles = StyleSheet.create({
},
},
sectionContainer
:
{
sectionContainer
:
{
marginTop
:
32
,
marginTop
:
32
,
paddingHorizontal
:
24
,
paddingHorizontal
:
24
},
buttonContainer
:
{
marginTop
:
5
,
paddingHorizontal
:
24
},
},
sectionTitle
:
{
sectionTitle
:
{
fontSize
:
24
,
fontSize
:
24
,
...
...
android
@
5308f0b6
Subproject commit
a3c051798cd3891c630fc5271346d67120eeb062
Subproject commit
5308f0b69d84c40a54636b3c97b4fc6c95840eea
ui.js
0 → 100644
View file @
142f06bb
/**
* This exposes the native BMCUI module as a JS module. This has a
* function 'show' which takes the following parameters:
*
* 1. String message: A string with the text to toast
*/
import
{
NativeModules
}
from
'react-native'
;
// 下一句中的BMCUI即对应上文
// public String getName()中返回的字符串
export
default
NativeModules
.
BMCUI
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment