|
@@ -62,8 +62,17 @@ class BFIndirectionProgressView: UIView {
|
|
|
vv.removeFromSuperview()
|
|
|
}
|
|
|
|
|
|
+ var lastM : PQVoiceModel?
|
|
|
+ var lastv : BFThumImageView?
|
|
|
items?.forEach { [weak self] model in
|
|
|
- _ = createItemView(minX: model.startCMTime.seconds * CGFloat(self?.percenWidth ?? 0), width: (model.endCMTime.seconds - model.startCMTime.seconds) * CGFloat(self?.percenWidth ?? 0))
|
|
|
+
|
|
|
+ let v = createItemView(minX: model.startCMTime.seconds * CGFloat(self?.percenWidth ?? 0), width: (model.endCMTime.seconds - model.startCMTime.seconds) * CGFloat(self?.percenWidth ?? 0))
|
|
|
+// BFLog(1, message: "equ:\((lastM?.endCMTime ?? .zero).seconds), \(model.startCMTime.seconds), \(CMTimeCompare(lastM?.endCMTime ?? .zero, model.startCMTime) < 0 ? "==" : "!=")")
|
|
|
+ if let lastM = lastM, CMTimeCompare(lastM.endCMTime, model.startCMTime) < 0 {
|
|
|
+ lastv?.isHiddenBord = true
|
|
|
+ }
|
|
|
+ lastM = model
|
|
|
+ lastv = v
|
|
|
}
|
|
|
(subviews.last as? BFThumImageView)?.isHiddenBord = true
|
|
|
}
|
|
@@ -77,7 +86,7 @@ class BFIndirectionProgressView: UIView {
|
|
|
if start.seconds * percenWidth >= frame.width {
|
|
|
frame.size.width = (superview as? UIScrollView)?.contentSize.width ?? 0
|
|
|
}
|
|
|
- BFLog(1, message: "\(frame.size.width)")
|
|
|
+
|
|
|
detectionAndCreateItem(start: start, progress: progress)
|
|
|
if let currentItem = currentItem {
|
|
|
let oldwidth = currentItem.frame.width
|
|
@@ -100,7 +109,17 @@ class BFIndirectionProgressView: UIView {
|
|
|
if currentItem == nil {
|
|
|
deletedView = nil
|
|
|
// subviews[curr]
|
|
|
- currentItem = detectionItem(start: start, progress: progress)
|
|
|
+ currentItem = createItemView(minX: start.seconds * percenWidth)
|
|
|
+ if subviews.count > 1 {
|
|
|
+ let vvs = subviews.sorted { v1, v2 in
|
|
|
+ v1.rightX < v2.rightX
|
|
|
+ }
|
|
|
+ if let lastv = vvs.last(where: { vv in
|
|
|
+ (vv != currentItem) && abs(vv.rightX - currentItem!.x) < 0.01
|
|
|
+ }) as? BFThumImageView {
|
|
|
+ lastv.isHiddenBord = false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|