<commit_before>import UIKit

class ShareAFactViewController: UIViewController {

    @IBOutlet weak var articleTitleLabel: UILabel!
    @IBOutlet weak var imageView: UIImageView!
    @IBOutlet weak var backgroundImageView: UIImageView!
    @IBOutlet weak var separatorView: UIView!
    @IBOutlet weak var imageContainerView: UIView!
    @IBOutlet weak var textLabel: UILabel!
    @IBOutlet weak var articleLicenseView: LicenseView!
    @IBOutlet weak var imageLicenseView: LicenseView!
    @IBOutlet weak var imageGradientView: WMFGradientView!

    @IBOutlet weak var imageWordmarkView: UIImageView!
    @IBOutlet weak var imageMadeWithLabel: UILabel!
    
    @IBOutlet weak var textWordmarkView: UIImageView!
    @IBOutlet weak var textMadeWithLabel: UILabel!
    
    @IBOutlet weak var articleTitleTrailingToTextWordmarkConstraint: NSLayoutConstraint!
    
    
    @IBOutlet weak var imageMadeWithLabelBottomConstraint: NSLayoutConstraint!
    
    @IBOutlet weak var imageViewTrailingConstraint: NSLayoutConstraint!
    @IBOutlet weak var imageViewWidthConstraint: NSLayoutConstraint!
    
    @IBOutlet var imageViewLetterboxConstraints: [NSLayoutConstraint]!
    
    override func viewDidLoad() {
        let theme = Theme.standard //always use the standard theme for now
        view.backgroundColor = theme.colors.paperBackground
        articleTitleLabel.textColor = theme.colors.primaryText
        separatorView.backgroundColor = theme.colors.border
        textLabel.textColor = theme.colors.primaryText
        articleLicenseView.tintColor = theme.colors.secondaryText
        imageLicenseView.tintColor = .white
        
        textMadeWithLabel.text = WMFLocalizedString("share-a-fact-made-with", value: "Made with the Wikipedia app", comment: "Indicates that the share-a-fact card was made with the Wikipedia app")
        imageMadeWithLabel.text = textMadeWithLabel.text
        
        imageGradientView.gradientLayer.colors = [UIColor.clear.cgColor, UIColor(white: 0, alpha: 0.1).cgColor, UIColor(white: 0, alpha: 0.4).cgColor]
        imageGradientView.gradientLayer.locations = [NSNumber(value: 0.0), NSNumber(value: 0.5), NSNumber(value: 1.0)]
        imageGradientView.gradientLayer.startPoint = CGPoint(x: 0.5, y: 0)
        imageGradientView.gradientLayer.endPoint = CGPoint(x: 0.5, y: 1)
    }
    
