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
1
Merge Requests
1
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
f6567808
Commit
f6567808
authored
Jun 04, 2019
by
Jidong Chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1,delete unnecessary ”query“.
2,Add map params.
parent
cd39f6ab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
25 deletions
+11
-25
android/src/main/java/com/taobao/idlefish/flutterboost/FlutterBoostPlugin.java
.../com/taobao/idlefish/flutterboost/FlutterBoostPlugin.java
+2
-24
android/src/main/java/com/taobao/idlefish/flutterboost/NavigationService/NavigationService_openPage.java
...erboost/NavigationService/NavigationService_openPage.java
+8
-0
android/src/main/java/com/taobao/idlefish/flutterboost/interfaces/IPlatform.java
...om/taobao/idlefish/flutterboost/interfaces/IPlatform.java
+1
-1
No files found.
android/src/main/java/com/taobao/idlefish/flutterboost/FlutterBoostPlugin.java
View file @
f6567808
...
...
@@ -149,7 +149,7 @@ public class FlutterBoostPlugin implements MethodChannel.MethodCallHandler, Appl
ctx
=
sInstance
.
mPlatform
.
getApplication
();
}
sInstance
.
mPlatform
.
startActivity
(
ctx
,
concatUrl
(
url
,
params
)
,
requestCode
);
sInstance
.
mPlatform
.
startActivity
(
ctx
,
url
,
params
,
requestCode
);
}
public
static
void
openPage
(
Context
context
,
String
url
,
final
Map
params
,
int
requestCode
,
PageResultHandler
handler
)
{
...
...
@@ -193,29 +193,7 @@ public class FlutterBoostPlugin implements MethodChannel.MethodCallHandler, Appl
sInstance
.
mMediator
.
removeHandler
(
key
);
}
private
static
String
concatUrl
(
String
url
,
Map
params
)
{
if
(
params
==
null
||
params
.
isEmpty
())
return
url
;
Uri
uri
=
Uri
.
parse
(
url
);
Uri
.
Builder
builder
=
uri
.
buildUpon
();
for
(
Object
key
:
params
.
keySet
())
{
Object
value
=
params
.
get
(
key
);
if
(
value
!=
null
)
{
String
str
;
if
(
value
instanceof
Map
||
value
instanceof
List
)
{
try
{
str
=
URLEncoder
.
encode
(
JSON
.
toJSONString
(
value
),
"utf-8"
);
}
catch
(
UnsupportedEncodingException
e
)
{
str
=
value
.
toString
();
}
}
else
{
str
=
value
.
toString
();
}
builder
.
appendQueryParameter
(
String
.
valueOf
(
key
),
str
);
}
}
return
builder
.
build
().
toString
();
}
@Override
public
void
onActivityCreated
(
Activity
activity
,
Bundle
savedInstanceState
)
{
...
...
android/src/main/java/com/taobao/idlefish/flutterboost/NavigationService/NavigationService_openPage.java
View file @
f6567808
...
...
@@ -38,10 +38,18 @@
private
boolean
onCall
(
MessageResult
<
Boolean
>
result
,
String
pageName
,
Map
params
,
Boolean
animated
){
int
requestCode
=
0
;
if
(
params
!=
null
&&
params
.
get
(
"requestCode"
)
!=
null
)
{
requestCode
=
(
int
)
params
.
get
(
"requestCode"
);
}
FlutterBoostPlugin
.
openPage
(
null
,
pageName
,
params
,
0
);
if
(
result
!=
null
){
result
.
success
(
true
);
}
return
true
;
}
...
...
android/src/main/java/com/taobao/idlefish/flutterboost/interfaces/IPlatform.java
View file @
f6567808
...
...
@@ -59,7 +59,7 @@ public interface IPlatform {
* @param requestCode
* @return
*/
boolean
startActivity
(
Context
context
,
String
url
,
int
requestCode
);
boolean
startActivity
(
Context
context
,
String
url
,
Map
params
,
int
requestCode
);
/**
...
...
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