|
@@ -1,4 +1,5 @@
|
|
import UIKit
|
|
import UIKit
|
|
|
|
+import DcCore
|
|
|
|
|
|
public class QuoteView: UIView {
|
|
public class QuoteView: UIView {
|
|
lazy var citeBar: UIView = {
|
|
lazy var citeBar: UIView = {
|
|
@@ -12,15 +13,16 @@ public class QuoteView: UIView {
|
|
|
|
|
|
public lazy var quote: UILabel = {
|
|
public lazy var quote: UILabel = {
|
|
let view = UILabel()
|
|
let view = UILabel()
|
|
- view.font = UIFont.preferredFont(for: .caption1, weight: .regular)
|
|
|
|
|
|
+ view.font = UIFont.preferredFont(for: .caption2, weight: .light)
|
|
view.text = "quote"
|
|
view.text = "quote"
|
|
|
|
+ view.textColor = DcColors.grayTextColor
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
return view
|
|
return view
|
|
}()
|
|
}()
|
|
|
|
|
|
public lazy var senderTitle: UILabel = {
|
|
public lazy var senderTitle: UILabel = {
|
|
let view = UILabel()
|
|
let view = UILabel()
|
|
- view.font = UIFont.preferredFont(for: .caption1, weight: .bold)
|
|
|
|
|
|
+ view.font = UIFont.preferredFont(for: .caption2, weight: .semibold)
|
|
view.text = "title"
|
|
view.text = "title"
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
view.translatesAutoresizingMaskIntoConstraints = false
|
|
return view
|
|
return view
|
|
@@ -41,12 +43,12 @@ public class QuoteView: UIView {
|
|
addSubview(quote)
|
|
addSubview(quote)
|
|
|
|
|
|
addConstraints([
|
|
addConstraints([
|
|
- senderTitle.constraintAlignTopTo(self, paddingTop: 4),
|
|
|
|
|
|
+ senderTitle.constraintAlignTopTo(self),
|
|
senderTitle.constraintAlignLeadingTo(self, paddingLeading: 24),
|
|
senderTitle.constraintAlignLeadingTo(self, paddingLeading: 24),
|
|
- senderTitle.constraintAlignTrailingTo(self, paddingTrailing: 4),
|
|
|
|
|
|
+ senderTitle.constraintAlignTrailingTo(self, paddingTrailing: 8),
|
|
quote.constraintAlignLeadingTo(self, paddingLeading: 24),
|
|
quote.constraintAlignLeadingTo(self, paddingLeading: 24),
|
|
quote.constraintToBottomOf(senderTitle),
|
|
quote.constraintToBottomOf(senderTitle),
|
|
- quote.constraintAlignTrailingTo(self, paddingTrailing: 4),
|
|
|
|
|
|
+ quote.constraintAlignTrailingTo(self, paddingTrailing: 8),
|
|
quote.constraintAlignBottomTo(self, paddingBottom: 4),
|
|
quote.constraintAlignBottomTo(self, paddingBottom: 4),
|
|
citeBar.constraintAlignLeadingTo(self, paddingLeading: 16),
|
|
citeBar.constraintAlignLeadingTo(self, paddingLeading: 16),
|
|
citeBar.constraintAlignTopTo(senderTitle, paddingTop: 4),
|
|
citeBar.constraintAlignTopTo(senderTitle, paddingTop: 4),
|
|
@@ -54,4 +56,11 @@ public class QuoteView: UIView {
|
|
citeBar.constraintWidthTo(3)
|
|
citeBar.constraintWidthTo(3)
|
|
])
|
|
])
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public func prepareForReuse() {
|
|
|
|
+ quote.text = nil
|
|
|
|
+ quote.attributedText = nil
|
|
|
|
+ senderTitle.text = nil
|
|
|
|
+ senderTitle.attributedText = nil
|
|
|
|
+ }
|
|
}
|
|
}
|