mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Conference scheduling graphical fixes :
- mandatory indicator icon truncated - text entry colors (hint/text) - Send via option moved inside scheduling form - mandatory indicator placement - conference summary cosmetics
This commit is contained in:
parent
7e308427d0
commit
b0f5efae59
4 changed files with 41 additions and 24 deletions
|
|
@ -84,7 +84,7 @@ import SVProgressHUD
|
|||
// Left column (Date & Time)
|
||||
let leftColumn = UIView()
|
||||
scheduleForm.addSubview(leftColumn)
|
||||
leftColumn.matchParentWidthDividedBy(2.2).alignParentLeft(withMargin: form_margin).alignParentTop(withMargin: form_margin).done()
|
||||
leftColumn.matchParentWidthDividedBy(2.2).alignParentLeft().alignParentTop(withMargin: form_margin).done()
|
||||
|
||||
let dateLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_date)
|
||||
leftColumn.addSubview(dateLabel)
|
||||
|
|
@ -106,7 +106,7 @@ import SVProgressHUD
|
|||
// Right column (Duration & Timezone)
|
||||
let rightColumn = UIView()
|
||||
scheduleForm.addSubview(rightColumn)
|
||||
rightColumn.matchParentWidthDividedBy(2.2).alignParentRight(withMargin: form_margin).alignParentTop().done()
|
||||
rightColumn.matchParentWidthDividedBy(2.2).alignParentRight().alignParentTop().done()
|
||||
|
||||
let durationLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_duration)
|
||||
rightColumn.addSubview(durationLabel)
|
||||
|
|
@ -127,12 +127,12 @@ import SVProgressHUD
|
|||
// Description
|
||||
let descriptionLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_description_title)
|
||||
scheduleForm.addSubview(descriptionLabel)
|
||||
descriptionLabel.alignUnder(view: leftColumn,withMargin: form_margin).alignUnder(view: rightColumn,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).done()
|
||||
descriptionLabel.alignUnder(view: leftColumn,withMargin: form_margin).alignUnder(view: rightColumn,withMargin: form_margin).matchParentSideBorders().done()
|
||||
|
||||
descriptionInput.textContainer.maximumNumberOfLines = 5
|
||||
descriptionInput.textContainer.lineBreakMode = .byWordWrapping
|
||||
scheduleForm.addSubview(descriptionInput)
|
||||
descriptionInput.alignUnder(view: descriptionLabel,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).height(description_height).alignParentBottom(withMargin: form_margin*2).done()
|
||||
descriptionInput.alignUnder(view: descriptionLabel,withMargin: form_margin).matchParentSideBorders().height(description_height).alignParentBottom(withMargin: form_margin*2).done()
|
||||
|
||||
scheduleForm.wrapContentY().done()
|
||||
|
||||
|
|
@ -140,16 +140,17 @@ 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()
|
||||
viaChatLabel.numberOfLines = 2
|
||||
ConferenceSchedulingViewModel.shared.sendInviteViaChat.readCurrentAndObserve { (sendChat) in
|
||||
viaChatLabel.isHidden = sendChat != true || ConferenceSchedulingViewModel.shared.scheduleForLater.value != true
|
||||
}
|
||||
|
||||
// Participants
|
||||
let participantsLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_participants_list)
|
||||
let participantsLabel = StyledLabel(VoipTheme.conference_scheduling_font, " "+VoipTexts.conference_schedule_participants_list)
|
||||
participantsLabel.backgroundColor = VoipTheme.voipFormBackgroundColor.get()
|
||||
contentView.addSubview(participantsLabel)
|
||||
participantsLabel.matchParentSideBorders().height(form_input_height).alignUnder(view: viaChatLabel,withMargin: form_margin*2).done()
|
||||
participantsLabel.textAlignment = .center
|
||||
participantsLabel.textAlignment = .left
|
||||
|
||||
|
||||
contentView.addSubview(participantsListTableView)
|
||||
|
|
|
|||
|
|
@ -133,19 +133,22 @@ import IQKeyboardManager
|
|||
descriptionInput.textContainer.maximumNumberOfLines = 5
|
||||
descriptionInput.textContainer.lineBreakMode = .byWordWrapping
|
||||
scheduleForm.addSubview(descriptionInput)
|
||||
descriptionInput.alignUnder(view: descriptionLabel,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).height(description_height).alignParentBottom(withMargin: form_margin*2).done()
|
||||
|
||||
scheduleForm.wrapContentY().done()
|
||||
descriptionInput.alignUnder(view: descriptionLabel,withMargin: 2*form_margin).matchParentSideBorders(insetedByDx: form_margin).height(description_height).done()
|
||||
|
||||
// Sending methods
|
||||
|
||||
let viaChatView = UIView()
|
||||
scheduleForm.addSubview(viaChatView)
|
||||
viaChatView.alignUnder(view: descriptionInput,withMargin: form_margin).matchParentSideBorders(insetedByDx: form_margin).alignParentBottom(withMargin: form_margin*4).done()
|
||||
|
||||
let viaChatSwitch = StyledCheckBox(liveValue: ConferenceSchedulingViewModel.shared.sendInviteViaChat)
|
||||
contentView.addSubview(viaChatSwitch)
|
||||
viaChatSwitch.alignParentLeft(withMargin: form_margin).alignUnder(view: schedulingStack,withMargin: 2*form_margin).done()
|
||||
viaChatView.addSubview(viaChatSwitch)
|
||||
viaChatSwitch.alignParentLeft().done()
|
||||
|
||||
let viaChatLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_send_invite_chat)
|
||||
contentView.addSubview(viaChatLabel)
|
||||
viaChatLabel.toRightOf(viaChatSwitch,withLeftMargin: form_margin).alignUnder(view: schedulingStack,withMargin: 2*form_margin).alignHorizontalCenterWith(viaChatSwitch).done()
|
||||
|
||||
viaChatView.addSubview(viaChatLabel)
|
||||
viaChatLabel.toRightOf(viaChatSwitch,withLeftMargin: form_margin).alignHorizontalCenterWith(viaChatSwitch).done()
|
||||
|
||||
/* Hidden as in Android 9.6.2022
|
||||
|
||||
let viaMailSwitch = StyledCheckBox(liveValue: ConferenceSchedulingViewModel.shared.sendInviteViaEmail)
|
||||
|
|
@ -184,17 +187,18 @@ import IQKeyboardManager
|
|||
let mandatoryLabel = StyledLabel(VoipTheme.conference_scheduling_font, VoipTexts.conference_schedule_mandatory_field)
|
||||
mandatoryLabel.addIndicatorIcon(iconName: "voip_mandatory", trailing: false)
|
||||
contentView.addSubview(mandatoryLabel)
|
||||
mandatoryLabel.alignUnder(view: viaChatSwitch,withMargin: 2*form_margin).centerX().matchParentSideBorders().done()
|
||||
mandatoryLabel.textAlignment = .center
|
||||
|
||||
mandatoryLabel.alignParentBottom().done()
|
||||
let lastView = UIView()
|
||||
contentView.addSubview(lastView)
|
||||
lastView.alignUnder(view: mandatoryLabel).alignParentBottom().done()
|
||||
|
||||
// Schedule for later observer
|
||||
ConferenceSchedulingViewModel.shared.scheduleForLater.readCurrentAndObserve { (forLater) in
|
||||
scheduleForm.isHidden = forLater != true
|
||||
super.titleLabel.text = forLater == true ? VoipTexts.conference_schedule_title : VoipTexts.conference_group_call_title
|
||||
viaChatSwitch.isHidden = forLater != true
|
||||
viaChatLabel.isHidden = forLater != true
|
||||
mandatoryLabel.removeConstraints().done()
|
||||
mandatoryLabel.alignUnder(view: forLater == true ? scheduleForm : scheduleForLater,withMargin: 2*self.form_margin).centerX().matchParentSideBorders().done()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ extension UILabel {
|
|||
func addIndicatorIcon(iconName:String, padding:CGFloat = 5.0, y:CGFloat = 4.0, trailing: Bool = true) {
|
||||
let imageAttachment = NSTextAttachment()
|
||||
imageAttachment.image = UIImage(named:iconName)
|
||||
imageAttachment.bounds = CGRect(x: 5.0, y: y , width: font.lineHeight - 2*padding, height: font.lineHeight - 2*padding)
|
||||
imageAttachment.bounds = CGRect(x: 0.0, y: y , width: font.lineHeight - 2*padding, height: font.lineHeight - 2*padding)
|
||||
let iconString = NSMutableAttributedString(attachment: imageAttachment)
|
||||
let textXtring = NSMutableAttributedString(string: text != nil ? text! : "")
|
||||
let textXtring = NSMutableAttributedString(string: text != nil ? (!trailing ? " " : "") + text! + (trailing ? " " : "") : "")
|
||||
if (trailing) {
|
||||
textXtring.append(iconString)
|
||||
self.text = nil
|
||||
|
|
|
|||
|
|
@ -25,12 +25,22 @@ class StyledTextView: UITextView, UITextViewDelegate {
|
|||
var style:TextStyle?
|
||||
var liveValue: MutableLiveData<String>? = nil
|
||||
var maxLines:Int
|
||||
|
||||
var isEditing = false
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
maxLines = 0
|
||||
super.init(coder: coder)
|
||||
}
|
||||
|
||||
override var text: String?{
|
||||
didSet{
|
||||
textColor = text?.count ?? 0 > 0 && text != placeholder ? style?.fgColor.get().withAlphaComponent(1.0) : style?.fgColor.get().withAlphaComponent(0.5)
|
||||
if !isEditing && text == "" {
|
||||
showPlaceHolder()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init (_ style:TextStyle, placeHolder:String? = nil, liveValue: MutableLiveData<String>, readOnly:Bool = false, maxLines:Int = 999) {
|
||||
self.maxLines = maxLines
|
||||
self.style = style
|
||||
|
|
@ -54,17 +64,19 @@ class StyledTextView: UITextView, UITextViewDelegate {
|
|||
textColor = textColor?.withAlphaComponent(0.5)
|
||||
}
|
||||
isUserInteractionEnabled = !readOnly
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func textViewDidBeginEditing(_ textView: UITextView) {
|
||||
isEditing = true
|
||||
if text == placeholder {
|
||||
placeholder = textView.text
|
||||
text = ""
|
||||
textColor = style?.fgColor.get().withAlphaComponent(1.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func textViewDidEndEditing(_ textView: UITextView) {
|
||||
isEditing = false
|
||||
if text == "" {
|
||||
showPlaceHolder()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue