From ccdcf9668f1aadeb4a5caa015c29d17816121420 Mon Sep 17 00:00:00 2001 From: talksik Date: Sun, 2 Jan 2022 22:21:02 -0800 Subject: [PATCH] subtle improvements to controls --- nirvana-ios/Views/Convos/ConvoViewModel.swift | 10 ++++------ nirvana-ios/Views/InnerCircle/CircleGridView.swift | 1 + .../Views/InnerCircle/InnerCircleViewModel.swift | 4 +++- nirvana-ios/Views/RuleBook/RuleBook.swift | 2 ++ 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/nirvana-ios/Views/Convos/ConvoViewModel.swift b/nirvana-ios/Views/Convos/ConvoViewModel.swift index cdd41be..9422d49 100644 --- a/nirvana-ios/Views/Convos/ConvoViewModel.swift +++ b/nirvana-ios/Views/Convos/ConvoViewModel.swift @@ -90,8 +90,6 @@ class ConvoViewModel: NSObject, ObservableObject { return self.selectedConvoId != nil } - static var maxUsersInConvo = 8 - static var relevancyAcceptance = 0.5 func initializeAgoraEngine() { self.agoraKit = AgoraRtcEngineKit.sharedEngine(withAppId: "c8dfd65deb5c4741bd564085627139d0", delegate: self) @@ -198,7 +196,7 @@ class ConvoViewModel: NSObject, ObservableObject { let relevancyScore = Double(relevancyCount) / Double(convo.users.count) print("relevancy score: \(relevancyScore)") - if relevancyScore > Self.relevancyAcceptance && convo.users.count > 1 { //offchance that it's just the one person in the convo right now, don't want to see it until there are at least 2 people + if relevancyScore > RuleBook.convoRelevancyAcceptance && convo.users.count > 1 { //offchance that it's just the one person in the convo right now, don't want to see it until there are at least 2 people print("this convo counts as relevant!!!") return true @@ -268,7 +266,7 @@ class ConvoViewModel: NSObject, ObservableObject { } // safe case, not really possible - if convo.users.count >= Self.maxUsersInConvo { + if convo.users.count >= RuleBook.maxUsersInConvo { self.toast = .maxLimitUsers return } @@ -302,7 +300,7 @@ class ConvoViewModel: NSObject, ObservableObject { return } - if convo!.users.count >= Self.maxUsersInConvo { + if convo!.users.count >= RuleBook.maxUsersInConvo { self.toast = .maxLimitUsers return } @@ -338,7 +336,7 @@ class ConvoViewModel: NSObject, ObservableObject { } // TODO: put as an environment variable - if convo!.users.count >= Self.maxUsersInConvo { + if convo!.users.count >= RuleBook.maxUsersInConvo { self.toast = .maxLimitUsers return } diff --git a/nirvana-ios/Views/InnerCircle/CircleGridView.swift b/nirvana-ios/Views/InnerCircle/CircleGridView.swift index b1bfb6d..9ae3fe5 100644 --- a/nirvana-ios/Views/InnerCircle/CircleGridView.swift +++ b/nirvana-ios/Views/InnerCircle/CircleGridView.swift @@ -357,6 +357,7 @@ struct CircleGridView: View { } //lazygrid // TODO: add padding based on if we are on any cornering item to allow the bubble to enlargen .padding(.trailing, Self.size / 2 + Self.spacingBetweenColumns / 2) // because of the offset of last column .padding(.top, Self.size / 2 + Self.spacingBetweenRows / 2) // because we are going under the nav bar +// .id(UUID()) }// scrollview .onAppear { // scrolling to first person in grid diff --git a/nirvana-ios/Views/InnerCircle/InnerCircleViewModel.swift b/nirvana-ios/Views/InnerCircle/InnerCircleViewModel.swift index aabfdbd..c9b7c7a 100644 --- a/nirvana-ios/Views/InnerCircle/InnerCircleViewModel.swift +++ b/nirvana-ios/Views/InnerCircle/InnerCircleViewModel.swift @@ -61,7 +61,7 @@ class InnerCircleViewModel: ObservableObject { case .problemSendingClip: return AlertToast(displayMode: .hud, type: .error(Color.orange), title: "problem sending clip", subTitle: "please try again") case .startedClip: - return AlertToast(displayMode: .hud, type: .systemImage("waveform.circle.fill", Color.orange)) + return AlertToast(displayMode: .hud, type: .systemImage("waveform.and.mic", Color.orange), subTitle: "you're on") default: return AlertToast(displayMode: .hud, type: .error(Color.orange), title: "Something went wrong ‼️") } @@ -117,6 +117,8 @@ extension InnerCircleViewModel { audioRecorder.record() isRecording = true + self.toast = .startedClip + self.audioLocalUrl = filePath // setting this for later use when recording is stopped } catch { diff --git a/nirvana-ios/Views/RuleBook/RuleBook.swift b/nirvana-ios/Views/RuleBook/RuleBook.swift index 3609bed..e6212f2 100644 --- a/nirvana-ios/Views/RuleBook/RuleBook.swift +++ b/nirvana-ios/Views/RuleBook/RuleBook.swift @@ -9,4 +9,6 @@ import Foundation class RuleBook { static let maxFriends = 8 + static let maxUsersInConvo = 8 + static let convoRelevancyAcceptance = 0.5 // anything above this number }