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
ff2695bd
Commit
ff2695bd
authored
Oct 31, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
8d135558
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
17 deletions
+16
-17
workspace.xml
.idea/workspace.xml
+6
-10
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+5
-6
AlbumItem.m
ios/Classes/Image/AlbumItem.m
+5
-1
No files found.
.idea/workspace.xml
View file @
ff2695bd
...
...
@@ -5,12 +5,7 @@
<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=
""
>
<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>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
/>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
<ignored
path=
"$PROJECT_DIR$/.pub/"
/>
...
...
@@ -56,8 +51,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
85
"
>
<caret
line=
"19"
column=
"
21"
selection-start-line=
"19"
selection-start-column=
"13"
selection-end-line=
"19"
selection-end-column=
"2
1"
/>
<state
relative-caret-position=
"2
63
"
>
<caret
line=
"19"
column=
"
71"
selection-start-line=
"19"
selection-start-column=
"10"
selection-end-line=
"19"
selection-end-column=
"7
1"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
...
...
@@ -301,6 +296,7 @@
</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"
/>
...
...
@@ -592,8 +588,8 @@
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<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=
"2
1"
/>
<state
relative-caret-position=
"2
63
"
>
<caret
line=
"19"
column=
"
71"
selection-start-line=
"19"
selection-start-column=
"10"
selection-end-line=
"19"
selection-end-column=
"7
1"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
ff2695bd
...
...
@@ -485,14 +485,13 @@ NSString *cacheDirectory;
}
-
(
void
)
scanPhoneImage
{
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
*>
*
favoritesCollection
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumFavorites
options
:
nil
];
// 获得相机胶卷
PHFetchResult
<
PHAssetCollection
*>
*
assetCollections
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
fetchOptions
];
PHFetchResult
<
PHAssetCollection
*>
*
assetCollections
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
nil
];
// 获得全部相片
PHFetchResult
<
PHAssetCollection
*>
*
cameraRolls
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
NO
];
PHFetchResult
<
PHAssetCollection
*>
*
cameraRolls
=
[
PHAssetCollection
fetchAssetCollectionsWithType
:
PHAssetCollectionTypeSmartAlbum
subtype
:
PHAssetCollectionSubtypeSmartAlbumUserLibrary
options
:
nil
];
for
(
PHAssetCollection
*
collection
in
cameraRolls
)
{
AlbumItem
*
model
=
[[
AlbumItem
alloc
]
init
];
...
...
ios/Classes/Image/AlbumItem.m
View file @
ff2695bd
...
...
@@ -21,9 +21,13 @@
// self.collectionTitle = collection.localizedTitle;
PHFetchOptions
*
fetchOptions
=
[[
PHFetchOptions
alloc
]
init
];
fetchOptions
.
sortDescriptors
=
@[[
NSSortDescriptor
sortDescriptorWithKey
:
@"creationDate"
ascending
:
NO
]];
// NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"creationDate" ascending:NO];
// 获得某个相簿中的所有PHAsset对象
self
.
assets
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
nil
];
self
.
assets
=
[
PHAsset
fetchAssetsInAssetCollection
:
collection
options
:
fetchOptions
];
if
(
self
.
assets
.
count
>
0
)
{
self
.
firstAsset
=
self
.
assets
[
0
];
...
...
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