Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
flutter_boost_1.22.4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢冠章
flutter_boost_1.22.4
Commits
be587178
Commit
be587178
authored
Apr 28, 2019
by
Jidong Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle android page result
parent
e0ce5307
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
34 deletions
+17
-34
android/src/main/java/com/taobao/idlefish/flutterboost/FlutterBoostPlugin.java
.../com/taobao/idlefish/flutterboost/FlutterBoostPlugin.java
+17
-34
No files found.
android/src/main/java/com/taobao/idlefish/flutterboost/FlutterBoostPlugin.java
View file @
be587178
...
...
@@ -54,6 +54,7 @@ import io.flutter.plugin.common.PluginRegistry;
public
class
FlutterBoostPlugin
implements
MethodChannel
.
MethodCallHandler
,
Application
.
ActivityLifecycleCallbacks
{
private
static
FlutterBoostPlugin
sInstance
=
null
;
private
static
int
kRid
=
0
;
public
static
synchronized
void
init
(
IPlatform
platform
)
{
if
(
sInstance
==
null
)
{
...
...
@@ -146,46 +147,28 @@ public class FlutterBoostPlugin implements MethodChannel.MethodCallHandler, Appl
ctx
=
sInstance
.
mPlatform
.
getApplication
();
}
//Handling page result.
if
(
sInstance
.
needResult
(
params
)){
sInstance
.
mMediator
.
setHandler
(
url
,
new
PageResultHandler
()
{
@Override
public
void
onResult
(
String
key
,
Map
resultData
)
{
NavigationService
.
onNativePageResult
(
new
MessageResult
<
Boolean
>()
{
@Override
public
void
success
(
Boolean
var1
)
{
//Doing nothing now.
}
sInstance
.
mPlatform
.
startActivity
(
ctx
,
concatUrl
(
url
,
params
),
requestCode
);
@Override
public
void
error
(
String
var1
,
String
var2
,
Object
var3
)
{
//Doing nothing now.
onPageResult
(
"result_id_100"
,
new
HashMap
(),
new
HashMap
());
}
@Override
public
void
notImplemented
()
{
//Doing nothing now.
}
},
"no use"
,
key
,
resultData
,
params
);
}
});
public
static
void
openPage
(
Context
context
,
String
url
,
final
Map
params
,
int
requestCode
,
PageResultHandler
handler
)
{
if
(
handler
!=
null
){
String
rid
=
createResultId
();
sInstance
.
mMediator
.
setHandler
(
rid
,
handler
);
params
.
put
(
"result_id"
,
rid
);
}
sInstance
.
mPlatform
.
startActivity
(
ctx
,
concatUrl
(
url
,
params
),
requestCode
);
openPage
(
context
,
url
,
params
,
requestCode
);
}
private
Boolean
needResult
(
Map
params
){
private
static
String
createResultId
(){
kRid
+=
2
;
return
"result_id_"
+
kRid
;
}
if
(
params
==
null
)
return
false
;
final
String
key
=
"needResult"
;
if
(
params
.
containsKey
(
key
)){
if
(
params
.
get
(
key
)
instanceof
Boolean
){
return
(
Boolean
)
params
.
get
(
key
);
}
}
return
false
;
}
public
static
void
onPageResult
(
String
key
,
Map
resultData
,
Map
params
){
...
...
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