Signed-off-by: marinofaggiana <ios@nextcloud.com>
This commit is contained in:
marinofaggiana 2022-06-22 15:33:33 +02:00
Родитель a3aac9495f
Коммит f230967505
5 изменённых файлов: 8 добавлений и 72 удалений

Просмотреть файл

@ -24,7 +24,9 @@ type_body_length:
identifier_name:
min_length: 0
disabled_rules:
- unused_setter_value
excluded:
- Carthage

Просмотреть файл

@ -598,6 +598,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
if progressNumber.floatValue == 1 {
cell.progress?.isHidden = true
cell.progress?.progress = .zero
cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
cell.writeInfoDateSize(date: metadata.date, totalBytes: metadata.size)
} else {
@ -606,6 +607,7 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
} else {
cell.progress?.isHidden = false
cell.progress?.progress = progressNumber.floatValue
cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
if status == NCGlobal.shared.metadataStatusInDownload {
cell.info = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
} else if status == NCGlobal.shared.metadataStatusInUpload {
@ -613,41 +615,6 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
}
}
}
/*
if cell is NCListCell {
let cell = cell as! NCListCell
if progressNumber.floatValue == 1 {
cell.progressView?.isHidden = true
cell.progressView?.progress = .zero
cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
if let metadata = NCManageDatabase.shared.getMetadataFromOcId(ocId) {
cell.labelInfo.text = CCUtility.dateDiff(metadata.date as Date) + " · " + CCUtility.transformedSize(metadata.size)
} else {
cell.labelInfo.text = ""
}
} else if progressNumber.floatValue > 0 {
cell.progressView?.isHidden = false
cell.progressView?.progress = progressNumber.floatValue
cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
if status == NCGlobal.shared.metadataStatusInDownload {
cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
} else if status == NCGlobal.shared.metadataStatusInUpload {
cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↑ " + CCUtility.transformedSize(totalBytes)
}
}
} else if cell is NCGridCell {
let cell = cell as! NCGridCell
if progressNumber.floatValue == 1 {
cell.progressView.isHidden = true
cell.progressView.progress = .zero
cell.setButtonMore(named: NCGlobal.shared.buttonMoreMore, image: NCBrandColor.cacheImages.buttonMore)
} else if progressNumber.floatValue > 0 {
cell.progressView.isHidden = false
cell.progressView.progress = progressNumber.floatValue
cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
}
}
*/
}
}

Просмотреть файл

@ -67,7 +67,7 @@ class NCShareCommentsCell: UITableViewCell, NCCellProtocol {
}
set { }
}
override func awakeFromNib() {
super.awakeFromNib()

Просмотреть файл

@ -65,7 +65,7 @@ class NCShareUserCell: UITableViewCell, NCCellProtocol {
}
set { }
}
func setupCellUI(userId: String) {
guard let tableShare = tableShare else {
return
@ -185,7 +185,7 @@ class NCSearchUserDropDownCell: DropDownCell, NCCellProtocol {
}
set { }
}
func setupCell(sharee: NCCommunicationSharee, baseUrl: NCUserBaseUrl) {
imageItem.image = NCShareCommon.shared.getImageShareType(shareType: sharee.shareType)
imageShareeType.image = NCShareCommon.shared.getImageShareType(shareType: sharee.shareType)

Просмотреть файл

@ -89,39 +89,6 @@ class NCTransfers: NCCollectionViewCommon, NCTransferCellDelegate {
reloadDataSource()
}
override func triggerProgressTask(_ notification: NSNotification) {
guard let userInfo = notification.userInfo as NSDictionary?,
let progressNumber = userInfo["progress"] as? NSNumber,
let totalBytes = userInfo["totalBytes"] as? Int64,
let totalBytesExpected = userInfo["totalBytesExpected"] as? Int64,
let ocId = userInfo["ocId"] as? String,
let (indexPath, _) = self.dataSource.getIndexPathMetadata(ocId: ocId) as? (IndexPath, NCMetadatasForSection?)
else {
return
}
let status = userInfo["status"] as? Int ?? NCGlobal.shared.metadataStatusNormal
if let cell = collectionView?.cellForItem(at: indexPath) {
let cell = cell as! NCTransferCell
if progressNumber.floatValue == 1 {
cell.progressView?.isHidden = true
cell.progressView?.progress = .zero
cell.buttonMore.isHidden = true
cell.labelInfo.text = ""
} else if progressNumber.floatValue > 0 {
cell.progressView?.isHidden = false
cell.progressView?.progress = progressNumber.floatValue
cell.setButtonMore(named: NCGlobal.shared.buttonMoreStop, image: NCBrandColor.cacheImages.buttonStop)
if status == NCGlobal.shared.metadataStatusInDownload {
cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↓ " + CCUtility.transformedSize(totalBytes)
} else if status == NCGlobal.shared.metadataStatusInUpload {
cell.labelInfo.text = CCUtility.transformedSize(totalBytesExpected) + " - ↑ " + CCUtility.transformedSize(totalBytes)
}
}
}
}
// MARK: TAP EVENT
override func longPressMoreListItem(with objectId: String, namedButtonMore: String, gestureRecognizer: UILongPressGestureRecognizer) {