猎豆优选

ZLBigImageCell.h 3.7KB

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