fix: update cell separator line height in pick server scene

This commit is contained in:
CMK 2021-06-16 14:24:19 +08:00
parent e49763a966
commit 9f17d5dffd
2 changed files with 18 additions and 18 deletions

View File

@ -115,11 +115,11 @@ extension PickServerSection {
guard let proxiedThumbnail = server.proxiedThumbnail,
let url = URL(string: proxiedThumbnail) else {
cell.thumbnailImageView.image = placeholderImage
cell.thumbnailActivityIdicator.stopAnimating()
cell.thumbnailActivityIndicator.stopAnimating()
return
}
cell.thumbnailImageView.isHidden = false
cell.thumbnailActivityIdicator.startAnimating()
cell.thumbnailActivityIndicator.startAnimating()
cell.thumbnailImageView.af.setImage(
withURL: url,
@ -129,7 +129,7 @@ extension PickServerSection {
completion: { [weak cell] response in
switch response.result {
case .success, .failure:
cell?.thumbnailActivityIdicator.stopAnimating()
cell?.thumbnailActivityIndicator.stopAnimating()
}
}
)

View File

@ -60,7 +60,7 @@ class PickServerCell: UITableViewCell {
return label
}()
let thumbnailActivityIdicator = UIActivityIndicatorView(style: .medium)
let thumbnailActivityIndicator = UIActivityIndicatorView(style: .medium)
let thumbnailImageView: UIImageView = {
let imageView = UIImageView()
@ -99,7 +99,7 @@ class PickServerCell: UITableViewCell {
return button
}()
let seperator: UIView = {
let separator: UIView = {
let view = UIView()
view.backgroundColor = Asset.Colors.Background.systemGroupedBackground.color
view.translatesAutoresizingMaskIntoConstraints = false
@ -177,7 +177,7 @@ class PickServerCell: UITableViewCell {
thumbnailImageView.isHidden = false
thumbnailImageView.af.cancelImageRequest()
thumbnailActivityIdicator.stopAnimating()
thumbnailActivityIndicator.stopAnimating()
disposeBag.removeAll()
}
@ -203,7 +203,7 @@ extension PickServerCell {
containerView.addSubview(domainLabel)
containerView.addSubview(checkbox)
containerView.addSubview(descriptionLabel)
containerView.addSubview(seperator)
containerView.addSubview(separator)
containerView.addSubview(expandButton)
@ -231,13 +231,13 @@ extension PickServerCell {
containerView.topAnchor.constraint(equalTo: contentView.topAnchor),
containerView.leadingAnchor.constraint(equalTo: contentView.readableContentGuide.leadingAnchor),
contentView.readableContentGuide.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),
contentView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: 1),
contentView.bottomAnchor.constraint(equalTo: containerView.bottomAnchor),
// Set bottom separator
seperator.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
containerView.trailingAnchor.constraint(equalTo: seperator.trailingAnchor),
containerView.topAnchor.constraint(equalTo: seperator.topAnchor),
seperator.heightAnchor.constraint(equalToConstant: 1).priority(.defaultHigh),
separator.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),
containerView.trailingAnchor.constraint(equalTo: separator.trailingAnchor),
containerView.topAnchor.constraint(equalTo: separator.topAnchor),
separator.heightAnchor.constraint(equalToConstant: 1).priority(.defaultHigh),
domainLabel.topAnchor.constraint(equalTo: containerView.layoutMarginsGuide.topAnchor),
domainLabel.leadingAnchor.constraint(equalTo: containerView.layoutMarginsGuide.leadingAnchor),
@ -272,14 +272,14 @@ extension PickServerCell {
containerView.layoutMarginsGuide.bottomAnchor.constraint(equalTo: expandButton.bottomAnchor),
])
thumbnailActivityIdicator.translatesAutoresizingMaskIntoConstraints = false
thumbnailImageView.addSubview(thumbnailActivityIdicator)
thumbnailActivityIndicator.translatesAutoresizingMaskIntoConstraints = false
thumbnailImageView.addSubview(thumbnailActivityIndicator)
NSLayoutConstraint.activate([
thumbnailActivityIdicator.centerXAnchor.constraint(equalTo: thumbnailImageView.centerXAnchor),
thumbnailActivityIdicator.centerYAnchor.constraint(equalTo: thumbnailImageView.centerYAnchor),
thumbnailActivityIndicator.centerXAnchor.constraint(equalTo: thumbnailImageView.centerXAnchor),
thumbnailActivityIndicator.centerYAnchor.constraint(equalTo: thumbnailImageView.centerYAnchor),
])
thumbnailActivityIdicator.hidesWhenStopped = true
thumbnailActivityIdicator.stopAnimating()
thumbnailActivityIndicator.hidesWhenStopped = true
thumbnailActivityIndicator.stopAnimating()
NSLayoutConstraint.activate(collapseConstraints)