Skip to content

Commit 77ad31c

Browse files
committed
局部调整代码
1 parent c0cbdf8 commit 77ad31c

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

LLWeChat/General/ImagePicker/LLAssetManager.m

+3-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,9 @@ - (void)fetchImageFromAssetModel_PhotoKit:(LLAssetModel *)assetModel asyncBlock:
459459

460460
[_imageManager requestImageForAsset:assetModel.asset_PH targetSize:pixSize contentMode:PHImageContentModeAspectFill options:_requestOptions resultHandler:^(UIImage *image, NSDictionary *info) {
461461
assetModel.isAssetInLocalAlbum = (image != nil);
462-
asyncCallback(image, assetModel);
462+
dispatch_async(dispatch_get_main_queue(), ^{
463+
asyncCallback(image, assetModel);
464+
});
463465
}];
464466

465467
}

LLWeChat/General/ImagePicker/View/LLImageScrollView.m

-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ - (void)setContentWithImage:(UIImage *)image {
4848
}
4949

5050
_isImageExist = YES;
51-
[self hideLoadingIndicator];
5251

5352
_imageSize = CGSizeMake(SCREEN_WIDTH, SCREEN_WIDTH/image.size.width * image.size.height);
5453
CGFloat _y = (SCREEN_HEIGHT > _imageSize.height) ? (SCREEN_HEIGHT - _imageSize.height)/2 : 0;

LLWeChat/General/ImagePicker/ViewController/LLImageShowController.m

+19-7
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ - (void)viewWillAppear:(BOOL)animated {
156156
- (void)fillScrollView:(LLImageScrollView *)scrollView withAssetIndex:(NSInteger)assetIndex {
157157
scrollView.assetIndex = assetIndex;
158158
scrollView.assetModel = _allAssets[assetIndex];
159-
159+
160160
LLFetchImageSyncCallbackBlock syncCallback = ^(UIImage *_Nullable image, BOOL needBackgroundLoading) {
161161
[scrollView setContentWithImage:image];
162162
};
@@ -166,6 +166,9 @@ - (void)fillScrollView:(LLImageScrollView *)scrollView withAssetIndex:(NSInteger
166166
for (LLImageScrollView *scrollView in weakSelf.innerScrollViews) {
167167
if (scrollView.assetModel == assetModel) {
168168
[scrollView setContentWithImage:image];
169+
if (assetModel == weakSelf.curShowAsset) {
170+
[weakSelf setImageSelectStatus];
171+
}
169172
break;
170173
}
171174
}
@@ -177,6 +180,8 @@ - (void)fillScrollView:(LLImageScrollView *)scrollView withAssetIndex:(NSInteger
177180
[scrollView setContentWithImage:nil];
178181
}
179182

183+
[scrollView setContentWithImage:[UIImage imageNamed:@"ff_IconShake"]];
184+
180185
scrollView.frame = CGRectMake(scroll_width * assetIndex, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
181186
}
182187

@@ -201,10 +206,20 @@ - (void)showAllImage {
201206

202207
}
203208

209+
- (void)setImageSelectStatus {
210+
if (_curShowScrollView.isImageExist) {
211+
self.bigSelectView.hidden = NO;
212+
self.bigSelectView.selected = [self.allSelectdAssets containsObject:self.curShowAsset];
213+
}else {
214+
self.bigSelectView.hidden = YES;
215+
}
216+
}
204217

205218
#pragma mark - 处理左右拖动
206219

207220
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
221+
NSLog(@"scrollWillBeginDragging");
222+
208223
if (scrollView != self.scrollView) {
209224
for (LLImageScrollView *scrollView in self.innerScrollViews) {
210225
scrollView.hidden = YES;
@@ -245,12 +260,7 @@ - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
245260
//判断当前显示照片是否已被选择
246261
NSInteger assetIndex = innerScrollView.assetIndex;
247262
self.curShowAsset = self.allAssets[assetIndex];
248-
if (_curShowScrollView.isImageExist) {
249-
self.bigSelectView.hidden = NO;
250-
self.bigSelectView.selected = [self.allSelectdAssets containsObject:self.curShowAsset];
251-
}else {
252-
self.bigSelectView.hidden = YES;
253-
}
263+
[self setImageSelectStatus];
254264

255265
//移动前后照片
256266
if (assetIndex + 1 < _allAssets.count && [self scrollViewWithAssetIndex:assetIndex + 1] == nil) {
@@ -312,6 +322,8 @@ - (void)scrollViewDidZoom:(LLImageScrollView *)scrollView {
312322
#pragma mark - 其他
313323

314324
- (void)handleTapGesture:(UITapGestureRecognizer *)tap {
325+
NSLog(@"TapTp");
326+
315327
self.toolbar.hidden = !self.toolbar.isHidden;
316328
self.navigationController.navigationBar.hidden = !self.navigationController.navigationBar.isHidden;
317329
}

0 commit comments

Comments
 (0)