Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/refactor tag selection create tribe #422

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions sphinx.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,10 @@
47FB189B23A299000097695B /* SignupHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47FB189A23A299000097695B /* SignupHelper.swift */; };
47FDDB1C2562D77200BBF15F /* boost_animation.json in Resources */ = {isa = PBXBuildFile; fileRef = 47FDDB1B2562D77100BBF15F /* boost_animation.json */; };
47FE9A3E23C381A20090913F /* UITapGestureRecognizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47FE9A3D23C381A20090913F /* UITapGestureRecognizer.swift */; };
9386C2892BB25C2200ABDEF3 /* AddTagsButtonCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9386C2882BB25C2200ABDEF3 /* AddTagsButtonCell.xib */; };
9386C28B2BB25EDC00ABDEF3 /* AddedTagsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9386C28A2BB25EDC00ABDEF3 /* AddedTagsView.swift */; };
9386C28D2BB25F2700ABDEF3 /* AddedTagsView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9386C28C2BB25F2700ABDEF3 /* AddedTagsView.xib */; };
93D7B5472BAE0FEA007C53A9 /* AddTagsButtonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93D7B5462BAE0FEA007C53A9 /* AddTagsButtonCell.swift */; };
93FCEA782B91AF3B0069B344 /* DashboardUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 93FCEA772B91AF3B0069B344 /* DashboardUITest.swift */; };
CE07B83629DC92F900A02652 /* ItemDescriptionTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE07B83429DC92F900A02652 /* ItemDescriptionTableViewCell.swift */; };
CE07B83729DC92F900A02652 /* ItemDescriptionTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = CE07B83529DC92F900A02652 /* ItemDescriptionTableViewCell.xib */; };
Expand Down Expand Up @@ -1824,6 +1828,10 @@
47FDDB1B2562D77100BBF15F /* boost_animation.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = boost_animation.json; sourceTree = "<group>"; };
47FE9A3D23C381A20090913F /* UITapGestureRecognizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITapGestureRecognizer.swift; sourceTree = "<group>"; };
487E10CEB3D07B0840A84681 /* Pods_sphinx.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_sphinx.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9386C2882BB25C2200ABDEF3 /* AddTagsButtonCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddTagsButtonCell.xib; sourceTree = "<group>"; };
9386C28A2BB25EDC00ABDEF3 /* AddedTagsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddedTagsView.swift; sourceTree = "<group>"; };
9386C28C2BB25F2700ABDEF3 /* AddedTagsView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AddedTagsView.xib; sourceTree = "<group>"; };
93D7B5462BAE0FEA007C53A9 /* AddTagsButtonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTagsButtonCell.swift; sourceTree = "<group>"; };
93FCEA772B91AF3B0069B344 /* DashboardUITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardUITest.swift; sourceTree = "<group>"; };
CE07B83429DC92F900A02652 /* ItemDescriptionTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemDescriptionTableViewCell.swift; sourceTree = "<group>"; };
CE07B83529DC92F900A02652 /* ItemDescriptionTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ItemDescriptionTableViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3363,6 +3371,8 @@
476EB47423C50662009745E2 /* GroupContactTableViewCell.xib */,
4712BB4023D755EA00DDCC3B /* GroupAddMemberTableViewCell.swift */,
4712BB4123D755EA00DDCC3B /* GroupAddMemberTableViewCell.xib */,
93D7B5462BAE0FEA007C53A9 /* AddTagsButtonCell.swift */,
9386C2882BB25C2200ABDEF3 /* AddTagsButtonCell.xib */,
);
path = "View Cells";
sourceTree = "<group>";
Expand Down Expand Up @@ -3551,6 +3561,8 @@
4787F87D24745BBD00CCE8B9 /* GroupTagView.xib */,
470F4C45257E6EE400288A9B /* TribeMemberInfoView.swift */,
470F4C4B257E708400288A9B /* TribeMemberInfoView.xib */,
9386C28A2BB25EDC00ABDEF3 /* AddedTagsView.swift */,
9386C28C2BB25F2700ABDEF3 /* AddedTagsView.xib */,
);
path = "Custom Views";
sourceTree = "<group>";
Expand Down Expand Up @@ -4862,6 +4874,7 @@
474935662A2919D600AB5FFA /* AudioMessageView.xib in Resources */,
F33119A5268FA097005082EB /* XcodeStoreKitTestCertificate.cer in Resources */,
F3188BA3271CDA4200890DDD /* VideoFeed.storyboard in Resources */,
9386C2892BB25C2200ABDEF3 /* AddTagsButtonCell.xib in Resources */,
470F5CAD243E8823007E054F /* VideoCallPayButton.xib in Resources */,
CE842DE9298C67A500620AD3 /* KnownBadgeCell.xib in Resources */,
47E6A4CA2A2E66E500A9509E /* DateSeparatorView.xib in Resources */,
Expand Down Expand Up @@ -4974,6 +4987,7 @@
CEE49BF42A1BBC70009E0EC4 /* MediaStorageTypeSummaryTableViewCell.xib in Resources */,
4705D39B2799AAC0009C0729 /* CustomBoostView.xib in Resources */,
47183CB42548AA5100E6FD19 /* PodcastPlayerView.xib in Resources */,
9386C28D2BB25F2700ABDEF3 /* AddedTagsView.xib in Resources */,
F3446B9426BABAB400855516 /* ChatListCollectionViewCell.xib in Resources */,
F3188BAE271CF20B00890DDD /* VideoFeedEpisodePlayerCollectionViewDetailsCell.xib in Resources */,
47CFA94C2A38CA4E0030BC23 /* NewMessagesIndicatorView.xib in Resources */,
Expand Down Expand Up @@ -5184,6 +5198,7 @@
47A79D3A2444A15C005CD72F /* MessageOptionsView.swift in Sources */,
47E6A4CC2A2E68A700A9509E /* DeletedMessageView.swift in Sources */,
47308E0824FEE6E600FFAC6F /* SocketEngineClient.swift in Sources */,
93D7B5472BAE0FEA007C53A9 /* AddTagsButtonCell.swift in Sources */,
475BDD89232C086C00C5BBD6 /* HistoryViewController.swift in Sources */,
CE94A50D2A4B2BF6001EDF7E /* MentionOrMacroItem.swift in Sources */,
F36C5EC027315EBB00F3D944 /* GeneralVideoFeedEpisodePlayerViewController GeneralVideoFeedEpisodePlayerViewController.swift in Sources */,
Expand Down Expand Up @@ -5455,6 +5470,7 @@
4726A40D24C09C38005A66B4 /* ChatListHeader.swift in Sources */,
F373BF0C26AAFB990093C886 /* CustomSegmentedControl.swift in Sources */,
F3197C1326811DE400330F79 /* RestoreUserFormViewController+KeychainRestorationUtils.swift in Sources */,
9386C28B2BB25EDC00ABDEF3 /* AddedTagsView.swift in Sources */,
47E6A4F72A2F788300A9509E /* NewChatTableDataSource+ResultsControllerExtension.swift in Sources */,
4785C10224D4A0BE004E2D6C /* Constants.swift in Sources */,
CE3133AD2977747E00E91E3A /* BadgeAdminManagementListDataSource.swift in Sources */,
Expand Down
18 changes: 4 additions & 14 deletions sphinx/Scenes/Groups/Base.lproj/Groups.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
Expand Down Expand Up @@ -852,7 +852,7 @@
<rect key="frame" x="30" y="150" width="354" height="75"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Public Key *" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Ml-t1-tHR">
<rect key="frame" x="0.0" y="25" width="64.5" height="14"/>
<rect key="frame" x="0.0" y="25" width="65" height="14"/>
<fontDescription key="fontDescription" name="Roboto-Regular" family="Roboto" pointSize="12"/>
<color key="textColor" name="SecondaryText"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -1065,7 +1065,7 @@
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ADD TRIBE MEMBER" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TWz-rt-SOH">
<rect key="frame" x="133" y="19" width="148" height="17.5"/>
<rect key="frame" x="133.5" y="19" width="147.5" height="17.5"/>
<fontDescription key="fontDescription" name="Montserrat-SemiBold" family="Montserrat" pointSize="14"/>
<color key="textColor" name="Text"/>
<nil key="highlightedColor"/>
Expand Down Expand Up @@ -1816,24 +1816,14 @@
</collectionViewFlowLayout>
<cells/>
</collectionView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ibe-ge-p9n">
<rect key="frame" x="0.0" y="0.0" width="354" height="100"/>
<connections>
<action selector="tagsButtonTouched" destination="Taj-6P-tFd" eventType="touchUpInside" id="Zfq-ah-Gs5"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" name="Body"/>
<constraints>
<constraint firstItem="euf-iP-yfI" firstAttribute="leading" secondItem="3ht-TA-gFZ" secondAttribute="leading" id="2Ez-wp-51Y"/>
<constraint firstItem="euf-iP-yfI" firstAttribute="top" secondItem="dbS-d6-I3s" secondAttribute="bottom" constant="15" id="3Yd-EH-88W"/>
<constraint firstAttribute="bottom" secondItem="euf-iP-yfI" secondAttribute="bottom" constant="1" id="6wM-tT-Qr6"/>
<constraint firstItem="Ibe-ge-p9n" firstAttribute="leading" secondItem="3ht-TA-gFZ" secondAttribute="leading" id="7Cm-zj-j87"/>
<constraint firstAttribute="trailing" secondItem="Ibe-ge-p9n" secondAttribute="trailing" id="CSa-tJ-wFa"/>
<constraint firstItem="dbS-d6-I3s" firstAttribute="top" secondItem="3ht-TA-gFZ" secondAttribute="top" constant="20" id="D6x-Tx-rnH"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="dbS-d6-I3s" secondAttribute="trailing" constant="20" symbolic="YES" id="HSN-42-VfU"/>
<constraint firstItem="Ibe-ge-p9n" firstAttribute="top" secondItem="3ht-TA-gFZ" secondAttribute="top" id="JuZ-bP-7Hp"/>
<constraint firstAttribute="bottom" secondItem="Ibe-ge-p9n" secondAttribute="bottom" id="NSj-KM-jjm"/>
<constraint firstItem="dbS-d6-I3s" firstAttribute="leading" secondItem="3ht-TA-gFZ" secondAttribute="leading" id="V6u-KB-adT"/>
<constraint firstAttribute="trailing" secondItem="euf-iP-yfI" secondAttribute="trailing" id="bNG-KF-DPr"/>
</constraints>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// AddedTagsView.swift
// sphinx
//
// Created by Oko-osi Korede on 26/03/2024.
// Copyright © 2024 sphinx. All rights reserved.
//

