Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flutter_plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
flutter_plugin
Commits
13da6aa9
Commit
13da6aa9
authored
Oct 28, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
888cd394
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
14 deletions
+27
-14
workspace.xml
.idea/workspace.xml
+2
-5
ImageRespository.kt
...flutter_plugin/ImagePlugin/repository/ImageRespository.kt
+25
-9
No files found.
.idea/workspace.xml
View file @
13da6aa9
...
...
@@ -6,11 +6,7 @@
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/Thumb.kt"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/local/Thumb.kt"
beforeDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
...
...
@@ -283,6 +279,7 @@
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"0"
y=
"23"
width=
"1440"
height=
"811"
extended-state=
"6"
/>
<editor
active=
"true"
/>
<layout>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.1509299"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
...
...
android/src/main/java/com/example/gengmei_flutter_plugin/ImagePlugin/repository/ImageRespository.kt
View file @
13da6aa9
...
...
@@ -27,6 +27,7 @@ import kotlin.collections.ArrayList
import
kotlin.collections.HashMap
import
android.media.ThumbnailUtils
import
android.graphics.Bitmap
import
android.text.TextUtils
/**
...
...
@@ -40,7 +41,7 @@ class ImageRespository {
val
recordImageListMap
=
ArrayList
<
HashMap
<
String
,
Any
>>()
var
finishOneTask
=
false
val
fileDir
=
Environment
.
getExternalStorageDirectory
().
absolutePath
+
"/GMAlbum/.album"
;
val
fileDir
=
Environment
.
getExternalStorageDirectory
().
absolutePath
+
"/
.
GMAlbum/.album"
;
//: HashMap<String, ArrayList<HashMap<String, Any>>>
...
...
@@ -64,7 +65,7 @@ class ImageRespository {
val
it2
=
iterator
.
next
()
for
(
item
in
images
)
{
if
(
item
.
id
==
it2
.
id
)
{
if
(
item
.
path
!=
null
&&
File
(
item
.
path
).
exists
())
{
if
(
item
.
path
!=
null
&&
!
TextUtils
.
isEmpty
(
item
.
path
)
&&
File
(
item
.
path
).
exists
())
{
it2
.
path
=
item
.
path
}
it2
.
isVideo
=
false
...
...
@@ -80,7 +81,7 @@ class ImageRespository {
val
it1
=
iteratorVideo
.
next
()
for
(
item
in
videos
)
{
if
(
item
.
id
==
it1
.
id
)
{
if
(
item
.
path
!=
null
&&
File
(
item
.
path
).
exists
())
{
if
(
item
.
path
!=
null
&&
!
TextUtils
.
isEmpty
(
item
.
path
)
&&
File
(
item
.
path
).
exists
())
{
it1
.
path
=
item
.
path
}
it1
.
isVideo
=
true
...
...
@@ -131,7 +132,7 @@ class ImageRespository {
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis() - start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
listener
.
onSuccess
(
toMap
Sync
(
context
,
recordImageListMap
))
}
}
return
@execute
...
...
@@ -143,7 +144,7 @@ class ImageRespository {
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis() - start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
listener
.
onSuccess
(
toMap
Sync
(
context
,
recordImageListMap
))
}
}
return
@execute
...
...
@@ -155,7 +156,7 @@ class ImageRespository {
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis() - start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
listener
.
onSuccess
(
toMap
Sync
(
context
,
recordImageListMap
))
}
}
return
@execute
...
...
@@ -177,11 +178,11 @@ class ImageRespository {
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis() - start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
listener
.
onSuccess
(
toMap
Sync
(
context
,
recordImageListMap
))
}
else
{
if
(
noPathSize
>
letSize
)
{
letSize
+=
70
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
listener
.
onSuccess
(
toMap
Sync
(
context
,
recordImageListMap
))
}
}
}
...
...
@@ -192,7 +193,7 @@ class ImageRespository {
if
(
currentSize
==
needSize
)
{
Log
.
e
(
"lsy"
,
" 压缩完成 耗时:${System.currentTimeMillis() - start}"
)
//FINISH
listener
.
onSuccess
(
toMap
(
context
,
recordImageListMap
))
listener
.
onSuccess
(
toMap
Sync
(
context
,
recordImageListMap
))
}
}
}
...
...
@@ -324,6 +325,21 @@ class ImageRespository {
return
finalList
;
}
private
fun
toMapSync
(
context
:
Context
,
imageListMap
:
ArrayList
<
HashMap
<
String
,
Any
>>):
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>
{
val
finalList
=
HashMap
<
String
,
ArrayList
<
HashMap
<
String
,
Any
>>>()
imageListMap
.
forEach
{
it
[
"folderName"
]
?.
run
{
if
(
finalList
[
this
]
==
null
)
{
finalList
[
this
as
String
]
=
ArrayList
<
HashMap
<
String
,
Any
>>()
finalList
[
this
]
!!
.
add
(
it
);
}
else
{
finalList
[
this
as
String
]
!!
.
add
(
it
);
}
}
}
finalList
[
"IsGengmeiAlbumAllImages"
]
=
imageListMap
;
return
finalList
;
}
companion
object
{
private
var
instance
:
ImageRespository
?
=
null
...
...
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