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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
45 deletions
+63
-45
workspace.xml
.idea/workspace.xml
+0
-0
AlbumModel.dart
example/lib/AlbumModel/page/album/AlbumModel.dart
+17
-1
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+46
-44
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,10 +218,26 @@ class AlbumModel {
...
@@ -218,10 +218,26 @@ class AlbumModel {
if
(
_selectList
.
isEmpty
)
{
if
(
_selectList
.
isEmpty
)
{
Navigator
.
pop
(
context
,
""
);
Navigator
.
pop
(
context
,
""
);
}
else
{
}
else
{
Navigator
.
pop
(
context
,
_selectList
[
0
]);
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
)
{
void
nativeCamera
(
BuildContext
context
)
{
if
(
_selectList
.
length
==
maxCount
)
{
if
(
_selectList
.
length
==
maxCount
)
{
// Toast.show(context, "最多选择${_maxCount}张图片");
// Toast.show(context, "最多选择${_maxCount}张图片");
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
60f3421d
...
@@ -257,7 +257,8 @@ NSString *cacheDirectory;
...
@@ -257,7 +257,8 @@ NSString *cacheDirectory;
}
}
}];
}];
}
else
{
}
else
{
if
([
fileManager
fileExistsAtPath
:
tempPath
]){
if
([
fileManager
fileExistsAtPath
:
tempTake
]){
NSLog
(
@"1111"
);
self
.
channelSize
++
;
self
.
channelSize
++
;
[
self
.
channelList
addObject
:[
NSString
stringWithFormat
:
@"%@"
,
tempTake
]];
[
self
.
channelList
addObject
:[
NSString
stringWithFormat
:
@"%@"
,
tempTake
]];
if
(
self
.
channelSize
==
self
.
channelAllSize
){
if
(
self
.
channelSize
==
self
.
channelAllSize
){
...
@@ -266,6 +267,7 @@ NSString *cacheDirectory;
...
@@ -266,6 +267,7 @@ NSString *cacheDirectory;
});
});
}
}
}
else
{
}
else
{
NSLog
(
@"222"
);
int
picWidth
=
[
assets
pixelWidth
];
int
picWidth
=
[
assets
pixelWidth
];
int
picHeight
=
[
assets
pixelHeight
];
int
picHeight
=
[
assets
pixelHeight
];
float
tempScareSize
=
1
;
float
tempScareSize
=
1
;
...
@@ -277,12 +279,13 @@ NSString *cacheDirectory;
...
@@ -277,12 +279,13 @@ NSString *cacheDirectory;
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
CGSize
temp
=
CGSizeMake
(
picWidth
*
tempScareSize
,
picHeight
*
tempScareSize
);
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
temp
contentMode
:
PHImageContentModeDefault
options
:
imageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
res
,
NSDictionary
*
_Nullable
info
)
{
[[
PHImageManager
defaultManager
]
requestImageForAsset
:
assets
targetSize
:
temp
contentMode
:
PHImageContentModeDefault
options
:
imageRequestOption
resultHandler
:^
(
UIImage
*
_Nullable
res
,
NSDictionary
*
_Nullable
info
)
{
@autoreleasepool
{
// @autoreleasepool{
NSData
*
data
=
UIImageJPEGRepresentation
(
res
,
0
.
8
)
;
NSLog
(
@"33333"
);
[
data
writeToFile
:
tempTake
atomically
:
YES
];
NSData
*
data
=
UIImageJPEGRepresentation
(
res
,
0
.
8
)
;
data
=
nil
;
[
data
writeToFile
:
tempTake
atomically
:
YES
];
res
=
nil
;
data
=
nil
;
}
res
=
nil
;
// }
self
.
channelSize
++
;
self
.
channelSize
++
;
[
self
.
channelList
addObject
:[
NSString
stringWithFormat
:
@"%@"
,
tempTake
]];
[
self
.
channelList
addObject
:[
NSString
stringWithFormat
:
@"%@"
,
tempTake
]];
if
(
self
.
channelSize
==
self
.
channelAllSize
){
if
(
self
.
channelSize
==
self
.
channelAllSize
){
...
@@ -552,14 +555,16 @@ NSString *cacheDirectory;
...
@@ -552,14 +555,16 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
@synchronized
(
self
)
{
if
(
arr
==
nil
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
if
(
arr
==
nil
)
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
[
self
resultImgs
:
resultId
];
...
@@ -594,14 +599,16 @@ NSString *cacheDirectory;
...
@@ -594,14 +599,16 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"T"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
@synchronized
(
self
)
{
if
(
arr
==
nil
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
if
(
arr
==
nil
)
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
[
self
resultImgs
:
resultId
];
...
@@ -617,14 +624,16 @@ NSString *cacheDirectory;
...
@@ -617,14 +624,16 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
@synchronized
(
self
)
{
if
(
arr
==
nil
)
{
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
if
(
arr
==
nil
)
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
[
self
resultImgs
:
resultId
];
...
@@ -655,28 +664,21 @@ NSString *cacheDirectory;
...
@@ -655,28 +664,21 @@ NSString *cacheDirectory;
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
tmpPath
forKey
:
@"path"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
queryItemDict
setObject
:
@"F"
forKey
:
@"isVideo"
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
[
self
.
scanMap
setObject
:
assets
forKey
:
tmpPath
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
self
.
copySize
++
;
self
.
copySize
++
;
if
(
arr
==
nil
)
{
@synchronized
(
self
)
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
NSMutableArray
*
arr
=
self
.
finalMap
[
docName
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
if
(
arr
==
nil
)
{
}
else
{
self
.
finalMap
[
docName
]
=
[
NSMutableArray
array
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
else
{
[
self
.
finalMap
[
docName
]
addObject
:
queryItemDict
];
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
}
}
[
self
.
finalMap
[
@"IsGengmeiAlbumAllImages"
]
addObject
:
queryItemDict
];
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
NSLog
(
@"SCARE SIZEEE %d %d "
,
self
.
nowSize
,
self
.
needSize
);
if
(
self
.
nowSize
==
self
.
needSize
)
{
if
(
self
.
nowSize
==
self
.
needSize
)
{
[
self
resultImgs
:
resultId
];
[
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