-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #331 from SaurabhJamadagni/gsoc23-menu
Privacy policy text in About section
- Loading branch information
Showing
12 changed files
with
282 additions
and
462 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// InformationScreenVC.swift | ||
// | ||
|
||
import UIKit | ||
|
||
class InformationScreenVC: UIViewController { | ||
@IBOutlet var headingLabel: UILabel! | ||
@IBOutlet var textView: UITextView! | ||
@IBOutlet var scrollContainerView: UIView! | ||
@IBOutlet var contentContainerView: UIView! | ||
|
||
@IBOutlet var cornerImageView: UIImageView! | ||
@IBOutlet var iconImageView: UIImageView! | ||
|
||
var text: String = "" | ||
var screenTitle: String = "" | ||
var section: SectionState = .privacyPolicy | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
|
||
setupInformationPageUI() | ||
|
||
if section == .privacyPolicy { | ||
setupPrivacyPolicyPage() | ||
} | ||
} | ||
|
||
func setupInformationPageUI() { | ||
scrollContainerView.backgroundColor = .clear | ||
|
||
textView.backgroundColor = UIColor(named: "commandBar") | ||
contentContainerView.backgroundColor = UIColor(named: "commandBar") | ||
applyCornerRadius(elem: contentContainerView, radius: contentContainerView.frame.width * 0.05) | ||
applyShadowEffects(elem: contentContainerView) | ||
|
||
cornerImageView.clipsToBounds = true | ||
contentContainerView.clipsToBounds = true | ||
|
||
textView.isEditable = false | ||
} | ||
|
||
func setupPrivacyPolicyPage() { | ||
switch Locale.userSystemLanguage { | ||
case "EN": | ||
navigationItem.title = enPrivacyPolicyTitle | ||
headingLabel.attributedText = NSMutableAttributedString( | ||
string: enPrivacyPolicyPageCaption, | ||
attributes: [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: fontSize * 1.2)] | ||
) | ||
textView.attributedText = setPrivacyPolicy(fontSize: fontSize, text: enPrivacyPolicyText) | ||
case "DE": | ||
navigationItem.title = dePrivacyPolicyTitle | ||
headingLabel.attributedText = NSMutableAttributedString( | ||
string: dePrivacyPolicyPageCaption, | ||
attributes: [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: fontSize * 1.2)] | ||
) | ||
textView.attributedText = setPrivacyPolicy(fontSize: fontSize, text: dePrivacyPolicyText) | ||
|
||
default: | ||
navigationItem.title = enPrivacyPolicyTitle | ||
headingLabel.attributedText = NSMutableAttributedString( | ||
string: enPrivacyPolicyPageCaption, | ||
attributes: [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: fontSize * 1.2)] | ||
) | ||
textView.attributedText = setPrivacyPolicy(fontSize: fontSize, text: enPrivacyPolicyText) | ||
} | ||
textView.textColor = keyCharColor | ||
iconImageView.image = UIImage(systemName: "lock.shield") | ||
iconImageView.tintColor = keyCharColor | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.