Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
Flutter Inappwebview
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 Inappwebview
Commits
499ab2a0
Commit
499ab2a0
authored
May 24, 2019
by
Xu Mengtong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add new option to control the contentMode in Android platform
parent
da99de05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java
...renzo/flutter_inappbrowser/InAppWebView/InAppWebView.java
+20
-0
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java
...lutter_inappbrowser/InAppWebView/InAppWebViewOptions.java
+1
-0
No files found.
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebView.java
View file @
499ab2a0
...
...
@@ -191,6 +191,16 @@ public class InAppWebView extends WebView {
if
(
options
.
transparentBackground
)
{
setBackgroundColor
(
Color
.
TRANSPARENT
);
}
if
(!
options
.
mixedContentMode
.
isEmpty
())
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
if
(
options
.
mixedContentMode
.
equals
(
"MIXED_CONTENT_COMPATIBILITY_MODE"
))
{
settings
.
setMixedContentMode
(
WebSettings
.
MIXED_CONTENT_COMPATIBILITY_MODE
);
}
else
if
(
options
.
mixedContentMode
.
equals
(
"MIXED_CONTENT_ALWAYS_ALLOW"
))
{
settings
.
setMixedContentMode
(
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
);
}
}
}
}
public
void
loadUrl
(
String
url
,
MethodChannel
.
Result
result
)
{
...
...
@@ -355,6 +365,16 @@ public class InAppWebView extends WebView {
}
}
if
(
newOptionsMap
.
get
(
"mixedContentMode"
)
!=
null
&&
options
.
mixedContentMode
!=
newOptions
.
mixedContentMode
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
if
(
newOptions
.
mixedContentMode
.
equals
(
"MIXED_CONTENT_COMPATIBILITY_MODE"
))
{
settings
.
setMixedContentMode
(
WebSettings
.
MIXED_CONTENT_COMPATIBILITY_MODE
);
}
else
if
(
newOptions
.
mixedContentMode
.
equals
(
"MIXED_CONTENT_ALWAYS_ALLOW"
))
{
settings
.
setMixedContentMode
(
WebSettings
.
MIXED_CONTENT_ALWAYS_ALLOW
);
}
}
}
options
=
newOptions
;
}
...
...
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java
View file @
499ab2a0
...
...
@@ -24,4 +24,5 @@ public class InAppWebViewOptions extends Options {
public
boolean
useWideViewPort
=
true
;
public
boolean
safeBrowsingEnabled
=
true
;
public
boolean
transparentBackground
=
false
;
public
String
mixedContentMode
=
"MIXED_CONTENT_NEVER_ALLOW"
;
}
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