ZLBigImageCell.h
3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
//
// ZLBigImageCell.h
// 多选相册照片
//
// Created by long on 15/11/26.
// Copyright © 2015年 long. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <PhotosUI/PhotosUI.h>
@class ZLPhotoModel;
@class PHAsset;
@class ZLPreviewView;
@interface ZLBigImageCell : UICollectionViewCell
@property (nonatomic, assign) BOOL showGif;
@property (nonatomic, assign) BOOL showLivePhoto;
@property (nonatomic, strong) ZLPreviewView *previewView;
@property (nonatomic, strong) ZLPhotoModel *model;
@property (nonatomic, copy) void (^singleTapCallBack)(void);
@property (nonatomic, copy) void (^longPressCallBack)(void);
@property (nonatomic, assign) BOOL willDisplaying;
/**
重置缩放比例
*/
- (void)resetCellStatus;
/**
界面停止滑动后,加载gif和livephoto,保持界面流畅
*/
- (void)reloadGifLivePhoto;
/**
界面滑动时,停止播放gif、livephoto、video
*/
- (void)pausePlay;
@end
@class ZLPreviewImageAndGif;
@class ZLPreviewLivePhoto;
@class ZLPreviewVideo;
@class ZLPreviewNetVideo;
//预览大图,image、gif、livephoto、video
@interface ZLPreviewView : UIView
@property (nonatomic, assign) BOOL showGif;
@property (nonatomic, assign) BOOL showLivePhoto;
@property (nonatomic, strong) ZLPreviewImageAndGif *imageGifView;
@property (nonatomic, strong) ZLPreviewLivePhoto *livePhotoView;
@property (nonatomic, strong) ZLPreviewVideo *videoView;
@property (nonatomic, strong) ZLPreviewNetVideo *netVideoView;
@property (nonatomic, strong) ZLPhotoModel *model;
@property (nonatomic, copy) void (^singleTapCallBack)(void);
@property (nonatomic, copy) void (^longPressCallBack)(void);
/**
界面每次即将显示时,重置scrollview缩放状态
*/
- (void)resetScale;
/**
处理划出界面后操作
*/
- (void)handlerEndDisplaying;
/**
reload gif,livephoto,video
*/
- (void)reload;
- (void)resumePlay;
- (void)pausePlay;
- (UIImage *)image;
@end
//---------------base preview---------------
@interface ZLBasePreviewView : UIView
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UIActivityIndicatorView *indicator;
@property (nonatomic, strong) PHAsset *asset;
@property (nonatomic, assign) PHImageRequestID imageRequestID;
@property (nonatomic, strong) UITapGestureRecognizer *singleTap;
@property (nonatomic, copy) void (^singleTapCallBack)(void);
- (void)singleTapAction;
- (void)loadNormalImage:(PHAsset *)asset;
- (void)resetScale;
- (UIImage *)image;
@end
//---------------image、gif、net image---------------
@interface ZLPreviewImageAndGif : ZLBasePreviewView
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) UILongPressGestureRecognizer *longPressGesture;
@property (nonatomic, assign) BOOL loadOK;
@property (nonatomic, copy) void (^longPressCallBack)(void);
- (void)loadGifImage:(PHAsset *)asset;
- (void)loadImage:(id)obj;
- (void)resumeGif;
- (void)pauseGif;
@end
//---------------livephoto---------------
@interface ZLPreviewLivePhoto : ZLBasePreviewView
@property (nonatomic, strong) PHLivePhotoView *lpView;
- (void)loadLivePhoto:(PHAsset *)asset;
- (void)stopPlayLivePhoto;
@end
//---------------video---------------
@interface ZLPreviewVideo : ZLBasePreviewView
@property (nonatomic, strong) AVPlayerLayer *playLayer;
@property (nonatomic, strong) UILabel *icloudLoadFailedLabel;
@property (nonatomic, strong) UIButton *playBtn;
- (BOOL)haveLoadVideo;
- (void)stopPlayVideo;
@end
//---------------net video---------------
@interface ZLPreviewNetVideo : ZLBasePreviewView
@property (nonatomic, strong) AVPlayerLayer *playLayer;
@property (nonatomic, strong) UIButton *playBtn;
- (void)loadNetVideo:(NSURL *)url;
- (void)seekToZero;
- (void)stopPlayNetVideo;
@end