Skip to content

Commit

Permalink
Update small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ahmed-anwer committed Jul 24, 2024
1 parent 7af113c commit 58015bb
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 22 deletions.
16 changes: 12 additions & 4 deletions DotCall.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@
E29C887D2BE4E8BB00B335F7 /* FriendCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E29C887B2BE4E8BB00B335F7 /* FriendCell.xib */; };
E29C88812BE4EC8800B335F7 /* RecentCallCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E29C887F2BE4EC8800B335F7 /* RecentCallCell.swift */; };
E29C88822BE4EC8800B335F7 /* RecentCallCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E29C88802BE4EC8800B335F7 /* RecentCallCell.xib */; };
E2B014B72C50C2F600BFD2CD /* audioSummarize.wav in Resources */ = {isa = PBXBuildFile; fileRef = E2B014B62C50C2F600BFD2CD /* audioSummarize.wav */; };
E2B014BA2C50DEDA00BFD2CD /* SwiftAudioEx in Frameworks */ = {isa = PBXBuildFile; productRef = E2B014B92C50DEDA00BFD2CD /* SwiftAudioEx */; };
E2B014C22C514DCF00BFD2CD /* Conversation2.wav in Resources */ = {isa = PBXBuildFile; fileRef = E2B014BF2C514DCF00BFD2CD /* Conversation2.wav */; };
E2B014C32C514DCF00BFD2CD /* audioSummarize.wav in Resources */ = {isa = PBXBuildFile; fileRef = E2B014C02C514DCF00BFD2CD /* audioSummarize.wav */; };
E2B014C42C514DCF00BFD2CD /* Conversation1.wav in Resources */ = {isa = PBXBuildFile; fileRef = E2B014C12C514DCF00BFD2CD /* Conversation1.wav */; };
E2B3F7BA2BF4C64200710DC9 /* RecordViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2B3F7B82BF4C64200710DC9 /* RecordViewCell.swift */; };
E2B3F7BB2BF4C64200710DC9 /* RecordViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2B3F7B92BF4C64200710DC9 /* RecordViewCell.xib */; };
E2DFD0ED2C342F74004059CF /* PushKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2DFD0EC2C342F74004059CF /* PushKit.framework */; };
Expand Down Expand Up @@ -178,7 +180,9 @@
E29C887B2BE4E8BB00B335F7 /* FriendCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FriendCell.xib; sourceTree = "<group>"; };
E29C887F2BE4EC8800B335F7 /* RecentCallCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentCallCell.swift; sourceTree = "<group>"; };
E29C88802BE4EC8800B335F7 /* RecentCallCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RecentCallCell.xib; sourceTree = "<group>"; };
E2B014B62C50C2F600BFD2CD /* audioSummarize.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = audioSummarize.wav; path = ../../../../Desktop/audioSummarize.wav; sourceTree = "<group>"; };
E2B014BF2C514DCF00BFD2CD /* Conversation2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = Conversation2.wav; path = "../../../../Desktop/Call-Audios/Conversation2.wav"; sourceTree = "<group>"; };
E2B014C02C514DCF00BFD2CD /* audioSummarize.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = audioSummarize.wav; path = "../../../../Desktop/Call-Audios/audioSummarize.wav"; sourceTree = "<group>"; };
E2B014C12C514DCF00BFD2CD /* Conversation1.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; name = Conversation1.wav; path = "../../../../Desktop/Call-Audios/Conversation1.wav"; sourceTree = "<group>"; };
E2B3F7B82BF4C64200710DC9 /* RecordViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecordViewCell.swift; sourceTree = "<group>"; };
E2B3F7B92BF4C64200710DC9 /* RecordViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RecordViewCell.xib; sourceTree = "<group>"; };
E2DFD0EC2C342F74004059CF /* PushKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PushKit.framework; path = System/Library/Frameworks/PushKit.framework; sourceTree = SDKROOT; };
Expand Down Expand Up @@ -249,7 +253,9 @@
E22B6BFB2BD6261700D9E9CE /* DotCall */ = {
isa = PBXGroup;
children = (
E2B014B62C50C2F600BFD2CD /* audioSummarize.wav */,
E2B014C02C514DCF00BFD2CD /* audioSummarize.wav */,
E2B014C12C514DCF00BFD2CD /* Conversation1.wav */,
E2B014BF2C514DCF00BFD2CD /* Conversation2.wav */,
E2DFD0EF2C343EAA004059CF /* Classes */,
E23E2C5E2BE21660004D85B7 /* Utilities */,
E2E140402BDEA30C00F3A48C /* Constants */,
Expand Down Expand Up @@ -625,18 +631,20 @@
E26C0D382BF07D650035A081 /* ProfileImageViewCell.xib in Resources */,
E2446D542BF8D45B00FD4214 /* ContactProfileViewCell.xib in Resources */,
E23E2C482BE13448004D85B7 /* AppStoryboard.storyboard in Resources */,
E2B014C42C514DCF00BFD2CD /* Conversation1.wav in Resources */,
E2444C572C0C76270058A656 /* AddFriendCell.xib in Resources */,
E27E2E012BD64F0600D89CD8 /* Inter.ttf in Resources */,
E2444C5E2C0E0FBE0058A656 /* AcceptFriendsTableViewCell.xib in Resources */,
E24CA4982BF8F02800D31185 /* ChatCallViewCell.xib in Resources */,
E2B014C32C514DCF00BFD2CD /* audioSummarize.wav in Resources */,
E24CA49E2BF919F000D31185 /* SummaryByContactViewCell.xib in Resources */,
E22B6C092BD6261800D9E9CE /* LaunchScreen.storyboard in Resources */,
E29C887D2BE4E8BB00B335F7 /* FriendCell.xib in Resources */,
E22B6C062BD6261800D9E9CE /* Assets.xcassets in Resources */,
E2F7855F2BF5CECE001CFCD8 /* ParticipantViewCell.xib in Resources */,
E22B6C042BD6261700D9E9CE /* MainAuth.storyboard in Resources */,
E2B014B72C50C2F600BFD2CD /* audioSummarize.wav in Resources */,
E29C88822BE4EC8800B335F7 /* RecentCallCell.xib in Resources */,
E2B014C22C514DCF00BFD2CD /* Conversation2.wav in Resources */,
E23E2C5D2BE20A00004D85B7 /* GoogleService-Info.plist in Resources */,
E26B30902BEA3C7A00138A8A /* TranscriptionCell.xib in Resources */,
E2B3F7BB2BF4C64200710DC9 /* RecordViewCell.xib in Resources */,
Expand Down
11 changes: 8 additions & 3 deletions DotCall/Controllers/App/CallViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CallViewController: UIViewController {

internal var selectedSummary: SummaryUser?

private func saveSummaryToRealm(summary:String,topic:String,trasncription:String) {
private func saveSummaryToRealm(summary:String,topic:String,trasncription:String,title:String) {
let date = Date()

do {
Expand All @@ -34,10 +34,12 @@ class CallViewController: UIViewController {
newSummary.callReciverUsername = selectedSummary!.callReciverUsername
newSummary.summaryDetail = summary
newSummary.summaryTopic = topic
newSummary.summaryTitle = title
newSummary.time = date
newSummary.transcription = trasncription
selectedSummary!.summary.append(newSummary)
selectedSummary!.recentTime = date
selectedSummary!.recentSummary = title

}
print("Summary Saved")
Expand Down Expand Up @@ -69,7 +71,9 @@ class CallViewController: UIViewController {
saveCallLog()


uploadAudio()
saveSummaryToRealm(summary: "summary", topic: "topic", trasncription: "transcription",title: "title")

//uploadAudio()

if #available(iOS 13.0, *) {
self.isModalInPresentation = true
Expand Down Expand Up @@ -153,12 +157,13 @@ class CallViewController: UIViewController {
// Handle the JSON response here without printing it to the console
if let transcription = response["transcription"] as? String,
let summary = response["summary"] as? String,
let title = response["title"] as? String,
let topics = response["topics"] as? [String] {

let topicsString = topics.joined(separator: ", ")

DispatchQueue.main.async {
self.saveSummaryToRealm(summary: summary, topic: topicsString, trasncription: transcription)
self.saveSummaryToRealm(summary: summary, topic: title, trasncription: transcription,title: title)
}
}

Expand Down
2 changes: 1 addition & 1 deletion DotCall/Controllers/App/ContactProfileViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ContactProfileViewController: UIViewController {
internal var record: Bool = false
internal var friendrecord: Bool = false
internal var contactUsername: String = ""
internal var summaryRecent: String = "Loading Summary.."
internal var summaryRecent: String = "Summary Loading.."

@IBOutlet weak var tableView: UITableView!

Expand Down
5 changes: 3 additions & 2 deletions DotCall/Controllers/App/DetailSummaryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ extension DetailSummaryViewController: UITableViewDataSource {

case 2:
let cell = tableView.dequeueReusableCell(withIdentifier: "SummaryCheck", for: indexPath) as! SummaryViewCell
cell.summaryTitle?.text = "\(detailedSummary?.summaryTopic ?? "null")"
cell.summaryTitle?.text = "\(detailedSummary?.summaryTitle ?? "null")"
cell.summaryText?.text = "\(detailedSummary?.summaryDetail ?? "null")"
cell.summaryTopic?.text = "The key topics in the conversation were: \(detailedSummary?.summaryTopic ?? "null")"
return cell

case 3:
Expand Down Expand Up @@ -179,7 +180,7 @@ private extension DetailSummaryViewController{

private func updateUI() {
if let detailedSummary = detailedSummary {
titleLabel.text = detailedSummary.summaryTopic
titleLabel.text = detailedSummary.summaryTitle

if let time = detailedSummary.time {
// Format time based on different scenarios
Expand Down
9 changes: 7 additions & 2 deletions DotCall/Controllers/App/SummarybyContactViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ extension SummarybyContactViewController {
let summary = summaries?[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: "SummaryByContact", for: indexPath) as! SummaryByContactViewCell
cell.time = summary!.time
cell.titleText.text = summary?.summaryTopic
cell.titleText.text = summary?.summaryTitle
return cell
} else {
let cell = tableView.dequeueReusableCell(withIdentifier: "NoSummariesCell", for: indexPath)
Expand Down Expand Up @@ -133,7 +133,12 @@ extension SummarybyContactViewController: UISearchResultsUpdating {
loadSummary(username: selectedSummary.callReciverUsername)
}
} else {
summaries = realm.objects(Summary.self).filter("callReciverUsername == %@ AND summaryTopic CONTAINS[cd] %@", selectedSumary!.callReciverUsername, searchText).sorted(byKeyPath: "time", ascending: false)
if let selectedSummary = selectedSumary {
summaries = realm.objects(Summary.self)
.filter("callReciverUsername == %@ AND (summaryTopic CONTAINS[cd] %@ OR summaryTitle CONTAINS[cd] %@)",
selectedSummary.callReciverUsername, searchText, searchText)
.sorted(byKeyPath: "time", ascending: false)
}
}
tableView.reloadData()
}
Expand Down
1 change: 1 addition & 0 deletions DotCall/Models/Data Model/Summary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Summary: Object {
@objc dynamic var callReciverUsername: String = ""
@objc dynamic var summaryDetail: String = ""
@objc dynamic var summaryTopic: String = ""
@objc dynamic var summaryTitle: String = ""
@objc dynamic var time: Date?
@objc dynamic var transcription: String = ""
var parentSummary = LinkingObjects(fromType: SummaryUser.self, property: "summary")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class SummaryViewCell: UITableViewCell {

@IBOutlet weak var summaryTitle: UILabel!
@IBOutlet weak var summaryText: UILabel!

@IBOutlet weak var summaryTopic: UILabel!


override func awakeFromNib() {
super.awakeFromNib()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<stackView opaque="NO" contentMode="scaleToFill" alignment="center" spacing="15" translatesAutoresizingMaskIntoConstraints="NO" id="kM0-t4-t7u">
<rect key="frame" x="20" y="5" width="387" height="188"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="v6B-Wq-BKw">
<rect key="frame" x="0.0" y="43.999999999999993" width="387" height="100.33333333333331"/>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="30" translatesAutoresizingMaskIntoConstraints="NO" id="v6B-Wq-BKw">
<rect key="frame" x="0.0" y="14.333333333333329" width="387" height="159.66666666666669"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MK9-C1-Lqr">
<rect key="frame" x="0.0" y="0.0" width="387" height="30"/>
Expand Down Expand Up @@ -68,21 +68,27 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="12" translatesAutoresizingMaskIntoConstraints="NO" id="AdW-Ed-bp2">
<rect key="frame" x="0.0" y="50" width="387" height="50.333333333333343"/>
<rect key="frame" x="0.0" y="60" width="387" height="51.666666666666657"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Summary Topic" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Yt3-8i-L3u">
<rect key="frame" x="0.0" y="0.0" width="387" height="20.333333333333332"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Summarized Text of the Conversation" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="z7K-kH-rkV">
<rect key="frame" x="0.0" y="32.333333333333343" width="387" height="18"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
<color key="textColor" systemColor="systemGrayColor"/>
<rect key="frame" x="0.0" y="32.333333333333343" width="387" height="19.333333333333329"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="16"/>
<color key="textColor" name="535353"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Topics Discussed" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="aUD-3v-nRn">
<rect key="frame" x="0.0" y="141.66666666666666" width="387" height="18"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</stackView>
</subviews>
Expand All @@ -108,19 +114,20 @@
<connections>
<outlet property="summaryText" destination="z7K-kH-rkV" id="iKE-bX-RI2"/>
<outlet property="summaryTitle" destination="Yt3-8i-L3u" id="3TB-On-4X6"/>
<outlet property="summaryTopic" destination="aUD-3v-nRn" id="mIP-j6-d9N"/>
</connections>
<point key="canvasLocation" x="254.96183206106869" y="34.859154929577464"/>
</tableViewCell>
</objects>
<resources>
<image name="doc.on.clipboard" catalog="system" width="116" height="128"/>
<image name="square.and.arrow.up.fill" catalog="system" width="115" height="128"/>
<namedColor name="535353">
<color red="0.32549019607843138" green="0.32549019607843138" blue="0.32549019607843138" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="BackgroundColor">
<color red="0.96862745098039216" green="0.96078431372549022" blue="0.95686274509803926" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<systemColor name="systemGrayColor">
<color red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="tintColor">
<color red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
Expand Down

0 comments on commit 58015bb

Please sign in to comment.