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
c51497b0
Commit
c51497b0
authored
5 years ago
by
Lorenzo Pichilli
Committed by
GitHub
5 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #101 from DreamBuddy/master
add new option to control the contentMode in Android platform
parents
da99de05
499ab2a0
master
develop
v1.2.1
v1.2.2
v2.0.0
v2.0.1
v2.0.1+1
v2.1.0
v2.1.0+1
v3.0.0
v3.1.0
v3.2.0
v3.3.0
v3.3.0+3
v3.4.0
v3.4.0+1
v3.4.0+2
v4.0.0
v4.0.0+4
v4.0.0+6
v4.0.0+5
v4.0.0+4
v4.0.0
v3.4.0+2
v3.4.0+1
v.3.4.0
v3.3.0+3
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.1.0+1
v2.1.0
v2.0.1+1
v2.0.1
v2.0.0
v1.2.1
No related merge requests found
Changes
2
Show 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 @
c51497b0
...
...
@@ -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
;
}
...
...
This diff is collapsed.
Click to expand it.
android/src/main/java/com/pichillilorenzo/flutter_inappbrowser/InAppWebView/InAppWebViewOptions.java
View file @
c51497b0
...
...
@@ -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"
;
}
This diff is collapsed.
Click to expand it.
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