|
@@ -5,6 +5,14 @@ class DocumentGalleryFileCell: UITableViewCell {
|
|
|
|
|
|
static let reuseIdentifier = "document_gallery_file_cell"
|
|
static let reuseIdentifier = "document_gallery_file_cell"
|
|
|
|
|
|
|
|
+ static var cellHeight: CGFloat {
|
|
|
|
+ let textHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize + UIFont.preferredFont(forTextStyle: .subheadline).pointSize + 24
|
|
|
|
+ if textHeight > 60 {
|
|
|
|
+ return textHeight
|
|
|
|
+ }
|
|
|
|
+ return 60
|
|
|
|
+ }
|
|
|
|
+
|
|
private let fileImageView: UIImageView = {
|
|
private let fileImageView: UIImageView = {
|
|
let imageView = UIImageView()
|
|
let imageView = UIImageView()
|
|
imageView.contentMode = .scaleAspectFit
|
|
imageView.contentMode = .scaleAspectFit
|
|
@@ -15,20 +23,21 @@ class DocumentGalleryFileCell: UITableViewCell {
|
|
let stackView = UIStackView(arrangedSubviews: [title, subtitle])
|
|
let stackView = UIStackView(arrangedSubviews: [title, subtitle])
|
|
stackView.axis = NSLayoutConstraint.Axis.vertical
|
|
stackView.axis = NSLayoutConstraint.Axis.vertical
|
|
stackView.translatesAutoresizingMaskIntoConstraints = false
|
|
stackView.translatesAutoresizingMaskIntoConstraints = false
|
|
- stackView.clipsToBounds = true
|
|
|
|
|
|
+ stackView.distribution = .fillProportionally
|
|
|
|
+ stackView.contentMode = .center
|
|
return stackView
|
|
return stackView
|
|
}()
|
|
}()
|
|
|
|
|
|
private lazy var title: UILabel = {
|
|
private lazy var title: UILabel = {
|
|
let title = UILabel()
|
|
let title = UILabel()
|
|
- title.font = UIFont.systemFont(ofSize: 16, weight: .regular)
|
|
|
|
|
|
+ title.font = UIFont.preferredFont(forTextStyle: .headline)
|
|
title.translatesAutoresizingMaskIntoConstraints = false
|
|
title.translatesAutoresizingMaskIntoConstraints = false
|
|
return title
|
|
return title
|
|
}()
|
|
}()
|
|
|
|
|
|
private lazy var subtitle: UILabel = {
|
|
private lazy var subtitle: UILabel = {
|
|
let subtitle = UILabel()
|
|
let subtitle = UILabel()
|
|
- subtitle.font = UIFont.italicSystemFont(ofSize: 12)
|
|
|
|
|
|
+ subtitle.font = UIFont.preferredItalicFont(for: .subheadline)
|
|
subtitle.translatesAutoresizingMaskIntoConstraints = false
|
|
subtitle.translatesAutoresizingMaskIntoConstraints = false
|
|
return subtitle
|
|
return subtitle
|
|
}()
|
|
}()
|
|
@@ -60,8 +69,8 @@ class DocumentGalleryFileCell: UITableViewCell {
|
|
fileImageView.widthAnchor.constraint(equalToConstant: 50).isActive = true
|
|
fileImageView.widthAnchor.constraint(equalToConstant: 50).isActive = true
|
|
stackView.constraintToTrailingOf(fileImageView, paddingLeading: 12).isActive = true
|
|
stackView.constraintToTrailingOf(fileImageView, paddingLeading: 12).isActive = true
|
|
stackView.constraintAlignTrailingTo(contentView, paddingTrailing: 12).isActive = true
|
|
stackView.constraintAlignTrailingTo(contentView, paddingTrailing: 12).isActive = true
|
|
- stackView.constraintAlignTopTo(contentView, paddingTop: 12).isActive = true
|
|
|
|
- stackView.constraintAlignBottomTo(contentView, paddingBottom: 12).isActive = true
|
|
|
|
|
|
+ stackView.constraintAlignTopTo(contentView, paddingTop: 6).isActive = true
|
|
|
|
+ stackView.constraintAlignBottomTo(contentView, paddingBottom: 6).isActive = true
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|