Commit 72bc7ae5 authored by 林生雨's avatar 林生雨

commit

parent 7c88c03d
This diff is collapsed.
...@@ -240,7 +240,7 @@ class AlbumModel { ...@@ -240,7 +240,7 @@ class AlbumModel {
// print("IM $image VIDEI ${video}"); // print("IM $image VIDEI ${video}");
// }); // });
// }); // });
Navigator.pop(context, List<String>.from(value)[0]); Navigator.pop(context, List<Map>.from(value));
}); });
} }
} }
......
...@@ -183,8 +183,8 @@ class AlbumState extends State<AlbumPage> { ...@@ -183,8 +183,8 @@ class AlbumState extends State<AlbumPage> {
} }
return GestureDetector( return GestureDetector(
onTap: (){ onTap: (){
_model.previewItem(context, newIndex, "pageName"); // _model.previewItem(context, newIndex, "pageName");
// _model.clickItem(context, newIndex); _model.clickItem(context, newIndex);
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
......
...@@ -132,6 +132,7 @@ class HOME extends StatefulWidget { ...@@ -132,6 +132,7 @@ class HOME extends StatefulWidget {
class HOMESTATE extends State<HOME> { class HOMESTATE extends State<HOME> {
String imagePath; String imagePath;
List<String> realPath = [];
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
...@@ -142,21 +143,39 @@ class HOMESTATE extends State<HOME> { ...@@ -142,21 +143,39 @@ class HOMESTATE extends State<HOME> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => AlbumPage(false, 10, null))) builder: (context) => AlbumPage(false, 50, null)))
.then((value) { .then((value) {
List<String> ll = [];
var value2 = (value as List);
value2.forEach((item) {
var map = Map<String, String>.from(item);
ll.add(map["realImagePath"]);
});
setState(() { setState(() {
imagePath = value; realPath = ll;
// imagePath = value;
}); });
}).catchError((error) { }).catchError((error) {
print(error); print(error);
}); });
}, },
child: Container( child: Container(
width: 200, width: double.maxFinite,
height: 200, height: double.maxFinite,
color: Colors.yellow, color: Colors.yellow,
child: child: ListView.builder(
imagePath == null ? Text("www") : Image.file(File(imagePath)), itemCount: realPath.length,
itemBuilder: (con, index) {
return Container(
width: double.maxFinite,
height: 500,
child: Image.file(
File(realPath[index]),
fit: BoxFit.fitHeight,
),
);
})
// imagePath == null ? Text("www") : Image.file(File(imagePath)),
))); )));
} }
} }
...@@ -299,6 +299,7 @@ NSString *cacheDirectory; ...@@ -299,6 +299,7 @@ NSString *cacheDirectory;
// //
// CGSize temp=CGSizeMake(picWidth*tempScareSize, picHeight*tempScareSize); // CGSize temp=CGSizeMake(picWidth*tempScareSize, picHeight*tempScareSize);
dispatch_async(concurrentQueue, ^{ dispatch_async(concurrentQueue, ^{
NSString* tempTake1= [tempPath stringByAppendingPathComponent:[path[i] lastPathComponent]];
[[PHImageManager defaultManager] requestImageDataForAsset:assets options:imageRequestOption resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) { [[PHImageManager defaultManager] requestImageDataForAsset:assets options:imageRequestOption resultHandler:^(NSData * _Nullable imageData, NSString * _Nullable dataUTI, UIImageOrientation orientation, NSDictionary * _Nullable info) {
// [[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) {
...@@ -306,13 +307,13 @@ NSString *cacheDirectory; ...@@ -306,13 +307,13 @@ NSString *cacheDirectory;
@autoreleasepool{ @autoreleasepool{
UIImage * res=[UIImage imageWithData:imageData]; UIImage * res=[UIImage imageWithData:imageData];
NSData *data = UIImageJPEGRepresentation(res, 0.8) ; NSData *data = UIImageJPEGRepresentation(res, 0.8) ;
[data writeToFile:tempTake atomically:YES]; [data writeToFile:tempTake1 atomically:YES];
res=nil; res=nil;
data=nil; data=nil;
} }
NSMutableDictionary *dict=[[NSMutableDictionary alloc] init]; NSMutableDictionary *dict=[[NSMutableDictionary alloc] init];
[dict setObject:path[i] forKey:@"path"]; [dict setObject:path[i] forKey:@"path"];
[dict setObject:tempTake forKey:@"realImagePath"]; [dict setObject:tempTake1 forKey:@"realImagePath"];
@synchronized (self) { @synchronized (self) {
self.channelSize++; self.channelSize++;
[self.channelList addObject:dict]; [self.channelList addObject:dict];
......
...@@ -64,9 +64,9 @@ ...@@ -64,9 +64,9 @@
// playerVC.view.frame = CGRectMake(200, 300, 300, 300); // playerVC.view.frame = CGRectMake(200, 300, 300, 300);
[self.view addSubview:playerVC.view]; [self.view addSubview:playerVC.view];
[self addChildViewController:playerVC]; [self addChildViewController:playerVC];
// if (playerVC.readyForDisplay) { if (playerVC.readyForDisplay) {
[playerVC.player play]; [playerVC.player play];
// } }
}); });
}]; }];
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment