Skip to content

Commit

Permalink
Merge pull request #1842 from nextcloud/use-default-cell-for-user-pro…
Browse files Browse the repository at this point in the history
…file-cell

Use default UITableViewCell for user profile cell
  • Loading branch information
SystemKeeper authored Oct 22, 2024
2 parents 03de5c9 + 69a5534 commit db09660
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 196 deletions.
16 changes: 8 additions & 8 deletions NextcloudTalk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@
2C78EFA11F828C41008AFA74 /* CallViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C78EF9F1F828C41008AFA74 /* CallViewController.xib */; };
2C78EFA51F86FF4A008AFA74 /* CallParticipantViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C78EFA31F86FF4A008AFA74 /* CallParticipantViewCell.m */; };
2C78EFA61F86FF4A008AFA74 /* CallParticipantViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C78EFA41F86FF4A008AFA74 /* CallParticipantViewCell.xib */; };
2C7A1237200E0A5700864818 /* UserSettingsTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C7A1235200E0A5700864818 /* UserSettingsTableViewCell.xib */; };
2C7A12422017872600864818 /* AddParticipantsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C7A12402017872600864818 /* AddParticipantsTableViewController.m */; };
2C7A12432017872600864818 /* AddParticipantsTableViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2C7A12412017872600864818 /* AddParticipantsTableViewController.xib */; };
2C7F47AA20289B9600081CC7 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2C7F47AC20289B9600081CC7 /* Localizable.strings */; };
Expand Down Expand Up @@ -574,6 +573,8 @@
2CC1FF4828183958009F7288 /* NCDeckCardParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC1FF4728183958009F7288 /* NCDeckCardParameter.m */; };
2CC1FF492818395E009F7288 /* NCDeckCardParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC1FF4728183958009F7288 /* NCDeckCardParameter.m */; };
2CC1FF4A2818395F009F7288 /* NCDeckCardParameter.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CC1FF4728183958009F7288 /* NCDeckCardParameter.m */; };
2CC3166A2CC26194007CBE16 /* UITableViewExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC316692CC26186007CBE16 /* UITableViewExtension.swift */; };
2CC3166C2CC2A850007CBE16 /* SettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC3166B2CC2A849007CBE16 /* SettingsTableViewCell.swift */; };
2CC32E8D27F4540E00BB8C39 /* ReactionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC32E8C27F4540E00BB8C39 /* ReactionsView.swift */; };
2CC32E9227F45AE000BB8C39 /* ReactionsViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CC32E9027F45AE000BB8C39 /* ReactionsViewCell.swift */; };
2CC32E9327F45AE000BB8C39 /* ReactionsViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CC32E9127F45AE000BB8C39 /* ReactionsViewCell.xib */; };
Expand Down Expand Up @@ -606,7 +607,6 @@
DA66582F27B6B19C00B46B11 /* UserProfileTableViewController+Actions.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA66582E27B6B19C00B46B11 /* UserProfileTableViewController+Actions.swift */; };
DA66583127B6B24E00B46B11 /* UserProfileTableViewController+Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA66583027B6B24E00B46B11 /* UserProfileTableViewController+Utils.swift */; };
DA75580F278EEA1000A48A1B /* SettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA75580E278EEA1000A48A1B /* SettingsTableViewController.swift */; };
DA755811278EF3EF00A48A1B /* UserSettingsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA755810278EF3EF00A48A1B /* UserSettingsTableViewCell.swift */; };
DA8801A227A2DA00009EF248 /* UserProfileTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA8801A127A2DA00009EF248 /* UserProfileTableViewController.swift */; };
DA8801A427AC52AC009EF248 /* TextInputTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA8801A327AC52AC009EF248 /* TextInputTableViewCell.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -1029,7 +1029,6 @@
2C78EFA21F86FF4A008AFA74 /* CallParticipantViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallParticipantViewCell.h; sourceTree = "<group>"; };
2C78EFA31F86FF4A008AFA74 /* CallParticipantViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CallParticipantViewCell.m; sourceTree = "<group>"; };
2C78EFA41F86FF4A008AFA74 /* CallParticipantViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CallParticipantViewCell.xib; sourceTree = "<group>"; };
2C7A1235200E0A5700864818 /* UserSettingsTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UserSettingsTableViewCell.xib; sourceTree = "<group>"; };
2C7A123F2017872600864818 /* AddParticipantsTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AddParticipantsTableViewController.h; sourceTree = "<group>"; };
2C7A12402017872600864818 /* AddParticipantsTableViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AddParticipantsTableViewController.m; sourceTree = "<group>"; };
2C7A12412017872600864818 /* AddParticipantsTableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddParticipantsTableViewController.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1164,6 +1163,8 @@
2CC1FF4328147F10009F7288 /* RoomSharedItemsTableViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RoomSharedItemsTableViewController.xib; sourceTree = "<group>"; };
2CC1FF4628183958009F7288 /* NCDeckCardParameter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCDeckCardParameter.h; sourceTree = "<group>"; };
2CC1FF4728183958009F7288 /* NCDeckCardParameter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NCDeckCardParameter.m; sourceTree = "<group>"; };
2CC316692CC26186007CBE16 /* UITableViewExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITableViewExtension.swift; sourceTree = "<group>"; };
2CC3166B2CC2A849007CBE16 /* SettingsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTableViewCell.swift; sourceTree = "<group>"; };
2CC32E8C27F4540E00BB8C39 /* ReactionsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionsView.swift; sourceTree = "<group>"; };
2CC32E9027F45AE000BB8C39 /* ReactionsViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReactionsViewCell.swift; sourceTree = "<group>"; };
2CC32E9127F45AE000BB8C39 /* ReactionsViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ReactionsViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1208,7 +1209,6 @@
DA66582E27B6B19C00B46B11 /* UserProfileTableViewController+Actions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserProfileTableViewController+Actions.swift"; sourceTree = "<group>"; };
DA66583027B6B24E00B46B11 /* UserProfileTableViewController+Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UserProfileTableViewController+Utils.swift"; sourceTree = "<group>"; };
DA75580E278EEA1000A48A1B /* SettingsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = "<group>"; };
DA755810278EF3EF00A48A1B /* UserSettingsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserSettingsTableViewCell.swift; sourceTree = "<group>"; };
DA8801A127A2DA00009EF248 /* UserProfileTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserProfileTableViewController.swift; sourceTree = "<group>"; };
DA8801A327AC52AC009EF248 /* TextInputTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextInputTableViewCell.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -1521,6 +1521,7 @@
2CBD0D592C8770A40013C089 /* UIImageExtension.swift */,
1FAB2EED2AD1BC1B001214EB /* UIControlExtensions.swift */,
1F1B0F312BDC57E3003FD766 /* UIPageViewControllerExtension.swift */,
2CC316692CC26186007CBE16 /* UITableViewExtension.swift */,
1FC18FBF2CB7EA300058F621 /* AVRoutePickerViewExtension.swift */,
1FC18FC12CB7EA5C0058F621 /* RPSystemBroadcastPickerViewExtension.swift */,
);
Expand Down Expand Up @@ -1825,6 +1826,7 @@
2C55216A1F7D48850077E587 /* Settings */ = {
isa = PBXGroup;
children = (
2CC3166B2CC2A849007CBE16 /* SettingsTableViewCell.swift */,
2C2A788C2359CC8800EEB797 /* NCAppBranding.h */,
2C2A788D2359CC8800EEB797 /* NCAppBranding.m */,
2CA1CC931F014EF9002FE6A2 /* NCSettingsController.h */,
Expand All @@ -1834,8 +1836,6 @@
1F61C766285E35A6004D74D8 /* DiagnosticsTableViewController.swift */,
1F7625E42901B0DB00834869 /* CallsFromOldAccountViewController.swift */,
1F7625E62901B0E800834869 /* CallsFromOldAccountViewController.xib */,
2C7A1235200E0A5700864818 /* UserSettingsTableViewCell.xib */,
DA755810278EF3EF00A48A1B /* UserSettingsTableViewCell.swift */,
2C78E9E125120DE500E3D4CA /* NCUserStatus.h */,
2C78E9E225120DE500E3D4CA /* NCUserStatus.m */,
1FD6F83D2B87B712004048AB /* NCUserStatusExtensions.swift */,
Expand Down Expand Up @@ -2528,7 +2528,6 @@
2CC1FF4528147F11009F7288 /* RoomSharedItemsTableViewController.xib in Resources */,
2C06BF6420AC64370031EB46 /* DateHeaderView.xib in Resources */,
2C440D1220EA4A770005F9BB /* RoomInfoTableViewController.xib in Resources */,
2C7A1237200E0A5700864818 /* UserSettingsTableViewCell.xib in Resources */,
2C1D13A3253760EE00EC0533 /* LaunchScreen.xib in Resources */,
1FB7B99C2BF0DF360093CE98 /* BannedActorCell.xib in Resources */,
2C4747E22CB58FD2002828F2 /* PollMessageView.xib in Resources */,
Expand Down Expand Up @@ -2875,6 +2874,7 @@
2CD80F482A4304AD00919057 /* OpenConversationsTableViewController.swift in Sources */,
1FEC459E2A02BCB900A636AA /* ReferenceGithubPermalinkView.swift in Sources */,
2CC1C38729C0945700C8436B /* DRCellSlideAction.m in Sources */,
2CC3166C2CC2A850007CBE16 /* SettingsTableViewCell.swift in Sources */,
1FEDE3C6257D439500853F79 /* NCChatFileController.m in Sources */,
1FEDE3CE257D43AB00853F79 /* NCMessageFileParameter.m in Sources */,
2C4446DD2658158000DF1DBC /* NCChatBlock.m in Sources */,
Expand All @@ -2895,7 +2895,6 @@
1FAB2EF02AD1EAA3001214EB /* RLMSupport.swift in Sources */,
1F1B50342B8E069800B0F2F4 /* BaseChatTableViewCell.swift in Sources */,
2C1EF36B25505DCE007C9768 /* NCNavigationController.m in Sources */,
DA755811278EF3EF00A48A1B /* UserSettingsTableViewCell.swift in Sources */,
1FA38C9029A4B3C6008871B8 /* NCNotificationAction.swift in Sources */,
2C44B4D127FF05A000AD1C86 /* ReactionsSummaryView.swift in Sources */,
2CD4F6B72C11C80600ED594F /* ContactsSearchResultTableViewContoller.swift in Sources */,
Expand Down Expand Up @@ -3021,6 +3020,7 @@
2C4230F72B207AB00013E1FA /* ContextChatViewController.swift in Sources */,
2CBD0D5A2C8770A40013C089 /* UIImageExtension.swift in Sources */,
1F90DA0429E9A28E00E81E3D /* AvatarManager.swift in Sources */,
2CC3166A2CC26194007CBE16 /* UITableViewExtension.swift in Sources */,
1F1DF8432C64006E00E5EA86 /* SignalingParticipant.swift in Sources */,
2CC1FF4428147F11009F7288 /* RoomSharedItemsTableViewController.swift in Sources */,
2CC1C38629C0945700C8436B /* DRCellSlideGestureRecognizer.m in Sources */,
Expand Down
43 changes: 43 additions & 0 deletions NextcloudTalk/SettingsTableViewCell.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
// SPDX-License-Identifier: GPL-3.0-or-later
//

import UIKit

class SettingsTableViewCell: UITableViewCell {

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
commonInit()
}

required init?(coder: NSCoder) {
super.init(coder: coder)
commonInit()
}

private func commonInit() {
textLabel?.numberOfLines = 0
detailTextLabel?.numberOfLines = 0
detailTextLabel?.textColor = .secondaryLabel
}

override func prepareForReuse() {
super.prepareForReuse()

textLabel?.text = nil
detailTextLabel?.text = nil
imageView?.image = nil
accessoryView = nil
accessoryType = .none
selectionStyle = .default
}

func setSettingsImage(image: UIImage?, renderingMode: UIImage.RenderingMode = .alwaysTemplate) {
// Render all images to a size of 20x20 so all cells have the same width for the imageView
self.imageView?.image = NCUtils.renderAspectImage(image: image, ofSize: .init(width: 20, height: 20), centerImage: true)?.withRenderingMode(renderingMode)
self.imageView?.tintColor = .secondaryLabel
self.imageView?.contentMode = .scaleAspectFit
}
}
Loading

0 comments on commit db09660

Please sign in to comment.