    public func update(with articleURL: URL, articleTitle: String?, text: String?, image: UIImage?, imageLicense: MWKLicense?) {
        view.semanticContentAttribute = MWLanguageInfo.semanticContentAttribute(forWMFLanguage: articleURL.wmf_language)
        textLabel.semanticContentAttribute = view.semanticContentAttribute
        articleTitleLabel.semanticContentAttribute = view.semanticContentAttribute
        imageContainerView.semanticContentAttribute = view.semanticContentAttribute
        imageLicenseView.semanticContentAttribute = view.semanticContentAttribute
        articleLicenseView.semanticContentAttribute = view.semanticContentAttribute
        let text = text ?? ""
        imageView.image = image
        isImageViewHidden = image == nil
        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.lineSpacing = 3
        textLabel.attributedText = NSAttributedString(string: text, attributes: [NSAttributedStringKey.paragraphStyle: paragraphStyle])
        textLabel.font = UIFont.systemFont(ofSize: 18, weight: .medium)
        let width = isImageViewHidden ? view.bounds.size.width : round(0.5 * view.bounds.size.width)
        let size = textLabel.sizeThatFits(CGSize(width: width, height: view.bounds.size.height))
        if size.height > 0.6 * view.bounds.size.height {
            textLabel.font = UIFont.systemFont(ofSize: 14)
            textLabel.attributedText = nil // without this line, the ellipsis wasn't being added at the end of the truncated text
            textLabel.text = text
        }
        articleTitleLabel.text = articleTitle
        
        let codes: [String] = imageLicense?.code?.lowercased().components(separatedBy: "-") ?? []

        if codes.count == 0 {<commit_msg>update font size to 20<commit_after>import UIKit

class ShareAFactViewController: UIViewController {

    @IBOutlet weak var articleTitleLabel: UILabel!
    @IBOutlet weak var imageView: UIImageView!
    @IBOutlet weak var backgroundImageView: UIImageView!
    @IBOutlet weak var separatorView: UIView!
    @IBOutlet weak var imageContainerView: UIView!
    @IBOutlet weak var textLabel: UILabel!
    @IBOutlet weak var articleLicenseView: LicenseView!
    @IBOutlet weak var imageLicenseView: LicenseView!
    @IBOutlet weak var imageGradientView: WMFGradientView!

    @IBOutlet weak var imageWordmarkView: UIImageView!
    @IBOutlet weak var imageMadeWithLabel: UILabel!
    
    @IBOutlet weak var textWordmarkView: UIImageView!
    @IBOutlet weak var textMadeWithLabel: UILabel!
    
    @IBOutlet weak var articleTitleTrailingToTextWordmarkConstraint: NSLayoutConstraint!
    
    
    @IBOutlet weak var imageMadeWithLabelBottomConstraint: NSLayoutConstraint!
    
    @IBOutlet weak var imageViewTrailingConstraint: NSLayoutConstraint!
    @IBOutlet weak var imageViewWidthConstraint: NSLayoutConstraint!
    
    @IBOutlet var imageViewLetterboxConstraints: [NSLayoutConstraint]!
    
    override func viewDidLoad() {
        let theme = Theme.standard //always use the standard theme for now
        view.backgroundColor = theme.colors.paperBackground
        articleTitleLabel.textColor = theme.colors.primaryText
        separatorView.backgroundColor = theme.colors.border
        textLabel.textColor = theme.colors.primaryText
        articleLicenseView.tintColor = theme.colors.secondaryText
        imageLicenseView.tintColor = .white
        
        textMadeWithLabel.text = WMFLocalizedString("share-a-fact-made-with", value: "Made with the Wikipedia app", comment: "Indicates that the share-a-fact card was made with the Wikipedia app")
        imageMadeWithLabel.text = textMadeWithLabel.text
        
        imageGradientView.gradientLayer.colors = [UIColor.clear.cgColor, UIColor(white: 0, alpha: 0.1).cgColor, UIColor(white: 0, alpha: 0.4).cgColor]
        imageGradientView.gradientLayer.locations = [NSNumber(value: 0.0), NSNumber(value: 0.5), NSNumber(value: 1.0)]
        imageGradientView.gradientLayer.startPoint = CGPoint(x: 0.5, y: 0)
        imageGradientView.gradientLayer.endPoint = CGPoint(x: 0.5, y: 1)
    }
    
    public func update(with articleURL: URL, articleTitle: String?, text: String?, image: UIImage?, imageLicense: MWKLicense?) {
        view.semanticContentAttribute = MWLanguageInfo.semanticContentAttribute(forWMFLanguage: articleURL.wmf_language)
        textLabel.semanticContentAttribute = view.semanticContentAttribute
        articleTitleLabel.semanticContentAttribute = view.semanticContentAttribute
        imageContainerView.semanticContentAttribute = view.semanticContentAttribute
        imageLicenseView.semanticContentAttribute = view.semanticContentAttribute
        articleLicenseView.semanticContentAttribute = view.semanticContentAttribute
        let text = text ?? ""
        imageView.image = image
        isImageViewHidden = image == nil
        let paragraphStyle = NSMutableParagraphStyle()
        paragraphStyle.lineSpacing = 7
        textLabel.attributedText = NSAttributedString(string: text, attributes: [NSAttributedStringKey.paragraphStyle: paragraphStyle])
        textLabel.font = UIFont.systemFont(ofSize: 20, weight: .medium)
        let width = isImageViewHidden ? view.bounds.size.width : round(0.5 * view.bounds.size.width)
        let size = textLabel.sizeThatFits(CGSize(width: width, height: view.bounds.size.height))
        if size.height > 0.6 * view.bounds.size.height {
            textLabel.font = UIFont.systemFont(ofSize: 14)
            textLabel.attributedText = nil // without this line, the ellipsis wasn't being added at the end of the truncated text
            textLabel.text = text
        }
        articleTitleLabel.text = articleTitle
        
        let codes: [String] = imageLicense?.code?.lowercased().components(separatedBy: "-") ?? []

        if codes.count == 0 {
{'fraction_non_alphanumeric': 0.07913757197108906, 'fraction_numerical': 0.0071052309200049, 'mean_word_length': 3.6892590465249855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4814199', 'n_tokens_mistral': 2335, 'n_tokens_neox': 2220, 'n_words': 534}