|
@@ -70,6 +70,8 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
// 视频播放
|
|
|
addSubview(videoPlayView)
|
|
|
videoPlayView.addTapGesture(1, target: self, action: #selector(videoTapAction))
|
|
|
+ addSubview(bottomSepView)
|
|
|
+ addSubview(bgView)
|
|
|
|
|
|
// 顶部渐变
|
|
|
addSubview(topGradientView)
|
|
@@ -86,7 +88,6 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
|
|
|
// 底部
|
|
|
bottomGradientView.addSubview(bottomCommentView)
|
|
|
- bottomCommentView.addSubview(bottomSepView)
|
|
|
bottomCommentView.addSubview(commentBtn)
|
|
|
bottomCommentView.addSubview(collectBtn)
|
|
|
bottomCommentView.addSubview(likeBtn)
|
|
@@ -156,8 +157,9 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
make.height.equalTo(60)
|
|
|
}
|
|
|
bottomSepView.snp.makeConstraints { (make) in
|
|
|
- make.top.left.right.equalToSuperview()
|
|
|
- make.height.equalTo(1)
|
|
|
+ make.left.right.equalToSuperview()
|
|
|
+ make.height.equalTo(0.5)
|
|
|
+ make.bottom.equalToSuperview().offset(-(kSafeTabBarHeight + 60))
|
|
|
}
|
|
|
|
|
|
commentBtn.snp.makeConstraints { (make) in
|
|
@@ -185,7 +187,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
make.centerY.equalToSuperview()
|
|
|
make.left.equalToSuperview().offset(14)
|
|
|
make.right.equalTo(likeBtn.snp_left).offset(-10)
|
|
|
- make.height.equalTo(28)
|
|
|
+ make.height.equalTo(30)
|
|
|
}
|
|
|
commentLabel.snp.makeConstraints { (make) in
|
|
|
make.left.equalTo(15)
|
|
@@ -361,6 +363,13 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
contentLabel.attributedText = attri
|
|
|
}
|
|
|
|
|
|
+ lazy var bgView: UIView = {
|
|
|
+ let bgView = UIView(frame: self.frame)
|
|
|
+ bgView.backgroundColor = UIColor(hexString: "000000", alpha: 0.1)
|
|
|
+ bgView.isUserInteractionEnabled = true
|
|
|
+ return bgView
|
|
|
+ }()
|
|
|
+
|
|
|
// MARK: 视频播放View
|
|
|
private lazy var videoPlayView: CommunityVideoPlayView = {
|
|
|
let videoPlayView = CommunityVideoPlayView()
|
|
@@ -377,16 +386,26 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
bgLayer1.colors = [UIColor(red: 0, green: 0, blue: 0, alpha: 0.5).cgColor, UIColor(red: 0, green: 0, blue: 0, alpha: 0).cgColor]
|
|
|
bgLayer1.locations = [0, 1]
|
|
|
bgLayer1.frame = topGradientView.bounds
|
|
|
- bgLayer1.startPoint = CGPoint(x: 0.5, y: 0)
|
|
|
- bgLayer1.endPoint = CGPoint(x: 1, y: 1)
|
|
|
+ bgLayer1.startPoint = CGPoint(x: 0, y: 0)
|
|
|
+ bgLayer1.endPoint = CGPoint(x: 0, y: 1)
|
|
|
topGradientView.layer.addSublayer(bgLayer1)
|
|
|
+ topGradientView.layer.cornerRadius = 2;
|
|
|
+ topGradientView.alpha = 1
|
|
|
return topGradientView
|
|
|
}()
|
|
|
|
|
|
private lazy var bottomGradientView: UIView = {
|
|
|
let bottomGradientView = UIView()
|
|
|
bottomGradientView.frame = CGRect(x: 0, y: kScreenHeight-kSafeTabBarHeight-270, width: kScreenWidth, height: 270+kSafeTabBarHeight)
|
|
|
- bottomGradientView.backgroundColor = kRGBAColor(r: 0, g: 0, b: 0, a: 0.4)
|
|
|
+ let bgLayer1 = CAGradientLayer()
|
|
|
+ bgLayer1.colors = [UIColor(red: 0, green: 0, blue: 0, alpha: 0.8).cgColor, UIColor(red: 0, green: 0, blue: 0, alpha: 0).cgColor]
|
|
|
+ bgLayer1.locations = [0, 1]
|
|
|
+ bgLayer1.frame = bottomGradientView.bounds
|
|
|
+ bgLayer1.startPoint = CGPoint(x: 0, y: 1)
|
|
|
+ bgLayer1.endPoint = CGPoint(x: 0, y: 0)
|
|
|
+ bottomGradientView.layer.addSublayer(bgLayer1)
|
|
|
+ bottomGradientView.layer.cornerRadius = 2;
|
|
|
+ bottomGradientView.alpha = 1
|
|
|
return bottomGradientView
|
|
|
}()
|
|
|
|
|
@@ -443,7 +462,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
|
|
|
private lazy var bottomSepView: UIView = {
|
|
|
let bottomSepView = UIView()
|
|
|
- bottomSepView.backgroundColor = kDDDDDDColor
|
|
|
+ bottomSepView.backgroundColor = kffffffColor.withAlphaComponent(0.8)
|
|
|
return bottomSepView
|
|
|
}()
|
|
|
|
|
@@ -513,7 +532,7 @@ class CommunityVideoCoverCollectionCell: UICollectionViewCell {
|
|
|
|
|
|
private lazy var commentView: UIView = {
|
|
|
let commentView = UIView()
|
|
|
- commentView.backgroundColor = kRGBAColor(r: 0/255.0, g: 0/255.0, b: 0/255.0, a: 0.3)
|
|
|
+ commentView.backgroundColor = kffffffColor.withAlphaComponent(0.3)
|
|
|
commentView.cornerRadius = 15
|
|
|
commentView.masksToBounds = true
|
|
|
return commentView
|