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
14e3e8c4
Commit
14e3e8c4
authored
Dec 10, 2020
by
Christofer Bodin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix captured media filename having multiple suffixes
parent
4f316d5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java
...r_inappwebview/InAppWebView/InAppWebViewChromeClient.java
+4
-6
No files found.
android/src/main/java/com/pichillilorenzo/flutter_inappwebview/InAppWebView/InAppWebViewChromeClient.java
View file @
14e3e8c4
...
...
@@ -1106,31 +1106,29 @@ public class InAppWebViewChromeClient extends WebChromeClient implements PluginR
String
prefix
=
""
;
String
suffix
=
""
;
String
dir
=
""
;
String
filename
=
""
;
if
(
intentType
.
equals
(
MediaStore
.
ACTION_IMAGE_CAPTURE
))
{
prefix
=
"image
-
"
;
prefix
=
"image"
;
suffix
=
".jpg"
;
dir
=
Environment
.
DIRECTORY_PICTURES
;
}
else
if
(
intentType
.
equals
(
MediaStore
.
ACTION_VIDEO_CAPTURE
))
{
prefix
=
"video
-
"
;
prefix
=
"video"
;
suffix
=
".mp4"
;
dir
=
Environment
.
DIRECTORY_MOVIES
;
}
filename
=
prefix
+
String
.
valueOf
(
System
.
currentTimeMillis
())
+
suffix
;
// for versions below 6.0 (23) we use the old File creation & permissions model
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
)
{
// only this Directory works on all tested Android versions
// ctx.getExternalFilesDir(dir) was failing on Android 5.0 (sdk 21)
File
storageDir
=
Environment
.
getExternalStoragePublicDirectory
(
dir
);
String
filename
=
String
.
format
(
"%s-%d%s"
,
prefix
,
System
.
currentTimeMillis
(),
suffix
);
return
new
File
(
storageDir
,
filename
);
}
Activity
activity
=
inAppBrowserActivity
!=
null
?
inAppBrowserActivity
:
Shared
.
activity
;
File
storageDir
=
activity
.
getApplicationContext
().
getExternalFilesDir
(
null
);
return
File
.
createTempFile
(
filename
,
suffix
,
storageDir
);
return
File
.
createTempFile
(
prefix
,
suffix
,
storageDir
);
}
private
Boolean
isArrayEmpty
(
String
[]
arr
)
{
...
...
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