diff --git a/enzevalos_iphone/AppDelegate.swift b/enzevalos_iphone/AppDelegate.swift index 99cdb28905e183af4359b7a4ba02c1dfc03dfe38..553f9a4a05ea89107261723fafeb3e06eb532404 100644 --- a/enzevalos_iphone/AppDelegate.swift +++ b/enzevalos_iphone/AppDelegate.swift @@ -130,6 +130,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { }); } } + + func showBadgeCase() { + self.window?.rootViewController = UIHostingController(rootView: BadgeCaseView()) + } // Option removed from Settings app, but this might still be usefull in the future func resetApp() { diff --git a/enzevalos_iphone/BadgeCaseView.swift b/enzevalos_iphone/BadgeCaseView.swift index b1f6605baea4a4bc43606556fa07c7305fecbf76..68de1152eb6103545e7b51bc651e6e8844920985 100644 --- a/enzevalos_iphone/BadgeCaseView.swift +++ b/enzevalos_iphone/BadgeCaseView.swift @@ -11,7 +11,6 @@ import SwiftUI struct BadgeCaseView: View { init() { UITableView.appearance().separatorStyle = .none -// UINavigationBar.size } let badges: [Badge] = GamificationData.sharedInstance.badges.map { Badge(type: $0.type, description: $0.displayName, imageOn: $0.onName, imageOff: $0.offName) } @@ -77,7 +76,7 @@ struct BadgeItem: View { .frame(width: 40,height: 40) .padding(10) Text(self.badgeTitle) - }.onTapGesture(perform: { print("hi") }) + } } } diff --git a/enzevalos_iphone/Base.lproj/Main.storyboard b/enzevalos_iphone/Base.lproj/Main.storyboard index 098d7ee0a1d687b87a336f27c3356be034f9faf9..c999a67490292023abcde9c6ec474db04c0b7b94 100644 --- a/enzevalos_iphone/Base.lproj/Main.storyboard +++ b/enzevalos_iphone/Base.lproj/Main.storyboard @@ -1228,14 +1228,14 @@ <segue destination="olx-gF-WdV" kind="presentation" identifier="newMail" id="3Wb-uL-BB5"/> </connections> </tableViewCell> - <tableViewCell hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="BadgeCaseCell" textLabel="W4e-hv-Sye" style="IBUITableViewCellStyleDefault" id="jQz-hn-5EU"> + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="AllMails" textLabel="VTZ-4w-fot" style="IBUITableViewCellStyleDefault" id="dM9-jb-EcN"> <rect key="frame" x="0.0" y="677.33333206176758" width="414" height="44"/> <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="jQz-hn-5EU" id="uhD-6F-ygC"> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dM9-jb-EcN" id="tvN-re-z1Z"> <rect key="frame" x="0.0" y="0.0" width="383" height="44"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Your Badges" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="W4e-hv-Sye"> + <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="VTZ-4w-fot"> <rect key="frame" x="20" y="0.0" width="355" height="44"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> @@ -1245,17 +1245,17 @@ </subviews> </tableViewCellContentView> <connections> - <segue destination="P4g-mj-QaO" kind="show" id="lfF-X0-wb5"/> + <segue destination="ooe-0X-glz" kind="show" identifier="mailList" id="D6m-L0-5AB"/> </connections> </tableViewCell> - <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="AllMails" textLabel="VTZ-4w-fot" style="IBUITableViewCellStyleDefault" id="dM9-jb-EcN"> + <tableViewCell hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="BadgeCaseCell" textLabel="W4e-hv-Sye" style="IBUITableViewCellStyleDefault" id="jQz-hn-5EU"> <rect key="frame" x="0.0" y="721.33333206176758" width="414" height="44"/> <autoresizingMask key="autoresizingMask"/> - <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="dM9-jb-EcN" id="tvN-re-z1Z"> + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="jQz-hn-5EU" id="uhD-6F-ygC"> <rect key="frame" x="0.0" y="0.0" width="383" height="44"/> <autoresizingMask key="autoresizingMask"/> <subviews> - <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="VTZ-4w-fot"> + <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Your Badges" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="W4e-hv-Sye"> <rect key="frame" x="20" y="0.0" width="355" height="44"/> <autoresizingMask key="autoresizingMask"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> @@ -1264,9 +1264,6 @@ </label> </subviews> </tableViewCellContentView> - <connections> - <segue destination="ooe-0X-glz" kind="show" identifier="mailList" id="D6m-L0-5AB"/> - </connections> </tableViewCell> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="KeyCell" id="Lke-0s-P0i" userLabel="KeyCell"> <rect key="frame" x="0.0" y="765.33333206176758" width="414" height="44"/> @@ -1345,14 +1342,14 @@ <viewControllerPlaceholder storyboardName="BadgeCase" id="P4g-mj-QaO" sceneMemberID="viewController"/> <placeholder placeholderIdentifier="IBFirstResponder" id="9L5-VV-4Lz" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> - <point key="canvasLocation" x="860" y="958"/> + <point key="canvasLocation" x="320" y="1047"/> </scene> <!--Key View Controller--> <scene sceneID="oZj-u6-2pU"> <objects> <viewController id="jYD-fk-aIP" customClass="KeyViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="18" sectionFooterHeight="18" id="ZAH-bZ-S6n"> - <rect key="frame" x="0.0" y="0.0" width="414" height="786"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <edgeInsets key="layoutMargins" top="10" left="20" bottom="10" right="20"/> @@ -1535,7 +1532,7 @@ <objects> <tableViewController storyboardIdentifier="exportInfoViewController" id="7Pd-d5-0wz" customClass="ExportInfoViewController" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" dataMode="prototypes" style="grouped" separatorStyle="default" sectionIndexMinimumDisplayRowCount="1" rowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="2Uv-bd-pB1"> - <rect key="frame" x="0.0" y="0.0" width="414" height="786"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/> <prototypes> @@ -1788,14 +1785,14 @@ Um deine sicheren E-Mails auch auf einem anderen Gerät lesen zu können, muss d <objects> <viewController id="86r-Nd-UBB" customClass="QRScannerView" customModule="enzevalos_iphone" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="sqq-s3-zif"> - <rect key="frame" x="0.0" y="0.0" width="414" height="842"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <view contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nMw-DD-7LP" userLabel="TopBar"> - <rect key="frame" x="0.0" y="0.0" width="414" height="32"/> + <rect key="frame" x="0.0" y="0.0" width="414" height="76"/> <subviews> <button opaque="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="w9U-eC-Koh"> - <rect key="frame" x="8" y="-8.3333333333333339" width="30" height="38.333333333333336"/> + <rect key="frame" x="8" y="36" width="30" height="38"/> <fontDescription key="fontDescription" type="system" weight="heavy" pointSize="21"/> <state key="normal" title="✕"> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> @@ -1805,7 +1802,7 @@ Um deine sicheren E-Mails auch auf einem anderen Gerät lesen zu können, muss d </connections> </button> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" insetsLayoutMarginsFromSafeArea="NO" text="Kontakt verifizieren" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="25l-XT-PFo"> - <rect key="frame" x="116.33333333333333" y="-2.3333333333333339" width="181.66666666666669" height="26.333333333333336"/> + <rect key="frame" x="116.33333333333333" y="41.666666666666664" width="181.66666666666669" height="26.333333333333336"/> <fontDescription key="fontDescription" style="UICTFontTextStyleTitle2"/> <color key="textColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <nil key="highlightedColor"/> @@ -1819,7 +1816,7 @@ Um deine sicheren E-Mails auch auf einem anderen Gerät lesen zu können, muss d </constraints> </view> <view contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ukS-99-lnz" userLabel="BottomBar"> - <rect key="frame" x="0.0" y="771.66666666666663" width="414" height="70.333333333333371"/> + <rect key="frame" x="0.0" y="825.66666666666663" width="414" height="70.333333333333371"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" insetsLayoutMarginsFromSafeArea="NO" text="Scanne den QR Code des Kontaktes" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ysO-xv-18D"> <rect key="frame" x="68.666666666666657" y="7.9999999999999982" width="276.66666666666674" height="20.333333333333329"/> diff --git a/enzevalos_iphone/ContactViewController.swift b/enzevalos_iphone/ContactViewController.swift index b97762884535ca267ef841a1165ef0941a633f6a..d3d4e22c1553d7f8f9384320820ce79a58590ba6 100644 --- a/enzevalos_iphone/ContactViewController.swift +++ b/enzevalos_iphone/ContactViewController.swift @@ -536,7 +536,7 @@ extension ContactViewController: UITableViewDataSource { let badgeCell = tableView.dequeueReusableCell(withIdentifier: "BadgeCaseCell", for: indexPath) badgeCell.detailTextLabel?.text = NSLocalizedString("YourBadges", comment: "") if StudySettings.hideBadges { - badgeCell.isHidden = true + badgeCell.isHidden = false } return badgeCell case 6 where isUser: @@ -646,6 +646,13 @@ extension ContactViewController: UITableViewDelegate { UIPasteboard.general.string = keyRecord!.ezContact.getMailAddresses()[indexPath.row].mailAddress } } + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + let BADGE_CASE_CELL_ROW = 5 + if indexPath.section == BADGE_CASE_CELL_ROW { + AppDelegate.getAppDelegate().showBadgeCase() + } + } } extension ContactViewController: UINavigationControllerDelegate {