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
8d135558
Commit
8d135558
authored
Oct 31, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
0c3dbbff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
28 deletions
+27
-28
workspace.xml
.idea/workspace.xml
+15
-11
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+9
-17
ScanImagePlugn.dart
lib/ScanImagePlugn.dart
+3
-0
No files found.
.idea/workspace.xml
View file @
8d135558
...
...
@@ -5,7 +5,12 @@
<option
name=
"TOOL_WINDOW_CONFIGURED_FILTER"
value=
"Show only selected application"
/>
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
/>
<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$/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$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
afterDir=
"false"
/>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
<ignored
path=
"$PROJECT_DIR$/.pub/"
/>
...
...
@@ -51,8 +56,8 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2
17
"
>
<caret
line=
"
29"
selection-start-line=
"29"
selection-end-line=
"29
"
/>
<state
relative-caret-position=
"2
85
"
>
<caret
line=
"
19"
column=
"21"
selection-start-line=
"19"
selection-start-column=
"13"
selection-end-line=
"19"
selection-end-column=
"21
"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
...
...
@@ -105,8 +110,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11
572
"
>
<caret
line=
"54
8"
column=
"22"
selection-start-line=
"548"
selection-start-column=
"22"
selection-end-line=
"548
"
selection-end-column=
"22"
/>
<state
relative-caret-position=
"11
418
"
>
<caret
line=
"54
1"
column=
"22"
selection-start-line=
"541"
selection-start-column=
"22"
selection-end-line=
"541
"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
...
...
@@ -296,7 +301,6 @@
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"9"
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.19742489"
/>
<window_info
id=
"Captures"
order=
"1"
side_tool=
"true"
/>
...
...
@@ -313,7 +317,7 @@
<window_info
anchor=
"bottom"
id=
"Android Profiler"
order=
"3"
show_stripe_button=
"false"
/>
<window_info
anchor=
"bottom"
id=
"Logcat"
order=
"4"
weight=
"0.4534075"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"5"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.
44506258
"
/>
<window_info
active=
"true"
anchor=
"bottom"
id=
"Terminal"
order=
"6"
visible=
"true"
weight=
"0.
30458972
"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"7"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Flutter Performance"
order=
"8"
side_tool=
"true"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"9"
/>
...
...
@@ -538,8 +542,8 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"11
572
"
>
<caret
line=
"54
8"
column=
"22"
selection-start-line=
"548"
selection-start-column=
"22"
selection-end-line=
"548
"
selection-end-column=
"22"
/>
<state
relative-caret-position=
"11
418
"
>
<caret
line=
"54
1"
column=
"22"
selection-start-line=
"541"
selection-start-column=
"22"
selection-end-line=
"541
"
selection-end-column=
"22"
/>
</state>
</provider>
</entry>
...
...
@@ -588,8 +592,8 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"2
17
"
>
<caret
line=
"
29"
selection-start-line=
"29"
selection-end-line=
"29
"
/>
<state
relative-caret-position=
"2
85
"
>
<caret
line=
"
19"
column=
"21"
selection-start-line=
"19"
selection-start-column=
"13"
selection-end-line=
"19"
selection-end-column=
"21
"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
8d135558
...
...
@@ -463,20 +463,6 @@ NSString *cacheDirectory;
});
}
-
(
void
)
getThumbnailImages
{
// 获得所有的自定义相簿
PHFetchResult
<
PHAssetCollection
*>
*
assetCollections
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeAlbumRegular
options
:
nil
];
// 遍历所有的自定义相簿
for
(
PHAssetCollection
*
assetCollection
in
assetCollections
)
{
[
self
enumerateAssetsInAssetCollection
:
assetCollection
original
:
NO
];
}
// 获得相机胶卷
PHAssetCollection
*
cameraRoll
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
nil
].
lastObject
;
[
self
enumerateAssetsInAssetCollection
:
cameraRoll
original
:
NO
];
}
-
(
void
)
enumerateAssetsInAssetCollection
:
(
PHAssetCollection
*
)
assetCollection
original
:
(
BOOL
)
original
{
NSLog
(
@"相簿名:%@"
,
assetCollection
.
localizedTitle
);
...
...
@@ -499,9 +485,12 @@ NSString *cacheDirectory;
}
-
(
void
)
scanPhoneImage
{
PHFetchResult
<
PHAssetCollection
*>
*
favoritesCollection
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumFavorites
options
:
NO
];
PHFetchOptions
*
fetchOptions
=
[[
PHFetchOptions
alloc
]
init
];
// NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO];
// fetchOptions.sortDescriptors = @[sort];
PHFetchResult
<
PHAssetCollection
*>
*
favoritesCollection
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumFavorites
options
:
fetchOptions
];
// 获得相机胶卷
PHFetchResult
<
PHAssetCollection
*>
*
assetCollections
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
NO
];
PHFetchResult
<
PHAssetCollection
*>
*
assetCollections
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
fetchOptions
];
// 获得全部相片
PHFetchResult
<
PHAssetCollection
*>
*
cameraRolls
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
NO
];
...
...
@@ -644,6 +633,7 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)[
assets
.
creationDate
timeIntervalSince1970
]
*
1000
]
forKey
:
@"dataToken"
];
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
});
}];
...
...
@@ -674,16 +664,17 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:[
self
getVideoDuring
:
urlAsset
.
duration
]
forKey
:
@"during"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)[
assets
.
creationDate
timeIntervalSince1970
]
*
1000
]
forKey
:
@"dataToken"
];
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
}];
}];
}
}
else
{
if
([
fileManager
fileExistsAtPath
:
tmpPath
]
==
YES
){
NSLog
(
@"EXISTTTTTTT"
);
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)[
assets
.
creationDate
timeIntervalSince1970
]
*
1000
]
forKey
:
@"dataToken"
];
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
}
else
{
int
picWidth
=
[
assets
pixelWidth
];
...
...
@@ -709,6 +700,7 @@ NSString *cacheDirectory;
NSMutableDictionary
*
queryItemDict
=
[
NSMutableDictionary
dictionary
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:[
NSString
stringWithFormat
:
@"%ld"
,
(
long
)[
assets
.
creationDate
timeIntervalSince1970
]
*
1000
]
forKey
:
@"dataToken"
];
// self.copySize++;
[
self
saveItemAndUpload
:
queryItemDict
:
assets
:
tmpPath
:
docName
:
resultId
];
}];
...
...
lib/ScanImagePlugn.dart
View file @
8d135558
...
...
@@ -16,6 +16,8 @@ Map<String, List<ScanImageItem>> changData(Map images) {
scanImageItem
.
realPath
=
item
[
"realPath"
]
??
""
;
scanImageItem
.
isVideo
=
item
[
"isVideo"
]
==
"T"
?
true
:
false
;
scanImageItem
.
during
=
item
[
"during"
]
??
"0"
;
scanImageItem
.
dataToken
=
item
[
"dataToken"
]
==
null
?
0
:
int
.
parse
(
item
[
"dataToken"
]);
tempList
.
add
(
scanImageItem
);
}
newMap
.
putIfAbsent
(
k
,
()
=>
tempList
);
...
...
@@ -51,5 +53,6 @@ class ScanImageItem {
String
realPath
;
String
during
;
bool
isVideo
;
int
dataToken
;
int
size
;
}
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