From 79a22353680d12013be3968f22635b48a27ff3fa Mon Sep 17 00:00:00 2001 From: Christophe Deschamps Date: Thu, 3 Nov 2022 10:09:47 +0100 Subject: [PATCH] Cosmetic on conference list display --- .../Data/ScheduledConferenceData.swift | 6 ++-- .../Views/ScheduledConferencesCell.swift | 30 +++++++++--------- .../Views/ScheduledConferencesView.swift | 9 ++++-- Classes/Swift/Util/TimestampUtils.swift | 5 ++- Classes/Swift/Voip/Theme/VoipTexts.swift | 2 +- Classes/Swift/Voip/Theme/VoipTheme.swift | 3 ++ Resources/fr.lproj/Localizable.strings | Bin 72472 -> 72468 bytes Resources/ru.lproj/Localizable.strings | Bin 87374 -> 87372 bytes 8 files changed, 32 insertions(+), 23 deletions(-) diff --git a/Classes/Swift/Conference/Data/ScheduledConferenceData.swift b/Classes/Swift/Conference/Data/ScheduledConferenceData.swift index 86934f720..f17bc0ee8 100644 --- a/Classes/Swift/Conference/Data/ScheduledConferenceData.swift +++ b/Classes/Swift/Conference/Data/ScheduledConferenceData.swift @@ -57,10 +57,8 @@ class ScheduledConferenceData { rawDate = Date(timeIntervalSince1970:TimeInterval(conferenceInfo.dateTime)) let durationFormatter = DateComponentsFormatter() - durationFormatter.unitsStyle = .positional - durationFormatter.allowedUnits = [.minute, .second ] - durationFormatter.zeroFormattingBehavior = [ .pad ] - duration.value = conferenceInfo.duration > 0 ? durationFormatter.string(from: TimeInterval(conferenceInfo.duration)) : nil + durationFormatter.unitsStyle = .abbreviated + duration.value = conferenceInfo.duration > 0 ? durationFormatter.string(from: TimeInterval(conferenceInfo.duration*60)) : nil organizer.value = conferenceInfo.organizer?.addressBookEnhancedDisplayName() diff --git a/Classes/Swift/Conference/Views/ScheduledConferencesCell.swift b/Classes/Swift/Conference/Views/ScheduledConferencesCell.swift index 41a318ced..26cb67b8a 100644 --- a/Classes/Swift/Conference/Views/ScheduledConferencesCell.swift +++ b/Classes/Swift/Conference/Views/ScheduledConferencesCell.swift @@ -32,15 +32,15 @@ class ScheduledConferencesCell: UITableViewCell { let clockIcon = UIImageView(image: UIImage(named: "conference_schedule_time_default")) let timeDuration = StyledLabel(VoipTheme.conference_invite_desc_font) let organiser = StyledLabel(VoipTheme.conference_invite_desc_font) - let subject = StyledLabel(VoipTheme.conference_invite_subject_font) + let subject = StyledLabel(VoipTheme.conference_list_subject_font) let cancelledLabel = StyledLabel(VoipTheme.conference_cancelled_title_font) let participantsIcon = UIImageView(image: UIImage(named: "conference_schedule_participants_default")) let participants = StyledLabel(VoipTheme.conference_invite_desc_font) let infoConf = UIButton() - let descriptionTitle = StyledLabel(VoipTheme.conference_invite_desc_font, VoipTexts.conference_description_title) - let descriptionValue = StyledLabel(VoipTheme.conference_invite_desc_font) - let urlTitle = StyledLabel(VoipTheme.conference_invite_desc_font, VoipTexts.conference_schedule_address_title) + let descriptionTitle = StyledLabel(VoipTheme.conference_list_address_desc_font, VoipTexts.conference_description_title) + let descriptionValue = StyledLabel(VoipTheme.conference_list_address_desc_font) + let urlTitle = StyledLabel(VoipTheme.conference_list_address_desc_font, VoipTexts.conference_schedule_address_title) let urlValue = StyledLabel(VoipTheme.conference_scheduling_font) let copyLink = CallControlButton(width:button_size,height:button_size,buttonTheme: VoipTheme.scheduled_conference_action("voip_copy")) let joinConf = FormButton(title:VoipTexts.conference_invite_join.uppercased(), backgroundStateColors: VoipTheme.button_green_background) @@ -55,7 +55,7 @@ class ScheduledConferencesCell: UITableViewCell { var conferenceData: ScheduledConferenceData? = nil { didSet { if let data = conferenceData { - timeDuration.text = "\(data.time.value)"+(data.duration.value != nil ? " ( \(data.duration.value) )" : "") + timeDuration.text = "\(data.time.value)"+(data.duration.value != nil ? " (\(data.duration.value))" : "") organiser.text = VoipTexts.conference_schedule_organizer+data.organizer.value! subject.text = data.subject.value! cancelledLabel.text = data.isConferenceCancelled.value == true ? ( data.canEdit.value == true ? VoipTexts.conference_scheduled_cancelled_by_me: VoipTexts.conference_scheduled_cancelled_by_organizer) : nil @@ -84,8 +84,8 @@ class ScheduledConferencesCell: UITableViewCell { } else { self.editConf.isHidden = true } - self.participants.removeConstraints().alignUnder(view: self.subject,withMargin: 15).toRightOf(self.participantsIcon,withLeftMargin:10).toRightOf(self.participantsIcon,withLeftMargin:10).toLeftOf(self.infoConf,withRightMargin: 15).done() - self.joinEditDelete.removeConstraints().alignUnder(view: self.expandedRows,withMargin: 15).alignParentRight(withMargin: 10).done() + self.participants.removeConstraints().alignUnder(view: self.subject,withMargin: 10).toRightOf(self.participantsIcon,withLeftMargin:10).toRightOf(self.participantsIcon,withLeftMargin:10).toLeftOf(self.infoConf,withRightMargin: 15).done() + self.joinEditDelete.removeConstraints().alignUnder(view: self.expandedRows,withMargin: 10).alignParentRight(withMargin: 10).done() if (expanded == true) { self.joinEditDelete.alignParentBottom(withMargin: 10).done() } else { @@ -109,25 +109,25 @@ class ScheduledConferencesCell: UITableViewCell { myContentView.matchParentDimmensions(insetedBy: UIEdgeInsets(top: 5,left: 0,bottom: 5,right: 0)).done() myContentView.addSubview(clockIcon) - clockIcon.alignParentTop(withMargin: 15).square(15).alignParentLeft(withMargin: 10).done() + clockIcon.alignParentTop(withMargin: 10).square(20).alignParentLeft(withMargin: 10).done() myContentView.addSubview(timeDuration) - timeDuration.alignParentTop(withMargin: 15).toRightOf(clockIcon,withLeftMargin:10).alignHorizontalCenterWith(clockIcon).done() + timeDuration.alignParentTop(withMargin: 10).toRightOf(clockIcon,withLeftMargin:10).alignHorizontalCenterWith(clockIcon).done() myContentView.addSubview(organiser) - organiser.alignParentTop(withMargin: 15).toRightOf(timeDuration, withLeftMargin:10).alignParentRight(withMargin:10).alignHorizontalCenterWith(clockIcon).done() + organiser.alignParentTop(withMargin: 10).toRightOf(timeDuration, withLeftMargin:10).alignParentRight(withMargin:10).alignHorizontalCenterWith(clockIcon).done() let subjectCancel = UIStackView() subjectCancel.axis = .vertical myContentView.addSubview(subjectCancel) - subjectCancel.alignUnder(view: timeDuration,withMargin: 15).alignParentLeft(withMargin: 10).done() + subjectCancel.alignUnder(view: timeDuration,withMargin: 10).matchParentSideBorders(insetedByDx: 10.0).done() subjectCancel.addArrangedSubview(cancelledLabel) subjectCancel.addArrangedSubview(subject) myContentView.addSubview(participantsIcon) - participantsIcon.alignUnder(view: subject,withMargin: 15).square(15).alignParentLeft(withMargin: 10).done() + participantsIcon.alignUnder(view: subject,withMargin: 5).square(25).alignParentLeft(withMargin: 10).done() //infoConf.onClick { contentView.onClick { @@ -136,12 +136,12 @@ class ScheduledConferencesCell: UITableViewCell { } myContentView.addSubview(infoConf) infoConf.imageView?.contentMode = .scaleAspectFit - infoConf.alignUnder(view: subject,withMargin: 15).square(30).alignParentRight(withMargin: 10).alignHorizontalCenterWith(participantsIcon).done() + infoConf.alignUnder(view: subject,withMargin: 5).square(25).alignParentRight(withMargin: 10).done() infoConf.applyTintedIcons(tintedIcons: VoipTheme.conference_info_button) myContentView.addSubview(participants) - participants.alignUnder(view: subject,withMargin: 15).toRightOf(participantsIcon,withLeftMargin:10).toRightOf(participantsIcon,withLeftMargin:10).toLeftOf(infoConf,withRightMargin: 15).done() + participants.alignUnder(view: subject,withMargin: 10).toRightOf(participantsIcon,withLeftMargin:10).toRightOf(participantsIcon,withLeftMargin:10).toLeftOf(infoConf,withRightMargin: 15).done() expandedRows.axis = .vertical expandedRows.spacing = 10 @@ -170,7 +170,7 @@ class ScheduledConferencesCell: UITableViewCell { joinEditDelete.distribution = .equalSpacing myContentView.addSubview(joinEditDelete) - joinEditDelete.alignUnder(view: expandedRows,withMargin: 15).alignParentRight(withMargin: 10).done() + joinEditDelete.alignUnder(view: expandedRows,withMargin: 10).alignParentRight(withMargin: 10).done() joinEditDelete.addArrangedSubview(joinConf) diff --git a/Classes/Swift/Conference/Views/ScheduledConferencesView.swift b/Classes/Swift/Conference/Views/ScheduledConferencesView.swift index 38dd2aefd..50a1a16cb 100644 --- a/Classes/Swift/Conference/Views/ScheduledConferencesView.swift +++ b/Classes/Swift/Conference/Views/ScheduledConferencesView.swift @@ -28,6 +28,7 @@ import linphonesw let noConference = StyledLabel(VoipTheme.empty_list_font,VoipTexts.conference_no_schedule) let filters = UIStackView() let selectAllButton = CallControlButton(buttonTheme:VoipTheme.nav_button("deselect_all")) + let separator = UIView() static let compositeDescription = UICompositeViewDescription(ScheduledConferencesView.self, statusBar: StatusBarView.self, tabBar: nil, sideMenu: SideMenuView.self, fullscreen: false, isLeftFragment: false,fragmentWith: nil) static func compositeViewDescription() -> UICompositeViewDescription! { return compositeDescription } @@ -52,6 +53,7 @@ import linphonesw }, nextActionEnableCondition: MutableLiveData(), title:VoipTexts.conference_scheduled) + super.titleLabel.applyStyle(VoipTheme.navigation_header_font) // Select all selectAllButton.setImage(UIImage(named: "deselect_all"), for: .selected) @@ -86,7 +88,10 @@ import linphonesw filters.spacing = 10 filters.alignParentLeft(withMargin: 10).alignUnder(view: super.topBar,withMargin: self.form_margin).done() - + self.view.addSubview(separator) + separator.backgroundColor = VoipTheme.voip_light_gray + separator.matchParentSideBorders().height(1).alignUnder(view: filters,withMargin: self.form_margin).done() + // Conference list self.view.addSubview(conferenceListView) @@ -151,7 +156,7 @@ import linphonesw super.viewWillAppear(animated) self.conferenceListView.reloadData() self.conferenceListView.removeConstraints().done() - self.conferenceListView.matchParentSideBorders(insetedByDx: 10).alignUnder(view: filters,withMargin: self.form_margin).alignParentBottom().done() + self.conferenceListView.matchParentSideBorders(insetedByDx: 10).alignUnder(view: separator).alignParentBottom().done() noConference.isHidden = !ScheduledConferencesViewModel.shared.daySplitted.isEmpty super.nextButton.isEnabled = Core.get().defaultAccount != nil ScheduledConferencesViewModel.shared.editionEnabled.value = false diff --git a/Classes/Swift/Util/TimestampUtils.swift b/Classes/Swift/Util/TimestampUtils.swift index d217ee350..18087c33a 100644 --- a/Classes/Swift/Util/TimestampUtils.swift +++ b/Classes/Swift/Util/TimestampUtils.swift @@ -57,7 +57,10 @@ class TimestampUtils { let dateFormatter = DateFormatter() dateFormatter.dateStyle = .long dateFormatter.timeStyle = .none - return dateFormatter.string(from: date) + let dayFormatter = DateFormatter() + dayFormatter.dateFormat = "EEEE" + let day = dayFormatter.string(from: date) + return day.prefix(1).uppercased() + day.dropFirst()+" "+dateFormatter.string(from: date) } static func timeToString(date:Date) -> String { diff --git a/Classes/Swift/Voip/Theme/VoipTexts.swift b/Classes/Swift/Voip/Theme/VoipTexts.swift index f1ef256a1..cc88a086f 100644 --- a/Classes/Swift/Voip/Theme/VoipTexts.swift +++ b/Classes/Swift/Voip/Theme/VoipTexts.swift @@ -80,7 +80,7 @@ import UIKit @objc static let chat_room_group_info_admin = NSLocalizedString("Admin",comment:"") @objc static let conference_creation_failed = NSLocalizedString("Failed to create meeting",comment:"") @objc static let conference_default_title = NSLocalizedString("Remote group call",comment:"") - @objc static let conference_description_title = NSLocalizedString("Description:",comment:"") + @objc static let conference_description_title = NSLocalizedString("Description",comment:"") @objc static let conference_display_mode_active_speaker = NSLocalizedString("Active speaker mode",comment:"") @objc static let conference_display_mode_audio_only = NSLocalizedString("Audio only mode",comment:"") @objc static let conference_display_mode_mosaic = NSLocalizedString("Mosaic mode",comment:"") diff --git a/Classes/Swift/Voip/Theme/VoipTheme.swift b/Classes/Swift/Voip/Theme/VoipTheme.swift index 28f8d17a0..6a12d881e 100644 --- a/Classes/Swift/Voip/Theme/VoipTheme.swift +++ b/Classes/Swift/Voip/Theme/VoipTheme.swift @@ -106,6 +106,7 @@ import UIKit static let call_stats_font = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 12.0) static let call_stats_font_title = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 18.0) static let calls_list_header_font = TextStyle(fgColor: voipTextColor, bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 20.0) + static let navigation_header_font = TextStyle(fgColor: LightDarkColor(primary_color,primary_color), bgColor: LightDarkColor(.clear,.clear), allCaps: true, align: .center, font: fontName+"-Bold", size: 27.0) static let call_list_active_name_font = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 18.0) static let call_list_active_sip_uri_font = TextStyle(fgColor: LightDarkColor(.white,.white), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 12.0) @@ -138,6 +139,8 @@ import UIKit static let empty_list_font = TextStyle(fgColor: primaryTextColor, bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 18.0) static let conf_list_filter_button_font = TextStyle(fgColor: LightDarkColor(.black,.black), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .center, font: fontName+"-Regular", size: 14.0) + static let conference_list_subject_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,voip_dark_gray), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Bold", size: 18.0) + static let conference_list_address_desc_font = TextStyle(fgColor: LightDarkColor(voip_dark_gray,voip_dark_gray), bgColor: LightDarkColor(.clear,.clear), allCaps: false, align: .left, font: fontName+"-Regular", size: 18.0) // Buttons Background (State colors) diff --git a/Resources/fr.lproj/Localizable.strings b/Resources/fr.lproj/Localizable.strings index 4004afb217172a3fac9a0810fd4373aec55469bb..54f605706680a0ac181d2458e05da1ef3ee98aeb 100644 GIT binary patch delta 14 WcmbQSjb+L1OQFo2gLvY delta 20 ccmX@JiuK$o)`l&Nznqz@7`Fd%W(*Pp0AKS5{{R30