import UIKit

class AddedTagsView: UIView {

@IBOutlet var contentView: UIView!

@IBOutlet weak var container: UIView!
// @IBOutlet weak var iconImageView: UIImageView!
@IBOutlet weak var tagLabel: UILabel!

let kNormalColor = UIColor.Sphinx.BodyInverted
let kTextColor = UIColor.Sphinx.Body

public static let kLeftMargin:CGFloat = 55
public static let kRightMargin:CGFloat = 20

public static let kDescriptionFont = UIFont(name: "Roboto-Regular", size: 13.0)!

override init(frame: CGRect) {
super.init(frame: frame)
setup()
}

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

private func setup() {
Bundle.main.loadNibNamed("AddedTagsView", owner: self, options: nil)
addSubview(contentView)
contentView.frame = self.bounds
contentView.autoresizingMask = [.flexibleHeight, .flexibleWidth]

container.layer.cornerRadius = container.frame.size.height / 2
// iconImageView.layer.cornerRadius = iconImageView.frame.size.height / 2
}

func configureWith(tag: GroupsManager.Tag) {
// iconImageView.image = UIImage(named: tag.image)
tagLabel.text = tag.description
tagLabel.textColor = kTextColor
container.backgroundColor = kNormalColor
}

public static func getWidthWith(description: String) -> CGFloat {
return kDescriptionFont.sizeOfString(description, constrainedToWidth: .greatestFiniteMagnitude).width + kLeftMargin + kRightMargin
}
}
Loading