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
60f3421d
Commit
60f3421d
authored
Oct 29, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c
parent
9dad6bf6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
13 deletions
+31
-13
workspace.xml
.idea/workspace.xml
+0
-0
AlbumModel.dart
example/lib/AlbumModel/page/album/AlbumModel.dart
+16
-0
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+15
-13
No files found.
.idea/workspace.xml
View file @
60f3421d
This diff is collapsed.
Click to expand it.
example/lib/AlbumModel/page/album/AlbumModel.dart
View file @
60f3421d
...
...
@@ -218,8 +218,24 @@ class AlbumModel {
if
(
_selectList
.
isEmpty
)
{
Navigator
.
pop
(
context
,
""
);
}
else
{
if
(
Platform
.
isAndroid
)
{
Navigator
.
pop
(
context
,
_selectList
[
0
]);
}
else
{
iosAlbum
(
_selectList
,
context
,
(
value
)
{
print
(
value
);
Navigator
.
pop
(
context
,
List
<
String
>.
from
(
value
)[
0
]);
});
}
}
}
void
iosAlbum
(
List
<
String
>
list
,
BuildContext
context
,
Function
fun
)
{
GengmeiFlutterPlugin
.
ios_album_path
(
list
).
then
((
value
)
{
fun
(
value
);
}).
catchError
((
error
)
{
print
(
error
);
});
}
void
nativeCamera
(
BuildContext
context
)
{
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
60f3421d
...
...
@@ -257,7 +257,8 @@ NSString *cacheDirectory;
}
}];
}
else
{
if
([
fileManager
fileExistsAtPath
:
tempPath
]){
if
([
fileManager
fileExistsAtPath
:
tempTake
]){
NSLog
(
@"1111"
);
self
.
channelSize
++
;
[
self
.
channelList
addObject
:[
NSString
stringWithFormat
:
@"%@"
,
tempTake
]];
if
(
self
.
channelSize
==
self
.
channelAllSize
){
...
...
@@ -266,6 +267,7 @@ NSString *cacheDirectory;
});
}
}
else
{
NSLog
(
@"222"
);
int
picWidth
=
[
assets
pixelWidth
];
int
picHeight
=
[
assets
pixelHeight
];
float
tempScareSize
=
1
;
...
...
@@ -277,12 +279,13 @@ NSString *cacheDirectory;
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
temp
contentMode
:
PHImageContentModeDefault
options
:
imageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
res
,
NSDictionary
*
_Nullable
info
)
{
@autoreleasepool
{
// @autoreleasepool{
NSLog
(
@"33333"
);
NSData
*
data
=
UIImageJPEGRepresentation
(
res
,
0
.
8
)
;
[
data
writeToFile
:
tempTake
atomically
:
YES
];
data
=
nil
;
res
=
nil
;
}
//
}
self
.
channelSize
++
;
[
self
.
channelList
addObject
:[
NSString
stringWithFormat
:
@"%@"
,
tempTake
]];
if
(
self
.
channelSize
==
self
.
channelAllSize
){
...
...
@@ -552,6 +555,7 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
@synchronized
(
self
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
...
...
@@ -560,6 +564,7 @@ NSString *cacheDirectory;
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
...
...
@@ -594,6 +599,7 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
@synchronized
(
self
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
...
...
@@ -602,6 +608,7 @@ NSString *cacheDirectory;
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
...
...
@@ -617,6 +624,7 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
@synchronized
(
self
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
...
...
@@ -625,6 +633,7 @@ NSString *cacheDirectory;
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
...
...
@@ -655,8 +664,9 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
self
.
copySize
++
;
@synchronized
(
self
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
if
(
arr
==
nil
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
...
...
@@ -664,19 +674,11 @@ NSString *cacheDirectory;
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
}
// if(self.needSize>80&&self.copySize==80){
// [self resultImgs:resultId];
// }else if(self.needSize<=80&&self.nowSize==self.needSize){
// [self resultImgs:resultId];
// }else if(self.needSize>80&&self.nowSize==self.needSize){
// [self upImgs];
// }else if(self.needSize>80&&self.copySize>80&&self.copySize%200==0){
// [self upImgs];
// }
}];
}
}
...
...
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