Conference subject hint changing if groupcall or meeting

This commit is contained in:
Christophe Deschamps 2022-11-02 20:27:20 +01:00
parent 51f23e91bb
commit 3c8af14495
4 changed files with 14 additions and 1 deletions

View file

@ -35,6 +35,7 @@ import IQKeyboardManager
let durationValue = StyledValuePicker(liveIndex: ConferenceSchedulingViewModel.shared.scheduledDuration,options: ConferenceSchedulingViewModel.durationList.map({ (duration: Duration) -> String in duration.display}))
let timePicker = StyledDatePicker(liveValue: ConferenceSchedulingViewModel.shared.scheduledDateTime,pickerMode: .time)
let descriptionInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_description_hint,liveValue: ConferenceSchedulingViewModel.shared.description)
let subjectInput = StyledTextView(VoipTheme.conference_scheduling_font, placeHolder:VoipTexts.conference_schedule_subject_hint, liveValue: ConferenceSchedulingViewModel.shared.subject,maxLines:1)
override func viewDidLoad() {
@ -53,7 +54,6 @@ import IQKeyboardManager
contentView.addSubview(subjectLabel)
subjectLabel.alignParentLeft(withMargin: form_margin).alignParentTop().done()
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()
@ -196,6 +196,7 @@ import IQKeyboardManager
// Schedule for later observer
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { (forLater) in
self.subjectInput.setPlaceHolder(phText: forLater == true ? VoipTexts.conference_schedule_subject_hint : VoipTexts.conference_group_call_subject_hint)
scheduleForm.isHidden = forLater != true
super.titleLabel.text = forLater == true ? ConferenceSchedulingViewModel.shared.existingConfInfo.value != nil ? VoipTexts.conference_schedule_edit : VoipTexts.conference_schedule_title : VoipTexts.conference_group_call_title
mandatoryLabel.removeConstraints().done()

View file

@ -126,6 +126,7 @@ import UIKit
@objc static let conference_schedule_start = NSLocalizedString("Schedule meeting",comment:"")
@objc static let conference_schedule_edit = NSLocalizedString("Edit meeting",comment:"")
@objc static let conference_schedule_subject_hint = NSLocalizedString("Meeting subject",comment:"")
@objc static let conference_group_call_subject_hint = NSLocalizedString("Group call subject",comment:"")
@objc static let conference_schedule_subject_title = NSLocalizedString("Subject",comment:"")
@objc static let conference_schedule_summary = NSLocalizedString("Meeting info",comment:"")
@objc static let conference_schedule_time = NSLocalizedString("Time",comment:"")

View file

@ -41,6 +41,8 @@ class StyledTextView: UITextView, UITextViewDelegate {
}
}
init (_ style:TextStyle, placeHolder:String? = nil, liveValue: MutableLiveData<String>, readOnly:Bool = false, maxLines:Int = 999) {
self.maxLines = maxLines
self.style = style
@ -92,4 +94,13 @@ class StyledTextView: UITextView, UITextViewDelegate {
liveValue?.value = textView.text
}
func setPlaceHolder(phText:String) {
if text == "" || text == placeholder {
self.placeholder = phText
showPlaceHolder()
} else {
self.placeholder = phText
}
}
}