forked from mirrors/linphone-iphone
Compare commits
1 commit
master
...
feature/ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
66df197e08 |
3 changed files with 162 additions and 75 deletions
|
|
@ -2031,21 +2031,17 @@ struct CallView: View {
|
||||||
if callViewModel.isOneOneCall {
|
if callViewModel.isOneOneCall {
|
||||||
VStack {
|
VStack {
|
||||||
Button {
|
Button {
|
||||||
if callViewModel.callsCounter < 2 {
|
withAnimation {
|
||||||
withAnimation {
|
callViewModel.isTransferInsteadCall = true
|
||||||
callViewModel.isTransferInsteadCall = true
|
MagicSearchSingleton.shared.searchForSuggestions()
|
||||||
MagicSearchSingleton.shared.searchForSuggestions()
|
isShowStartCallFragment.toggle()
|
||||||
isShowStartCallFragment.toggle()
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||||
telecomManager.callStarted = false
|
telecomManager.callStarted = false
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
telecomManager.callStarted = true
|
telecomManager.callStarted = true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
callViewModel.transferClicked()
|
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
|
|
@ -2061,7 +2057,7 @@ struct CallView: View {
|
||||||
.background(Color.gray500)
|
.background(Color.gray500)
|
||||||
.cornerRadius(40)
|
.cornerRadius(40)
|
||||||
|
|
||||||
Text(callViewModel.callsCounter < 2 ? "call_action_blind_transfer" : "call_action_attended_transfer")
|
Text("call_action_blind_transfer")
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(.white)
|
||||||
.default_text_style(styleSize: 15)
|
.default_text_style(styleSize: 15)
|
||||||
}
|
}
|
||||||
|
|
@ -2402,21 +2398,17 @@ struct CallView: View {
|
||||||
if callViewModel.isOneOneCall {
|
if callViewModel.isOneOneCall {
|
||||||
VStack {
|
VStack {
|
||||||
Button {
|
Button {
|
||||||
if callViewModel.callsCounter < 2 {
|
withAnimation {
|
||||||
withAnimation {
|
callViewModel.isTransferInsteadCall = true
|
||||||
callViewModel.isTransferInsteadCall = true
|
MagicSearchSingleton.shared.searchForSuggestions()
|
||||||
MagicSearchSingleton.shared.searchForSuggestions()
|
isShowStartCallFragment.toggle()
|
||||||
isShowStartCallFragment.toggle()
|
}
|
||||||
}
|
|
||||||
|
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||||
telecomManager.callStarted = false
|
telecomManager.callStarted = false
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||||
telecomManager.callStarted = true
|
telecomManager.callStarted = true
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
callViewModel.transferClicked()
|
|
||||||
}
|
}
|
||||||
} label: {
|
} label: {
|
||||||
HStack {
|
HStack {
|
||||||
|
|
@ -2432,7 +2424,7 @@ struct CallView: View {
|
||||||
.background(Color.gray500)
|
.background(Color.gray500)
|
||||||
.cornerRadius(40)
|
.cornerRadius(40)
|
||||||
|
|
||||||
Text(callViewModel.callsCounter < 2 ? "call_action_blind_transfer" : "call_action_attended_transfer")
|
Text("call_action_blind_transfer")
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(.white)
|
||||||
.default_text_style(styleSize: 15)
|
.default_text_style(styleSize: 15)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,20 +165,20 @@ struct CallsListFragment: View {
|
||||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||||
callViewModel.resetCallView()
|
callViewModel.resetCallView()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, label: {
|
}, label: {
|
||||||
HStack {
|
HStack {
|
||||||
HStack {
|
HStack {
|
||||||
Image((callViewModel.selectedCall!.state == .PausedByRemote
|
Image((callViewModel.selectedCall!.state == .PausedByRemote
|
||||||
|| callViewModel.selectedCall!.state == .Pausing
|
|| callViewModel.selectedCall!.state == .Pausing
|
||||||
|| callViewModel.selectedCall!.state == .Paused) ? String(localized: "call_action_resume_call") : String(localized: "call_action_pause_call"))
|
|| callViewModel.selectedCall!.state == .Paused) ? String(localized: "call_action_resume_call") : String(localized: "call_action_pause_call"))
|
||||||
.resizable()
|
.resizable()
|
||||||
.frame(width: 30, height: 30)
|
.frame(width: 30, height: 30)
|
||||||
|
|
||||||
}
|
}
|
||||||
.frame(width: 35, height: 30)
|
.frame(width: 35, height: 30)
|
||||||
.background(.clear)
|
.background(.clear)
|
||||||
.cornerRadius(40)
|
.cornerRadius(40)
|
||||||
|
|
||||||
Text((callViewModel.selectedCall!.state == .PausedByRemote
|
Text((callViewModel.selectedCall!.state == .PausedByRemote
|
||||||
|| callViewModel.selectedCall!.state == .Pausing
|
|| callViewModel.selectedCall!.state == .Pausing
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,98 @@ struct StartCallFragment: View {
|
||||||
.background(.white)
|
.background(.white)
|
||||||
|
|
||||||
VStack(spacing: 0) {
|
VStack(spacing: 0) {
|
||||||
|
if callViewModel.isTransferInsteadCall {
|
||||||
|
VStack {
|
||||||
|
HStack(alignment: .center) {
|
||||||
|
Text("contacts_list_all_contacts_title")
|
||||||
|
.default_text_style_800(styleSize: 16)
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.padding(.vertical, 10)
|
||||||
|
.padding(.horizontal, 16)
|
||||||
|
|
||||||
|
if callViewModel.calls.count > 1 {
|
||||||
|
ForEach(0..<callViewModel.calls.count, id: \.self) { index in
|
||||||
|
HStack {
|
||||||
|
HStack {
|
||||||
|
if callViewModel.calls[index].callLog != nil && callViewModel.calls[index].callLog!.remoteAddress != nil {
|
||||||
|
if callViewModel.callsContactAvatarModel[index] != nil && callViewModel.calls[index].callLog?.conferenceInfo == nil {
|
||||||
|
Avatar(contactAvatarModel: callViewModel.callsContactAvatarModel[index]!, avatarSize: 50)
|
||||||
|
} else {
|
||||||
|
VStack {
|
||||||
|
Image("users-three-square")
|
||||||
|
.renderingMode(.template)
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 28, height: 28)
|
||||||
|
.foregroundStyle(Color.grayMain2c600)
|
||||||
|
}
|
||||||
|
.frame(width: 50, height: 50)
|
||||||
|
.background(Color.grayMain2c200)
|
||||||
|
.clipShape(Circle())
|
||||||
|
}
|
||||||
|
|
||||||
|
if callViewModel.calls[index].callLog?.conferenceInfo == nil {
|
||||||
|
Text(callViewModel.callsContactAvatarModel[index]!.name)
|
||||||
|
.default_text_style(styleSize: 16)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.lineLimit(1)
|
||||||
|
} else {
|
||||||
|
Text(callViewModel.calls[index].callLog!.conferenceInfo!.subject ?? String(localized: "conference_name_error"))
|
||||||
|
.default_text_style(styleSize: 16)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
.lineLimit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
HStack {
|
||||||
|
if callViewModel.calls[index].state == .PausedByRemote
|
||||||
|
|| callViewModel.calls[index].state == .Pausing
|
||||||
|
|| callViewModel.calls[index].state == .Paused
|
||||||
|
|| callViewModel.calls[index].state == .Resuming {
|
||||||
|
Text(callViewModel.calls[index].state == .Resuming ? String(localized: "call_state_resuming") : String(localized: "call_state_paused"))
|
||||||
|
.default_text_style_300(styleSize: 14)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||||
|
.lineLimit(1)
|
||||||
|
.padding(.horizontal, 4)
|
||||||
|
|
||||||
|
Image("pause")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 25, height: 25)
|
||||||
|
} else {
|
||||||
|
Text("call_state_connected")
|
||||||
|
.default_text_style_300(styleSize: 14)
|
||||||
|
.frame(maxWidth: .infinity, alignment: .trailing)
|
||||||
|
.lineLimit(1)
|
||||||
|
.padding(.horizontal, 4)
|
||||||
|
|
||||||
|
Image("phone-call")
|
||||||
|
.resizable()
|
||||||
|
.frame(width: 25, height: 25)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.buttonStyle(.borderless)
|
||||||
|
.listRowInsets(EdgeInsets(top: 10, leading: 20, bottom: 10, trailing: 20))
|
||||||
|
.listRowSeparator(.hidden)
|
||||||
|
.background(.white)
|
||||||
|
.onTapGesture {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
HStack(alignment: .center) {
|
||||||
|
Text("contacts_list_all_contacts_title")
|
||||||
|
.default_text_style_800(styleSize: 16)
|
||||||
|
}
|
||||||
|
.padding(.vertical, 10)
|
||||||
|
.padding(.horizontal, 16)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ZStack(alignment: .trailing) {
|
ZStack(alignment: .trailing) {
|
||||||
TextField("history_call_start_search_bar_filter_hint", text: $startCallViewModel.searchField)
|
TextField("history_call_start_search_bar_filter_hint", text: $startCallViewModel.searchField)
|
||||||
.default_text_style(styleSize: 15)
|
.default_text_style(styleSize: 15)
|
||||||
|
|
@ -170,41 +262,44 @@ struct StartCallFragment: View {
|
||||||
.padding(.vertical)
|
.padding(.vertical)
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
|
|
||||||
NavigationLink(destination: {
|
|
||||||
StartGroupCallFragment(startCallViewModel: startCallViewModel)
|
if !callViewModel.isTransferInsteadCall {
|
||||||
}, label: {
|
NavigationLink(destination: {
|
||||||
HStack {
|
StartGroupCallFragment(startCallViewModel: startCallViewModel)
|
||||||
HStack(alignment: .center) {
|
}, label: {
|
||||||
Image("meetings")
|
HStack {
|
||||||
|
HStack(alignment: .center) {
|
||||||
|
Image("meetings")
|
||||||
|
.renderingMode(.template)
|
||||||
|
.resizable()
|
||||||
|
.foregroundStyle(.white)
|
||||||
|
.frame(width: 20, height: 20, alignment: .leading)
|
||||||
|
}
|
||||||
|
.padding(16)
|
||||||
|
.background(Color.orangeMain500)
|
||||||
|
.cornerRadius(40)
|
||||||
|
|
||||||
|
Text("history_call_start_create_group_call")
|
||||||
|
.foregroundStyle(.black)
|
||||||
|
.default_text_style_800(styleSize: 16)
|
||||||
|
|
||||||
|
Spacer()
|
||||||
|
|
||||||
|
Image("caret-right")
|
||||||
.renderingMode(.template)
|
.renderingMode(.template)
|
||||||
.resizable()
|
.resizable()
|
||||||
.foregroundStyle(.white)
|
.foregroundStyle(Color.grayMain2c500)
|
||||||
.frame(width: 20, height: 20, alignment: .leading)
|
.frame(width: 25, height: 25, alignment: .leading)
|
||||||
}
|
}
|
||||||
.padding(16)
|
})
|
||||||
.background(Color.orangeMain500)
|
.padding(.vertical, 10)
|
||||||
.cornerRadius(40)
|
.padding(.horizontal, 20)
|
||||||
|
.background(
|
||||||
Text("history_call_start_create_group_call")
|
LinearGradient(gradient: Gradient(colors: [.grayMain2c100, .white]), startPoint: .leading, endPoint: .trailing)
|
||||||
.foregroundStyle(.black)
|
.padding(.vertical, 10)
|
||||||
.default_text_style_800(styleSize: 16)
|
.padding(.horizontal, 40)
|
||||||
|
)
|
||||||
Spacer()
|
}
|
||||||
|
|
||||||
Image("caret-right")
|
|
||||||
.renderingMode(.template)
|
|
||||||
.resizable()
|
|
||||||
.foregroundStyle(Color.grayMain2c500)
|
|
||||||
.frame(width: 25, height: 25, alignment: .leading)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.padding(.vertical, 10)
|
|
||||||
.padding(.horizontal, 20)
|
|
||||||
.background(
|
|
||||||
LinearGradient(gradient: Gradient(colors: [.grayMain2c100, .white]), startPoint: .leading, endPoint: .trailing)
|
|
||||||
.padding(.vertical, 10)
|
|
||||||
.padding(.horizontal, 40)
|
|
||||||
)
|
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
if !ContactsManager.shared.lastSearch.isEmpty {
|
if !ContactsManager.shared.lastSearch.isEmpty {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue