mirror of https://github.com/oxen-io/session-ios
Remove unused code
parent
16bb12e62c
commit
5524ab1932
@ -1,72 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
@objc(OWSAvatarTableViewCell)
|
|
||||||
public class AvatarTableViewCell: UITableViewCell {
|
|
||||||
|
|
||||||
private let columns: UIStackView
|
|
||||||
private let textRows: UIStackView
|
|
||||||
// private let avatarView: AvatarImageView
|
|
||||||
|
|
||||||
private let _textLabel: UILabel
|
|
||||||
override public var textLabel: UILabel? {
|
|
||||||
get {
|
|
||||||
return _textLabel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private let _detailTextLabel: UILabel
|
|
||||||
override public var detailTextLabel: UILabel? {
|
|
||||||
get {
|
|
||||||
return _detailTextLabel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@objc
|
|
||||||
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
|
|
||||||
// self.avatarView = AvatarImageView()
|
|
||||||
// avatarView.autoSetDimensions(to: CGSize(width: CGFloat(kStandardAvatarSize), height: CGFloat(kStandardAvatarSize)))
|
|
||||||
|
|
||||||
self._textLabel = UILabel()
|
|
||||||
self._detailTextLabel = UILabel()
|
|
||||||
|
|
||||||
self.textRows = UIStackView(arrangedSubviews: [_textLabel, _detailTextLabel])
|
|
||||||
textRows.axis = .vertical
|
|
||||||
|
|
||||||
self.columns = UIStackView(arrangedSubviews: [ textRows ])
|
|
||||||
columns.axis = .horizontal
|
|
||||||
columns.spacing = CGFloat(kContactCellAvatarTextMargin)
|
|
||||||
|
|
||||||
super.init(style: style, reuseIdentifier: reuseIdentifier)
|
|
||||||
|
|
||||||
self.contentView.addSubview(columns)
|
|
||||||
columns.autoPinEdgesToSuperviewMargins()
|
|
||||||
|
|
||||||
OWSTableItem.configureCell(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
required public init?(coder aDecoder: NSCoder) {
|
|
||||||
fatalError("init(coder:) has not been implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
@objc
|
|
||||||
public func configure(image: UIImage?, text: String?, detailText: String?) {
|
|
||||||
// self.avatarView.image = image
|
|
||||||
self.textLabel?.text = text
|
|
||||||
self.detailTextLabel?.text = detailText
|
|
||||||
|
|
||||||
OWSTableItem.configureCell(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
@objc
|
|
||||||
public override func prepareForReuse() {
|
|
||||||
super.prepareForReuse()
|
|
||||||
|
|
||||||
// self.avatarView.image = nil
|
|
||||||
self.textLabel?.text = nil
|
|
||||||
self.detailTextLabel?.text = nil
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
//
|
|
||||||
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
import SignalUtilitiesKit
|
|
||||||
|
|
||||||
@objc class GroupTableViewCell: UITableViewCell {
|
|
||||||
|
|
||||||
// MARK: -
|
|
||||||
|
|
||||||
// private let avatarView = AvatarImageView()
|
|
||||||
private let nameLabel = UILabel()
|
|
||||||
private let subtitleLabel = UILabel()
|
|
||||||
|
|
||||||
init() {
|
|
||||||
super.init(style: .default, reuseIdentifier: GroupTableViewCell.logTag())
|
|
||||||
|
|
||||||
// Font config
|
|
||||||
nameLabel.font = .ows_dynamicTypeBody
|
|
||||||
nameLabel.textColor = Theme.primaryColor
|
|
||||||
subtitleLabel.font = UIFont.ows_regularFont(withSize: 11.0)
|
|
||||||
subtitleLabel.textColor = Theme.secondaryColor
|
|
||||||
|
|
||||||
// Layout
|
|
||||||
|
|
||||||
// avatarView.autoSetDimension(.width, toSize: CGFloat(kStandardAvatarSize))
|
|
||||||
// avatarView.autoPinToSquareAspectRatio()
|
|
||||||
|
|
||||||
let textRows = UIStackView(arrangedSubviews: [nameLabel, subtitleLabel])
|
|
||||||
textRows.axis = .vertical
|
|
||||||
textRows.alignment = .leading
|
|
||||||
|
|
||||||
let columns = UIStackView(arrangedSubviews: [ textRows ])
|
|
||||||
columns.axis = .horizontal
|
|
||||||
columns.alignment = .center
|
|
||||||
columns.spacing = kContactCellAvatarTextMargin
|
|
||||||
|
|
||||||
self.contentView.addSubview(columns)
|
|
||||||
columns.autoPinEdgesToSuperviewMargins()
|
|
||||||
}
|
|
||||||
|
|
||||||
required init?(coder aDecoder: NSCoder) {
|
|
||||||
notImplemented()
|
|
||||||
}
|
|
||||||
|
|
||||||
@objc
|
|
||||||
public func configure(thread: TSGroupThread) {
|
|
||||||
OWSTableItem.configureCell(self)
|
|
||||||
|
|
||||||
if let groupName = thread.groupModel.groupName, !groupName.isEmpty {
|
|
||||||
self.nameLabel.text = groupName
|
|
||||||
} else {
|
|
||||||
self.nameLabel.text = MessageStrings.newGroupDefaultTitle
|
|
||||||
}
|
|
||||||
|
|
||||||
let groupMemberIds: [String] = thread.groupModel.groupMemberIds
|
|
||||||
let groupMemberNames = groupMemberIds.map { (recipientId: String) in
|
|
||||||
SSKEnvironment.shared.profileManager.profileNameForRecipient(withID: recipientId, avoidingWriteTransaction: true)!
|
|
||||||
}.joined(separator: ", ")
|
|
||||||
self.subtitleLabel.text = groupMemberNames
|
|
||||||
|
|
||||||
// self.avatarView.image = OWSAvatarBuilder.buildImage(thread: thread, diameter: kStandardAvatarSize)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue