Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4935 from corona-warn-app/fix/10243-layout-of-war…
Browse files Browse the repository at this point in the history
…n-on-behalf

Fix/10243 layout of warn on behalf
  • Loading branch information
flxschmidt authored Dec 16, 2022
2 parents 12fdcf9 + 3234c35 commit 562e628
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,17 @@ class DynamicTypeTableViewCell: UITableViewCell, DynamicTableViewTextCell {

func configureAccessibility(label: String? = nil, identifier: String? = nil, traits: UIAccessibilityTraits = .staticText) {
contentTextLabel.accessibilityLabel = label
contentTextLabel.isAccessibilityElement = true
accessibilityIdentifier = identifier
accessibilityTraits = traits
}

func configureTapGesture() {
let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(labelTapped))
contentTextLabel.addGestureRecognizer(tapGestureRecognizer)
contentTextLabel.isUserInteractionEnabled = true
contentTextLabel.isAccessibilityElement = true
}

// MARK: - Internal

Expand Down Expand Up @@ -88,4 +96,10 @@ class DynamicTypeTableViewCell: UITableViewCell, DynamicTableViewTextCell {
contentView.layoutMargins = UIEdgeInsets(top: 8, left: 16, bottom: 8, right: 16)
contentView.insetsLayoutMarginsFromSafeArea = false
}

@objc
private func labelTapped() {
contentTextLabel.adjustsFontSizeToFitWidth = true
contentTextLabel.numberOfLines = 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,10 @@ class OnBehalfTraceLocationSelectionViewController: UITableViewController, Dismi
style: style.textStyle
)

cell.contentTextLabel.lineBreakMode = .byTruncatingTail
cell.contentTextLabel.numberOfLines = 4
cell.configureAccessibility()
cell.configureTapGesture()

return cell
}
Expand Down

0 comments on commit 562e628

Please sign in to comment.