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
405e5f97
Commit
405e5f97
authored
4 years ago
by
Christofer Bodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix android intent chooser not showing camera/camcorder when all mime types are supported.
parent
eaad17eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java
...r_inappwebview/InAppWebView/InAppWebViewChromeClient.java
+16
-2
No files found.
android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java
View file @
405e5f97
...
...
@@ -971,6 +971,20 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
return
intent
;
}
private
Boolean
acceptsAny
(
String
[]
types
)
{
if
(
isArrayEmpty
(
types
))
{
return
true
;
}
for
(
String
type
:
types
)
{
if
(
type
.
equals
(
"*/*"
))
{
return
true
;
}
}
return
false
;
}
private
Boolean
acceptsImages
(
String
types
)
{
String
mimeType
=
types
;
if
(
types
.
matches
(
"\\.\\w+"
))
{
...
...
@@ -981,7 +995,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
private
Boolean
acceptsImages
(
String
[]
types
)
{
String
[]
mimeTypes
=
getAcceptedMimeType
(
types
);
return
isArrayEmpty
(
mimeT
ypes
)
||
arrayContainsString
(
mimeTypes
,
"image"
);
return
acceptsAny
(
t
ypes
)
||
arrayContainsString
(
mimeTypes
,
"image"
);
}
private
Boolean
acceptsVideo
(
String
types
)
{
...
...
@@ -994,7 +1008,7 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
private
Boolean
acceptsVideo
(
String
[]
types
)
{
String
[]
mimeTypes
=
getAcceptedMimeType
(
types
);
return
isArrayEmpty
(
mimeT
ypes
)
||
arrayContainsString
(
mimeTypes
,
"video"
);
return
acceptsAny
(
t
ypes
)
||
arrayContainsString
(
mimeTypes
,
"video"
);
}
private
Boolean
arrayContainsString
(
String
[]
array
,
String
pattern
)
{
...
...
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