mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Various conference adjustments
This commit is contained in:
parent
deb4fbb71e
commit
1f2aa259be
7 changed files with 88 additions and 56 deletions
|
|
@ -215,7 +215,7 @@ class ConferenceSchedulingViewModel {
|
|||
if (scheduleForLater.value == true) {
|
||||
let timestamp = getConferenceStartTimestamp()
|
||||
conferenceInfo.dateTime = time_t(timestamp)
|
||||
scheduledDuration.value.map {conferenceInfo.duration = UInt($0) }
|
||||
scheduledDuration.value.map { conferenceInfo.duration = UInt(ConferenceSchedulingViewModel.durationList[$0].value) }
|
||||
}
|
||||
conferenceScheduler?.info = conferenceInfo // Will trigger the conference creation automatically
|
||||
|
||||
|
|
@ -232,8 +232,11 @@ class ConferenceSchedulingViewModel {
|
|||
|
||||
|
||||
private func getConferenceStartTimestamp() -> Double {
|
||||
return scheduleForLater.value == true ? scheduledDate.value!.timeIntervalSince1970 + scheduledTime.value!.timeIntervalSince1970 : Date().timeIntervalSince1970
|
||||
|
||||
return scheduleForLater.value == true ?
|
||||
scheduledDate.value!.timeIntervalSince1970 +
|
||||
scheduledTime.value!.timeIntervalSince1970 - Calendar.current.startOfDay(for: scheduledTime.value!).timeIntervalSince1970 +
|
||||
Double(ConferenceSchedulingViewModel.timeZones[scheduledTimeZone.value!].timeZone.secondsFromGMT()-TimeZone.current.secondsFromGMT())
|
||||
: Date().timeIntervalSince1970
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -27,8 +27,14 @@ import SVProgressHUD
|
|||
|
||||
let CONFERENCE_CREATION_TIME_OUT_SEC = 15.0
|
||||
|
||||
let viewModel = ConferenceSchedulingViewModel.shared
|
||||
let participantsListTableView = UITableView()
|
||||
|
||||
let datePicker = StyledDatePicker(liveValue: ConferenceSchedulingViewModel.shared.scheduledDate,pickerMode: .date, readOnly:true)
|
||||
let timeZoneValue = StyledValuePicker(liveIndex: ConferenceSchedulingViewModel.shared.scheduledTimeZone,options: ConferenceSchedulingViewModel.timeZones.map({ (tzd: TimeZoneData) -> String in tzd.descWithOffset()}), readOnly:true)
|
||||
let durationValue = StyledValuePicker(liveIndex: ConferenceSchedulingViewModel.shared.scheduledDuration,options: ConferenceSchedulingViewModel.durationList.map({ (duration: Duration) -> String in duration.display}), readOnly:true)
|
||||
let timePicker = StyledDatePicker(liveValue: ConferenceSchedulingViewModel.shared.scheduledTime,pickerMode: .time, readOnly:true)
|
||||
let descriptionInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_description_hint,liveValue: ConferenceSchedulingViewModel.shared.description, readOnly:true)
|
||||
|
||||
|
||||
static let compositeDescription = UICompositeViewDescription(ConferenceSchedulingSummaryView.self, statusBar: StatusBarView.self, tabBar: nil, sideMenu: SideMenuView.self, fullscreen: false, isLeftFragment: false,fragmentWith: nil)
|
||||
static func compositeViewDescription() -> UICompositeViewDescription! { return compositeDescription }
|
||||
|
|
@ -41,7 +47,7 @@ import SVProgressHUD
|
|||
self.goBackParticipantsListSelection()
|
||||
},nextAction: {
|
||||
},
|
||||
nextActionEnableCondition: viewModel.continueEnabled,
|
||||
nextActionEnableCondition: ConferenceSchedulingViewModel.shared.continueEnabled,
|
||||
title:VoipTexts.conference_schedule_summary)
|
||||
super.nextButton.isHidden = true
|
||||
|
||||
|
|
@ -53,12 +59,12 @@ import SVProgressHUD
|
|||
encryptedIcon.contentMode = .scaleAspectFit
|
||||
contentView.addSubview(encryptedIcon)
|
||||
encryptedIcon.height(form_input_height).alignParentTop().alignParentTop().alignParentRight(withMargin: form_margin).alignHorizontalCenterWith(subjectLabel).done()
|
||||
viewModel.isEncrypted.readCurrentAndObserve { (encrypt) in
|
||||
ConferenceSchedulingViewModel.shared.isEncrypted.readCurrentAndObserve { (encrypt) in
|
||||
encryptedIcon.isHidden = encrypt != true
|
||||
}
|
||||
|
||||
|
||||
let subjectInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_subject_hint, liveValue: viewModel.subject, readOnly:true)
|
||||
let subjectInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_subject_hint, liveValue: ConferenceSchedulingViewModel.shared.subject, readOnly:true)
|
||||
contentView.addSubview(subjectInput)
|
||||
subjectInput.alignUnder(view: subjectLabel,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).height(form_input_height).done()
|
||||
|
||||
|
|
@ -72,7 +78,7 @@ import SVProgressHUD
|
|||
let scheduleForm = UIView()
|
||||
schedulingStack.addArrangedSubview(scheduleForm)
|
||||
scheduleForm.matchParentSideBorders().done()
|
||||
viewModel.scheduleForLater.readCurrentAndObserve { (forLater) in scheduleForm.isHidden = forLater != true }
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { (forLater) in scheduleForm.isHidden = forLater != true }
|
||||
|
||||
// Left column (Date & Time)
|
||||
let leftColumn = UIView()
|
||||
|
|
@ -83,7 +89,6 @@ import SVProgressHUD
|
|||
leftColumn.addSubview(dateLabel)
|
||||
dateLabel.alignParentLeft().alignParentTop(withMargin: form_margin).done()
|
||||
|
||||
let datePicker = StyledDatePicker(liveValue: viewModel.scheduledDate,pickerMode: .date, readOnly:true)
|
||||
leftColumn.addSubview(datePicker)
|
||||
datePicker.alignParentLeft().alignUnder(view: dateLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -91,7 +96,6 @@ import SVProgressHUD
|
|||
leftColumn.addSubview(timeLabel)
|
||||
timeLabel.alignParentLeft().alignUnder(view: datePicker,withMargin: form_margin).done()
|
||||
|
||||
let timePicker = StyledDatePicker(liveValue: viewModel.scheduledTime,pickerMode: .time, readOnly:true)
|
||||
leftColumn.addSubview(timePicker)
|
||||
timePicker.alignParentLeft().alignUnder(view: timeLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -107,7 +111,6 @@ import SVProgressHUD
|
|||
rightColumn.addSubview(durationLabel)
|
||||
durationLabel.alignParentLeft().alignParentTop(withMargin: form_margin).done()
|
||||
|
||||
let durationValue = StyledValuePicker(liveIndex: viewModel.scheduledDuration,options: ConferenceSchedulingViewModel.durationList.map({ (duration: Duration) -> String in duration.display}), readOnly:true)
|
||||
rightColumn.addSubview(durationValue)
|
||||
durationValue.alignParentLeft().alignUnder(view: durationLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -115,7 +118,6 @@ import SVProgressHUD
|
|||
rightColumn.addSubview(timeZoneLabel)
|
||||
timeZoneLabel.alignParentLeft().alignUnder(view: durationValue,withMargin: form_margin).done()
|
||||
|
||||
let timeZoneValue = StyledValuePicker(liveIndex: viewModel.scheduledTimeZone,options: ConferenceSchedulingViewModel.timeZones.map({ (tzd: TimeZoneData) -> String in tzd.descWithOffset()}), readOnly:true)
|
||||
rightColumn.addSubview(timeZoneValue)
|
||||
timeZoneValue.alignParentLeft().alignUnder(view: timeZoneLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -126,7 +128,6 @@ import SVProgressHUD
|
|||
scheduleForm.addSubview(descriptionLabel)
|
||||
descriptionLabel.alignUnder(view: leftColumn,withMargin: form_margin).alignUnder(view: rightColumn,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).done()
|
||||
|
||||
let descriptionInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_description_hint,liveValue: viewModel.description, readOnly:true)
|
||||
descriptionInput.textContainer.maximumNumberOfLines = 5
|
||||
descriptionInput.textContainer.lineBreakMode = .byWordWrapping
|
||||
scheduleForm.addSubview(descriptionInput)
|
||||
|
|
@ -138,7 +139,7 @@ import SVProgressHUD
|
|||
let viaChatLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_send_invite_chat_summary)
|
||||
contentView.addSubview(viaChatLabel)
|
||||
viaChatLabel.matchParentSideBorders(insetedByDx: form_margin).alignUnder(view: schedulingStack,withMargin: 2*form_margin).done()
|
||||
viewModel.sendInviteViaChat.readCurrentAndObserve { (sendChat) in
|
||||
ConferenceSchedulingViewModel.shared.sendInviteViaChat.readCurrentAndObserve { (sendChat) in
|
||||
viaChatLabel.isHidden = sendChat != true
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +162,7 @@ import SVProgressHUD
|
|||
participantsListTableView.separatorStyle = .singleLine
|
||||
participantsListTableView.separatorColor = VoipTheme.light_grey_color
|
||||
|
||||
viewModel.selectedAddresses.readCurrentAndObserve { (addresses) in
|
||||
ConferenceSchedulingViewModel.shared.selectedAddresses.readCurrentAndObserve { (addresses) in
|
||||
self.participantsListTableView.reloadData()
|
||||
self.participantsListTableView.removeConstraints().done()
|
||||
self.participantsListTableView.matchParentSideBorders().alignUnder(view: participantsLabel,withMargin: self.form_margin).done()
|
||||
|
|
@ -171,12 +172,12 @@ import SVProgressHUD
|
|||
// Create / Schedule
|
||||
let createButton = FormButton(backgroundStateColors: VoipTheme.primary_colors_background)
|
||||
contentView.addSubview(createButton)
|
||||
viewModel.scheduleForLater.readCurrentAndObserve { _ in
|
||||
createButton.title = self.viewModel.scheduleForLater.value == true ? VoipTexts.conference_schedule.uppercased() : VoipTexts.conference_schedule_create.uppercased()
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { _ in
|
||||
createButton.title = ConferenceSchedulingViewModel.shared.scheduleForLater.value == true ? VoipTexts.conference_schedule.uppercased() : VoipTexts.conference_schedule_create.uppercased()
|
||||
createButton.addSidePadding()
|
||||
}
|
||||
|
||||
self.viewModel.conferenceCreationInProgress.observe { progress in
|
||||
ConferenceSchedulingViewModel.shared.conferenceCreationInProgress.observe { progress in
|
||||
if (progress == true) {
|
||||
SVProgressHUD.show()
|
||||
} else {
|
||||
|
|
@ -186,9 +187,9 @@ import SVProgressHUD
|
|||
|
||||
var enableCreationTimeOut = false
|
||||
|
||||
viewModel.conferenceCreationCompletedEvent.observe { pair in
|
||||
ConferenceSchedulingViewModel.shared.conferenceCreationCompletedEvent.observe { pair in
|
||||
enableCreationTimeOut = false
|
||||
if (self.viewModel.scheduleForLater.value == true) {
|
||||
if (ConferenceSchedulingViewModel.shared.scheduleForLater.value == true) {
|
||||
PhoneMainView.instance().pop(toView:ScheduledConferencesView.compositeDescription)
|
||||
} else {
|
||||
let view: ConferenceWaitingRoomFragment = self.VIEW(ConferenceWaitingRoomFragment.compositeViewDescription());
|
||||
|
|
@ -196,34 +197,43 @@ import SVProgressHUD
|
|||
view.setDetails(subject: pair!.second!, url: pair!.first!)
|
||||
}
|
||||
}
|
||||
viewModel.onErrorEvent.observe { error in
|
||||
ConferenceSchedulingViewModel.shared.onErrorEvent.observe { error in
|
||||
VoipDialog.init(message: error!).show()
|
||||
}
|
||||
createButton.onClick {
|
||||
enableCreationTimeOut = true
|
||||
self.viewModel.createConference()
|
||||
ConferenceSchedulingViewModel.shared.createConference()
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + self.CONFERENCE_CREATION_TIME_OUT_SEC) {
|
||||
if (enableCreationTimeOut) {
|
||||
enableCreationTimeOut = false
|
||||
self.viewModel.conferenceCreationInProgress.value = false
|
||||
self.viewModel.onErrorEvent.value = VoipTexts.call_error_server_timeout
|
||||
ConferenceSchedulingViewModel.shared.conferenceCreationInProgress.value = false
|
||||
ConferenceSchedulingViewModel.shared.onErrorEvent.value = VoipTexts.call_error_server_timeout
|
||||
}
|
||||
}
|
||||
}
|
||||
viewModel.scheduleForLater.readCurrentAndObserve { _ in
|
||||
createButton.title = self.viewModel.scheduleForLater.value == true ? VoipTexts.conference_schedule.uppercased() : VoipTexts.conference_schedule_create.uppercased()
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { _ in
|
||||
createButton.title = ConferenceSchedulingViewModel.shared.scheduleForLater.value == true ? VoipTexts.conference_schedule.uppercased() : VoipTexts.conference_schedule_create.uppercased()
|
||||
createButton.addSidePadding()
|
||||
}
|
||||
|
||||
createButton.centerX().alignParentBottom(withMargin: 3*self.form_margin).alignUnder(view: participantsListTableView,withMargin: 3*self.form_margin).done()
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
datePicker.liveValue = ConferenceSchedulingViewModel.shared.scheduledDate
|
||||
timeZoneValue.setIndex(index: ConferenceSchedulingViewModel.shared.scheduledTimeZone.value!)
|
||||
durationValue.setIndex(index: ConferenceSchedulingViewModel.shared.scheduledDuration.value!)
|
||||
timePicker.liveValue = ConferenceSchedulingViewModel.shared.scheduledTime
|
||||
descriptionInput.text = ConferenceSchedulingViewModel.shared.description.value
|
||||
super.viewWillAppear(animated)
|
||||
}
|
||||
|
||||
|
||||
|
||||
func goBackParticipantsListSelection() {
|
||||
let view: ChatConversationCreateView = VIEW(ChatConversationCreateView.compositeViewDescription())
|
||||
let addresses = viewModel.selectedAddresses.value!.map { (address) in String(address.asStringUriOnly()) }
|
||||
let addresses = ConferenceSchedulingViewModel.shared.selectedAddresses.value!.map { (address) in String(address.asStringUriOnly()) }
|
||||
view.tableController.contactsGroup = (addresses as NSArray).mutableCopy() as? NSMutableArray
|
||||
view.tableController.notFirstTime = true
|
||||
view.isForEditing = false
|
||||
|
|
@ -233,17 +243,17 @@ import SVProgressHUD
|
|||
|
||||
// Objc - bridge, as can't access easily to the view model.
|
||||
@objc func setParticipants(addresses:[String]) {
|
||||
viewModel.selectedAddresses.value = []
|
||||
ConferenceSchedulingViewModel.shared.selectedAddresses.value = []
|
||||
return addresses.forEach { (address) in
|
||||
if let address = try?Factory.Instance.createAddress(addr: address) {
|
||||
viewModel.selectedAddresses.value?.append(address)
|
||||
ConferenceSchedulingViewModel.shared.selectedAddresses.value?.append(address)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TableView datasource delegate
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
guard let participants = viewModel.selectedAddresses.value else {
|
||||
guard let participants = ConferenceSchedulingViewModel.shared.selectedAddresses.value else {
|
||||
return 0
|
||||
}
|
||||
return participants.count
|
||||
|
|
@ -251,12 +261,12 @@ import SVProgressHUD
|
|||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell:VoipParticipantCell = tableView.dequeueReusableCell(withIdentifier: "VoipParticipantCellSSchedule") as! VoipParticipantCell
|
||||
guard let participant = viewModel.selectedAddresses.value?[indexPath.row] else {
|
||||
guard let participant = ConferenceSchedulingViewModel.shared.selectedAddresses.value?[indexPath.row] else {
|
||||
return cell
|
||||
}
|
||||
cell.selectionStyle = .none
|
||||
cell.scheduleConfParticipantAddress = participant
|
||||
cell.limeBadge.isHidden = viewModel.isEncrypted.value != true
|
||||
cell.limeBadge.isHidden = ConferenceSchedulingViewModel.shared.isEncrypted.value != true
|
||||
return cell
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,12 +24,18 @@ import linphonesw
|
|||
|
||||
@objc class ConferenceSchedulingView: BackNextNavigationView, UICompositeViewDelegate {
|
||||
|
||||
let viewModel = ConferenceSchedulingViewModel.shared
|
||||
|
||||
static let compositeDescription = UICompositeViewDescription(ConferenceSchedulingView.self, statusBar: StatusBarView.self, tabBar: nil, sideMenu: SideMenuView.self, fullscreen: false, isLeftFragment: false,fragmentWith: nil)
|
||||
static func compositeViewDescription() -> UICompositeViewDescription! { return compositeDescription }
|
||||
func compositeViewDescription() -> UICompositeViewDescription! { return type(of: self).compositeDescription }
|
||||
|
||||
let datePicker = StyledDatePicker(liveValue: ConferenceSchedulingViewModel.shared.scheduledDate,pickerMode: .date)
|
||||
let timeZoneValue = StyledValuePicker(liveIndex: ConferenceSchedulingViewModel.shared.scheduledTimeZone,options: ConferenceSchedulingViewModel.timeZones.map({ (tzd: TimeZoneData) -> String in tzd.descWithOffset()}))
|
||||
let durationValue = StyledValuePicker(liveIndex: ConferenceSchedulingViewModel.shared.scheduledDuration,options: ConferenceSchedulingViewModel.durationList.map({ (duration: Duration) -> String in duration.display}))
|
||||
let timePicker = StyledDatePicker(liveValue: ConferenceSchedulingViewModel.shared.scheduledTime,pickerMode: .time)
|
||||
let descriptionInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_description_hint,liveValue: ConferenceSchedulingViewModel.shared.description)
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
||||
super.viewDidLoad(
|
||||
|
|
@ -38,7 +44,7 @@ import linphonesw
|
|||
},nextAction: {
|
||||
self.gotoParticipantsListSelection()
|
||||
},
|
||||
nextActionEnableCondition: viewModel.continueEnabled,
|
||||
nextActionEnableCondition: ConferenceSchedulingViewModel.shared.continueEnabled,
|
||||
title:VoipTexts.conference_schedule_title)
|
||||
|
||||
let subjectLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_subject_title)
|
||||
|
|
@ -46,7 +52,7 @@ import linphonesw
|
|||
contentView.addSubview(subjectLabel)
|
||||
subjectLabel.alignParentLeft(withMargin: form_margin).alignParentTop().done()
|
||||
|
||||
let subjectInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_subject_hint, liveValue: viewModel.subject,maxLines:1)
|
||||
let subjectInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_subject_hint, liveValue: ConferenceSchedulingViewModel.shared.subject,maxLines:1)
|
||||
contentView.addSubview(subjectInput)
|
||||
subjectInput.alignUnder(view: subjectLabel,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).height(form_input_height).done()
|
||||
|
||||
|
|
@ -60,7 +66,7 @@ import linphonesw
|
|||
schedulingStack.addArrangedSubview(scheduleForLater)
|
||||
scheduleForLater.matchParentSideBorders().height(schdule_for_later_height).done()
|
||||
|
||||
let laterSwitch = StyledSwitch(liveValue: viewModel.scheduleForLater)
|
||||
let laterSwitch = StyledSwitch(liveValue: ConferenceSchedulingViewModel.shared.scheduleForLater)
|
||||
scheduleForLater.addSubview(laterSwitch)
|
||||
laterSwitch.alignParentTop(withMargin: form_margin*2.5).alignParentLeft(withMargin: form_margin).centerY().done()
|
||||
|
||||
|
|
@ -72,7 +78,7 @@ import linphonesw
|
|||
let scheduleForm = UIView()
|
||||
schedulingStack.addArrangedSubview(scheduleForm)
|
||||
scheduleForm.matchParentSideBorders().done()
|
||||
viewModel.scheduleForLater.readCurrentAndObserve { (forLater) in scheduleForm.isHidden = forLater != true }
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { (forLater) in scheduleForm.isHidden = forLater != true }
|
||||
|
||||
// Left column (Date & Time)
|
||||
let leftColumn = UIView()
|
||||
|
|
@ -84,7 +90,6 @@ import linphonesw
|
|||
leftColumn.addSubview(dateLabel)
|
||||
dateLabel.alignParentLeft().alignParentTop(withMargin: form_margin).done()
|
||||
|
||||
let datePicker = StyledDatePicker(liveValue: viewModel.scheduledDate,pickerMode: .date)
|
||||
leftColumn.addSubview(datePicker)
|
||||
datePicker.alignParentLeft().alignUnder(view: dateLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -93,7 +98,6 @@ import linphonesw
|
|||
leftColumn.addSubview(timeLabel)
|
||||
timeLabel.alignParentLeft().alignUnder(view: datePicker,withMargin: form_margin).done()
|
||||
|
||||
let timePicker = StyledDatePicker(liveValue: viewModel.scheduledTime,pickerMode: .time)
|
||||
leftColumn.addSubview(timePicker)
|
||||
timePicker.alignParentLeft().alignUnder(view: timeLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -109,7 +113,6 @@ import linphonesw
|
|||
rightColumn.addSubview(durationLabel)
|
||||
durationLabel.alignParentLeft().alignParentTop(withMargin: form_margin).done()
|
||||
|
||||
let durationValue = StyledValuePicker(liveIndex: viewModel.scheduledDuration,options: ConferenceSchedulingViewModel.durationList.map({ (duration: Duration) -> String in duration.display}))
|
||||
rightColumn.addSubview(durationValue)
|
||||
durationValue.alignParentLeft().alignUnder(view: durationLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -117,7 +120,6 @@ import linphonesw
|
|||
rightColumn.addSubview(timeZoneLabel)
|
||||
timeZoneLabel.alignParentLeft().alignUnder(view: durationValue,withMargin: form_margin).done()
|
||||
|
||||
let timeZoneValue = StyledValuePicker(liveIndex: viewModel.scheduledTimeZone,options: ConferenceSchedulingViewModel.timeZones.map({ (tzd: TimeZoneData) -> String in tzd.descWithOffset()}))
|
||||
rightColumn.addSubview(timeZoneValue)
|
||||
timeZoneValue.alignParentLeft().alignUnder(view: timeZoneLabel,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
|
|
@ -128,7 +130,6 @@ import linphonesw
|
|||
scheduleForm.addSubview(descriptionLabel)
|
||||
descriptionLabel.alignUnder(view: leftColumn,withMargin: form_margin).alignUnder(view: rightColumn,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).done()
|
||||
|
||||
let descriptionInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_description_hint,liveValue: viewModel.description)
|
||||
descriptionInput.textContainer.maximumNumberOfLines = 5
|
||||
descriptionInput.textContainer.lineBreakMode = .byWordWrapping
|
||||
scheduleForm.addSubview(descriptionInput)
|
||||
|
|
@ -137,7 +138,7 @@ import linphonesw
|
|||
scheduleForm.wrapContentY().done()
|
||||
|
||||
// Sending methods
|
||||
let viaChatSwitch = StyledCheckBox(liveValue: viewModel.sendInviteViaChat)
|
||||
let viaChatSwitch = StyledCheckBox(liveValue: ConferenceSchedulingViewModel.shared.sendInviteViaChat)
|
||||
contentView.addSubview(viaChatSwitch)
|
||||
viaChatSwitch.alignParentLeft(withMargin: form_margin).alignUnder(view: schedulingStack,withMargin: 2*form_margin).done()
|
||||
|
||||
|
|
@ -145,7 +146,7 @@ import linphonesw
|
|||
contentView.addSubview(viaChatLabel)
|
||||
viaChatLabel.toRightOf(viaChatSwitch,withLeftMargin: form_margin).alignUnder(view: schedulingStack,withMargin: 2*form_margin).alignHorizontalCenterWith(viaChatSwitch).done()
|
||||
|
||||
let viaMailSwitch = StyledCheckBox(liveValue: viewModel.sendInviteViaEmail)
|
||||
let viaMailSwitch = StyledCheckBox(liveValue: ConferenceSchedulingViewModel.shared.sendInviteViaEmail)
|
||||
contentView.addSubview(viaMailSwitch)
|
||||
viaMailSwitch.alignParentLeft(withMargin: form_margin).alignUnder(view: viaChatSwitch,withMargin: 2*form_margin).done()
|
||||
|
||||
|
|
@ -167,7 +168,7 @@ import linphonesw
|
|||
unencryptedIcon.contentMode = .scaleAspectFit
|
||||
encryptCombo.addArrangedSubview(unencryptedIcon)
|
||||
|
||||
let encryptSwitch = StyledSwitch(liveValue: viewModel.isEncrypted)
|
||||
let encryptSwitch = StyledSwitch(liveValue: ConferenceSchedulingViewModel.shared.isEncrypted)
|
||||
encryptCombo.addArrangedSubview(encryptSwitch)
|
||||
encryptSwitch.centerY().alignParentTop(withMargin: form_margin).done()
|
||||
|
||||
|
|
@ -188,9 +189,19 @@ import linphonesw
|
|||
|
||||
}
|
||||
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
super.viewWillAppear(animated)
|
||||
datePicker.liveValue = ConferenceSchedulingViewModel.shared.scheduledDate
|
||||
timeZoneValue.setIndex(index: ConferenceSchedulingViewModel.shared.scheduledTimeZone.value!)
|
||||
durationValue.setIndex(index: ConferenceSchedulingViewModel.shared.scheduledDuration.value!)
|
||||
timePicker.liveValue = ConferenceSchedulingViewModel.shared.scheduledTime
|
||||
descriptionInput.text = ConferenceSchedulingViewModel.shared.description.value
|
||||
}
|
||||
|
||||
func gotoParticipantsListSelection() {
|
||||
let view: ChatConversationCreateView = self.VIEW(ChatConversationCreateView.compositeViewDescription());
|
||||
let addresses = viewModel.selectedAddresses.value!.map { (address) in String(address.asStringUriOnly()) }
|
||||
let addresses = ConferenceSchedulingViewModel.shared.selectedAddresses.value!.map { (address) in String(address.asStringUriOnly()) }
|
||||
view.tableController.contactsGroup = (addresses as NSArray).mutableCopy() as? NSMutableArray
|
||||
view.isForEditing = false
|
||||
view.isForVoipConference = true
|
||||
|
|
@ -201,6 +212,6 @@ import linphonesw
|
|||
}
|
||||
|
||||
@objc func resetViewModel() {
|
||||
viewModel.reset()
|
||||
ConferenceSchedulingViewModel.shared.reset()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ class ScheduledConferencesCell: UITableViewCell {
|
|||
contentView.addSubview(participantsIcon)
|
||||
participantsIcon.alignUnder(view: subject,withMargin: 15).square(15).alignParentLeft(withMargin: 10).done()
|
||||
|
||||
infoConf.onClick {
|
||||
//infoConf.onClick {
|
||||
contentView.onClick {
|
||||
self.conferenceData?.toggleExpand()
|
||||
self.owningTableView?.reloadData()
|
||||
}
|
||||
|
|
@ -161,6 +162,7 @@ class ScheduledConferencesCell: UITableViewCell {
|
|||
joinEditDelete.addArrangedSubview(editConf)
|
||||
editConf.onClick {
|
||||
// TODO
|
||||
VoipDialog.toast(message: "not available yet")
|
||||
}
|
||||
|
||||
joinEditDelete.addArrangedSubview(deleteConf)
|
||||
|
|
|
|||
|
|
@ -37,9 +37,10 @@ import linphonesw
|
|||
backAction: {
|
||||
PhoneMainView.instance().popView(self.compositeViewDescription())
|
||||
},nextAction: {
|
||||
ConferenceSchedulingViewModel.shared.reset()
|
||||
PhoneMainView.instance().changeCurrentView(ConferenceSchedulingView.compositeDescription)
|
||||
},
|
||||
nextActionEnableCondition: MutableLiveData(true),
|
||||
nextActionEnableCondition: MutableLiveData(),
|
||||
title:VoipTexts.conference_scheduled)
|
||||
|
||||
super.nextButton.applyTintedIcons(tintedIcons: VoipTheme.conference_create_button)
|
||||
|
|
@ -70,6 +71,7 @@ import linphonesw
|
|||
self.conferenceListView.removeConstraints().done()
|
||||
self.conferenceListView.matchParentSideBorders(insetedByDx: 10).alignUnder(view: super.topBar,withMargin: self.form_margin).alignParentBottom().done()
|
||||
noConference.isHidden = !ScheduledConferencesViewModel.shared.daySplitted.isEmpty
|
||||
super.nextButton.isEnabled = Core.get().defaultAccount != nil
|
||||
}
|
||||
|
||||
// TableView datasource delegate
|
||||
|
|
|
|||
|
|
@ -391,6 +391,7 @@ class VoipTheme { // Names & values replicated from Android
|
|||
static let conference_create_button = [
|
||||
UIButton.State.normal.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(voip_dark_gray,voip_dark_gray)),
|
||||
UIButton.State.highlighted.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(primary_color,primary_color)),
|
||||
UIButton.State.disabled.rawValue : TintableIcon(name: "voip_conference_new",tintColor: LightDarkColor(voip_light_gray,voip_light_gray)),
|
||||
]
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,16 +27,20 @@ class StyledValuePicker: UIView {
|
|||
// layout constants
|
||||
let chevron_margin = 10.0
|
||||
let form_input_height = 38.0
|
||||
let dropDown = DropDown()
|
||||
|
||||
|
||||
let formattedLabel = StyledLabel(VoipTheme.conference_scheduling_font)
|
||||
var pickerMode:UIDatePicker.Mode = .date
|
||||
var options : [String]
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
self.options = []
|
||||
super.init(coder: coder)
|
||||
}
|
||||
|
||||
init (liveIndex:MutableLiveData<Int>, options:[String], readOnly:Bool = false) {
|
||||
self.options = options
|
||||
super.init(frame: .zero)
|
||||
|
||||
formattedLabel.isUserInteractionEnabled = false
|
||||
|
|
@ -65,7 +69,6 @@ class StyledValuePicker: UIView {
|
|||
DropDown.appearance().selectionBackgroundColor = VoipTheme.light_grey_color
|
||||
DropDown.appearance().cellHeight = form_input_height
|
||||
|
||||
let dropDown = DropDown()
|
||||
dropDown.anchorView = self
|
||||
dropDown.bottomOffset = CGPoint(x: 0, y:(dropDown.anchorView?.plainView.bounds.height)!)
|
||||
dropDown.dataSource = options
|
||||
|
|
@ -80,21 +83,21 @@ class StyledValuePicker: UIView {
|
|||
}
|
||||
|
||||
onClick {
|
||||
dropDown.show()
|
||||
self.dropDown.show()
|
||||
}
|
||||
|
||||
height(form_input_height).done()
|
||||
|
||||
liveIndex.readCurrentAndObserve { (value) in
|
||||
dropDown.selectRow(value!)
|
||||
self.dropDown.selectRow(value!)
|
||||
}
|
||||
isUserInteractionEnabled = !readOnly
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
func setIndex(index: Int) {
|
||||
self.dropDown.selectRow(index)
|
||||
formattedLabel.text = " "+options[index]
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue