зеркало из https://github.com/nextcloud/talk-ios.git
Fix code style and naming
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Родитель
140aff2f05
Коммит
d54dee1c00
|
@ -26,7 +26,7 @@ import Foundation
|
|||
@IBOutlet var contentView: UIView!
|
||||
@IBOutlet weak var referenceTypeIcon: UIImageView!
|
||||
@IBOutlet weak var referenceTitle: UILabel!
|
||||
@IBOutlet weak var referenceBody: UITextView!
|
||||
@IBOutlet weak var referenceDescription: UITextView!
|
||||
@IBOutlet weak var referenceDueDate: UILabel!
|
||||
@IBOutlet weak var referenceDueDateIcon: UIImageView!
|
||||
|
||||
|
@ -48,13 +48,14 @@ import Foundation
|
|||
contentView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||
|
||||
referenceTitle.text = ""
|
||||
referenceBody.text = ""
|
||||
referenceDescription.text = ""
|
||||
referenceDueDate.text = ""
|
||||
referenceTypeIcon.image = nil
|
||||
|
||||
// Remove padding from textView and adjust lineBreakMode
|
||||
referenceBody.textContainerInset = .zero
|
||||
referenceBody.textContainer.lineFragmentPadding = .zero
|
||||
referenceBody.textContainer.lineBreakMode = .byTruncatingTail
|
||||
referenceDescription.textContainerInset = .zero
|
||||
referenceDescription.textContainer.lineFragmentPadding = .zero
|
||||
referenceDescription.textContainer.lineBreakMode = .byTruncatingTail
|
||||
|
||||
let tap = UITapGestureRecognizer(target: self, action: #selector(self.handleTap))
|
||||
contentView.addGestureRecognizer(tap)
|
||||
|
@ -75,6 +76,7 @@ import Foundation
|
|||
|
||||
guard let card = reference["card"] as? [String: AnyObject] else {
|
||||
referenceTitle.text = url
|
||||
referenceDescription.isHidden = true
|
||||
referenceDueDate.isHidden = true
|
||||
referenceDueDateIcon.isHidden = true
|
||||
return
|
||||
|
@ -83,11 +85,9 @@ import Foundation
|
|||
if let dueDateString = card["duedate"] as? String {
|
||||
|
||||
let dateFormatter = DateFormatter()
|
||||
dateFormatter.locale = Locale(identifier: "en_US_POSIX") // set locale to reliable US_POSIX
|
||||
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
let date = dateFormatter.date(from: dueDateString)!
|
||||
|
||||
//let dueDate = NSDate(timeIntervalSince1970: TimeInterval(duedate))
|
||||
referenceDueDate.text = NCUtils.readableDateTime(from: date)
|
||||
} else {
|
||||
referenceDueDate.isHidden = true
|
||||
|
@ -99,9 +99,9 @@ import Foundation
|
|||
}
|
||||
|
||||
if let body = card["description"] as? String {
|
||||
referenceBody.text = body
|
||||
referenceDescription.text = body
|
||||
} else {
|
||||
referenceBody.text = NSLocalizedString("No description provided", comment: "")
|
||||
referenceDescription.text = NSLocalizedString("No description provided", comment: "")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ReferenceDeckView" customModule="NextcloudTalk" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="contentView" destination="iN0-l3-epB" id="I1C-wk-7lp"/>
|
||||
<outlet property="referenceBody" destination="PAt-pa-feD" id="TR8-w0-2bX"/>
|
||||
<outlet property="referenceDescription" destination="PAt-pa-feD" id="5Vf-EF-IsR"/>
|
||||
<outlet property="referenceDueDate" destination="WRq-4l-Gy5" id="Qol-5i-5g2"/>
|
||||
<outlet property="referenceDueDateIcon" destination="0Ho-aZ-xOH" id="g13-yA-huU"/>
|
||||
<outlet property="referenceTitle" destination="Iby-r5-06p" id="aI4-Yi-Bp4"/>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" editable="NO" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PAt-pa-feD" userLabel="Body">
|
||||
<textView clipsSubviews="YES" multipleTouchEnabled="YES" userInteractionEnabled="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" bounces="NO" scrollEnabled="NO" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" bouncesZoom="NO" editable="NO" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PAt-pa-feD" userLabel="Description">
|
||||
<rect key="frame" x="40" y="30" width="565" height="40"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
|
|
Загрузка…
Ссылка в новой задаче