Archived
TintView -> CardView bc Amélie liked it
This commit is contained in:
@@ -11,4 +11,5 @@ import UIKit
|
||||
class MenuViewCell: GenericViewCell {
|
||||
|
||||
@IBOutlet weak var content: UILabel!
|
||||
@IBOutlet weak var tintView: UIView!
|
||||
}
|
||||
|
||||
+13
-12
@@ -19,31 +19,32 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="512" height="64"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="N1V-UC-51j">
|
||||
<rect key="frame" x="8" y="3" width="496" height="58"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LRg-M9-Mh9">
|
||||
<rect key="frame" x="24" y="16" width="464" height="32"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ve8-vV-g8Y">
|
||||
<rect key="frame" x="0.0" y="63" width="512" height="1"/>
|
||||
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
</subviews>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="ve8-vV-g8Y" secondAttribute="trailing" id="0ti-JN-3Z9"/>
|
||||
<constraint firstItem="LRg-M9-Mh9" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="16" id="5zo-M7-gZh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ve8-vV-g8Y" secondAttribute="bottom" id="AbT-cH-6Nh"/>
|
||||
<constraint firstAttribute="trailing" secondItem="LRg-M9-Mh9" secondAttribute="trailing" constant="24" id="Bsa-Fp-zBH"/>
|
||||
<constraint firstItem="ve8-vV-g8Y" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="WoG-wV-h6c"/>
|
||||
<constraint firstItem="LRg-M9-Mh9" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="24" id="bVa-ZP-z1d"/>
|
||||
<constraint firstItem="ve8-vV-g8Y" firstAttribute="top" secondItem="LRg-M9-Mh9" secondAttribute="bottom" constant="15" id="oLQ-A5-4UE"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LRg-M9-Mh9" secondAttribute="bottom" constant="16" id="yRL-dW-1Yd"/>
|
||||
<constraint firstAttribute="bottom" secondItem="N1V-UC-51j" secondAttribute="bottom" constant="3" id="3nw-d7-XiR"/>
|
||||
<constraint firstAttribute="trailing" secondItem="N1V-UC-51j" secondAttribute="trailing" constant="8" id="A1Z-9Q-9Ml"/>
|
||||
<constraint firstAttribute="bottom" secondItem="LRg-M9-Mh9" secondAttribute="bottom" constant="16" id="BQl-5y-Kbd"/>
|
||||
<constraint firstAttribute="trailing" secondItem="LRg-M9-Mh9" secondAttribute="trailing" constant="24" id="DoP-0U-FlU"/>
|
||||
<constraint firstItem="N1V-UC-51j" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="8" id="YuF-rT-aVt"/>
|
||||
<constraint firstItem="LRg-M9-Mh9" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="24" id="hqx-Nl-JGd"/>
|
||||
<constraint firstItem="N1V-UC-51j" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="3" id="jvc-rU-1zB"/>
|
||||
<constraint firstItem="LRg-M9-Mh9" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="16" id="ufU-ur-bME"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
|
||||
<connections>
|
||||
<outlet property="content" destination="LRg-M9-Mh9" id="aQ0-nX-edG"/>
|
||||
<outlet property="tintView" destination="N1V-UC-51j" id="TF0-hi-TU9"/>
|
||||
</connections>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
|
||||
@@ -71,11 +71,15 @@ class MenuViewController : UIViewController, UICollectionViewDataSource, UIColle
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath as IndexPath) as! MenuViewCell
|
||||
if self.items.count != 0 {
|
||||
cell.content.text = self.items[indexPath.item]
|
||||
}
|
||||
|
||||
cell.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
|
||||
cell.content.text = self.items[indexPath.item]
|
||||
cell.tintView.backgroundColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
let layer = cell.tintView.layer
|
||||
layer.cornerRadius = 12.0
|
||||
layer.shadowColor = UIColor.gray.cgColor
|
||||
layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
|
||||
layer.shadowRadius = 1.5
|
||||
layer.shadowOpacity = 0.7
|
||||
return cell
|
||||
}
|
||||
|
||||
|
||||
+11
-18
@@ -20,16 +20,16 @@
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ay1-0Z-yKh">
|
||||
<rect key="frame" x="0.0" y="0.0" width="512" height="108"/>
|
||||
<rect key="frame" x="8" y="3" width="496" height="102"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kVO-L1-w44">
|
||||
<rect key="frame" x="24" y="16" width="414" height="20.5"/>
|
||||
<rect key="frame" x="24" y="16" width="398" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="right" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="47e-N3-adl">
|
||||
<rect key="frame" x="446" y="16" width="42" height="20.5"/>
|
||||
<rect key="frame" x="430" y="16" width="42" height="20.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
@@ -41,33 +41,29 @@
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z2B-fh-0m1">
|
||||
<rect key="frame" x="446" y="44.5" width="42" height="21"/>
|
||||
<rect key="frame" x="430" y="44.5" width="42" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" ambiguous="YES" text="Label" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="F6T-RY-ZUE">
|
||||
<rect key="frame" x="24" y="73.5" width="414" height="18.5"/>
|
||||
<rect key="frame" x="24" y="73.5" width="414" height="12.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalCompressionResistancePriority="749" verticalCompressionResistancePriority="749" ambiguous="YES" text="Label" textAlignment="right" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Jed-sH-OKY">
|
||||
<rect key="frame" x="446" y="73.5" width="42" height="18.5"/>
|
||||
<rect key="frame" x="446" y="73.5" width="42" height="12.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BNy-Bm-Hfo">
|
||||
<rect key="frame" x="0.0" y="107" width="512" height="1"/>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="z2B-fh-0m1" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="vzu-WZ-FPo" secondAttribute="trailing" constant="8" id="3kU-Ww-Qcw"/>
|
||||
<constraint firstItem="47e-N3-adl" firstAttribute="top" secondItem="Ay1-0Z-yKh" secondAttribute="top" constant="16" id="5g6-Dx-f58"/>
|
||||
<constraint firstAttribute="trailing" secondItem="BNy-Bm-Hfo" secondAttribute="trailing" id="6ZJ-3c-6Eu"/>
|
||||
<constraint firstAttribute="bottom" secondItem="F6T-RY-ZUE" secondAttribute="bottom" constant="16" id="Ber-gU-iDm"/>
|
||||
<constraint firstAttribute="bottom" secondItem="F6T-RY-ZUE" secondAttribute="bottom" constant="16" id="CbT-RS-Wcv"/>
|
||||
<constraint firstItem="vzu-WZ-FPo" firstAttribute="leading" secondItem="Ay1-0Z-yKh" secondAttribute="leading" constant="24" id="E02-p0-1pW"/>
|
||||
<constraint firstItem="z2B-fh-0m1" firstAttribute="top" secondItem="kVO-L1-w44" secondAttribute="bottom" constant="8" id="FLB-1o-cei"/>
|
||||
@@ -79,16 +75,13 @@
|
||||
<constraint firstAttribute="trailing" secondItem="47e-N3-adl" secondAttribute="trailing" constant="24" id="d5g-l0-tid"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Jed-sH-OKY" secondAttribute="bottom" constant="16" id="di9-dn-Wfv"/>
|
||||
<constraint firstItem="vzu-WZ-FPo" firstAttribute="top" secondItem="kVO-L1-w44" secondAttribute="bottom" constant="8" id="fYW-HW-mSP"/>
|
||||
<constraint firstAttribute="bottom" secondItem="BNy-Bm-Hfo" secondAttribute="bottom" id="gZx-dG-A7M"/>
|
||||
<constraint firstItem="z2B-fh-0m1" firstAttribute="top" secondItem="47e-N3-adl" secondAttribute="bottom" constant="8" id="jFp-hu-mld"/>
|
||||
<constraint firstItem="BNy-Bm-Hfo" firstAttribute="leading" secondItem="Ay1-0Z-yKh" secondAttribute="leading" id="jLw-TQ-vvC"/>
|
||||
<constraint firstItem="Jed-sH-OKY" firstAttribute="top" secondItem="vzu-WZ-FPo" secondAttribute="bottom" constant="8" id="kKA-h5-ADN"/>
|
||||
<constraint firstItem="vzu-WZ-FPo" firstAttribute="top" relation="greaterThanOrEqual" secondItem="Ay1-0Z-yKh" secondAttribute="top" constant="44" id="mZr-e4-cwy"/>
|
||||
<constraint firstItem="47e-N3-adl" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="kVO-L1-w44" secondAttribute="trailing" constant="8" id="pGe-p1-Ger"/>
|
||||
<constraint firstItem="Jed-sH-OKY" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="F6T-RY-ZUE" secondAttribute="trailing" constant="8" id="ryb-w6-jie"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Jed-sH-OKY" secondAttribute="trailing" constant="24" id="uJx-Q7-VfS"/>
|
||||
<constraint firstItem="kVO-L1-w44" firstAttribute="top" secondItem="Ay1-0Z-yKh" secondAttribute="top" constant="16" id="vic-2C-ffY"/>
|
||||
<constraint firstItem="BNy-Bm-Hfo" firstAttribute="top" secondItem="F6T-RY-ZUE" secondAttribute="bottom" constant="15" id="yXT-rV-p1f"/>
|
||||
</constraints>
|
||||
<variation key="default">
|
||||
<mask key="constraints">
|
||||
@@ -99,10 +92,10 @@
|
||||
</subviews>
|
||||
</view>
|
||||
<constraints>
|
||||
<constraint firstItem="Ay1-0Z-yKh" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="744-5L-0Qa"/>
|
||||
<constraint firstItem="Ay1-0Z-yKh" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="8cn-Yd-wSj"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Ay1-0Z-yKh" secondAttribute="bottom" id="ABD-DY-ic9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ay1-0Z-yKh" secondAttribute="trailing" id="fuF-N9-caY"/>
|
||||
<constraint firstItem="Ay1-0Z-yKh" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="8" id="744-5L-0Qa"/>
|
||||
<constraint firstItem="Ay1-0Z-yKh" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="3" id="8cn-Yd-wSj"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Ay1-0Z-yKh" secondAttribute="bottom" constant="3" id="ABD-DY-ic9"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ay1-0Z-yKh" secondAttribute="trailing" constant="8" id="fuF-N9-caY"/>
|
||||
</constraints>
|
||||
<viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
|
||||
<connections>
|
||||
|
||||
@@ -96,8 +96,13 @@ class PlanViewController : UIViewController, UICollectionViewDataSource, UIColle
|
||||
let course = self.substs[indexPath.item].course
|
||||
var image = df.getImage(from: course)
|
||||
|
||||
cell.backgroundColor = self.df.getColour(for: course)
|
||||
cell.tintView.backgroundColor = cell.backgroundColor
|
||||
let layer = cell.tintView.layer
|
||||
layer.cornerRadius = 12.0
|
||||
layer.shadowColor = UIColor.gray.cgColor
|
||||
layer.shadowOffset = CGSize(width: 0.0, height: 0.0)
|
||||
layer.shadowRadius = 1.5
|
||||
layer.shadowOpacity = 0.7
|
||||
cell.tintView.backgroundColor = self.df.getColour(for: course)
|
||||
|
||||
let dateString = self.substs[indexPath.item].date
|
||||
if dateString.count > 2 && dateString[dateString.startIndex...dateString.index(dateString.startIndex, offsetBy: 2)] == "psa" {
|
||||
@@ -107,7 +112,6 @@ class PlanViewController : UIViewController, UICollectionViewDataSource, UIColle
|
||||
indexOfPSA = indexPath.item
|
||||
}
|
||||
image = UIImage(named: "ic_idea_w")
|
||||
cell.backgroundColor = #colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1)
|
||||
cell.tintView.backgroundColor = #colorLiteral(red: 0, green: 0.4784313725, blue: 1, alpha: 1)
|
||||
cell.group.textColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
cell.course.textColor = #colorLiteral(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0)
|
||||
|
||||
Reference in New Issue
Block a user