diff --git a/Session.xcodeproj/project.pbxproj b/Session.xcodeproj/project.pbxproj index 40c8c33cb..0e0d65fc6 100644 --- a/Session.xcodeproj/project.pbxproj +++ b/Session.xcodeproj/project.pbxproj @@ -2270,10 +2270,12 @@ children = ( B835246D25C38ABF0089A44F /* ConversationVC.swift */, B8569AC225CB5D2900DBA3DB /* ConversationVC+Interaction.swift */, + 3496744E2076ACCE00080B5F /* LongTextViewController.swift */, B887C38125C7C79700E11DAE /* Input View */, B835247725C38D190089A44F /* Message Cells */, C328252E25CA54F70062D0A7 /* Context Menu */, B821493625D4D6A7009C0F2A /* Views & Modals */, + C302094625DCDFD3001F572D /* Settings */, ); path = "Conversations V2"; sourceTree = ""; @@ -2523,6 +2525,16 @@ path = "Sending & Receiving"; sourceTree = ""; }; + C302094625DCDFD3001F572D /* Settings */ = { + isa = PBXGroup; + children = ( + 340FC8A0204DAC8D007AEB0F /* OWSConversationSettingsViewController.h */, + 340FC89A204DAC8D007AEB0F /* OWSConversationSettingsViewController.m */, + 340FC899204DAC8D007AEB0F /* OWSConversationSettingsViewDelegate.h */, + ); + path = Settings; + sourceTree = ""; + }; C31C219B255BC92200EC2D66 /* Meta */ = { isa = PBXGroup; children = ( @@ -2945,13 +2957,9 @@ 341341ED2187467900192D59 /* ConversationViewModel.h */, 341341EE2187467900192D59 /* ConversationViewModel.m */, 4CC613352227A00400E21A3A /* ConversationSearch.swift */, - 3496744E2076ACCE00080B5F /* LongTextViewController.swift */, 4CFF4C0920F55BBA005DA313 /* MenuActionsViewController.swift */, 4CB5F26820F7D060004D1B42 /* MessageActions.swift */, 34CA1C261F7156F300E51C51 /* MessageDetailViewController.swift */, - 340FC8A0204DAC8D007AEB0F /* OWSConversationSettingsViewController.h */, - 340FC89A204DAC8D007AEB0F /* OWSConversationSettingsViewController.m */, - 340FC899204DAC8D007AEB0F /* OWSConversationSettingsViewDelegate.h */, ); path = Conversations; sourceTree = ""; diff --git a/Session/Conversations V2/ConversationVC+Interaction.swift b/Session/Conversations V2/ConversationVC+Interaction.swift index 0df2678d8..3a9a58e7f 100644 --- a/Session/Conversations V2/ConversationVC+Interaction.swift +++ b/Session/Conversations V2/ConversationVC+Interaction.swift @@ -333,10 +333,15 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc UIImpactFeedbackGenerator(style: .heavy).impactOccurred() let frame = cell.convert(cell.bubbleView.frame, to: UIApplication.shared.keyWindow!) let window = ContextMenuWindow() - let contextMenuVC = ContextMenuVC(snapshot: snapshot, viewItem: viewItem, frame: frame, delegate: self) { + let contextMenuVC = ContextMenuVC(snapshot: snapshot, viewItem: viewItem, frame: frame, delegate: self) { [weak self] in window.isHidden = true + guard let self = self else { return } self.contextMenuVC = nil self.contextMenuWindow = nil + self.scrollButton.alpha = 0 + UIView.animate(withDuration: 0.25) { + self.scrollButton.alpha = self.getScrollButtonOpacity() + } } self.contextMenuVC = contextMenuVC contextMenuWindow = window diff --git a/Session/Conversations V2/ConversationVC.swift b/Session/Conversations V2/ConversationVC.swift index cd37e2a56..417a56a98 100644 --- a/Session/Conversations V2/ConversationVC.swift +++ b/Session/Conversations V2/ConversationVC.swift @@ -1,12 +1,14 @@ // TODO // • Tapping replies +// • Initial scroll position // • Moderator icons // • Slight paging glitch -// • Scrolling bug -// • Scroll button bug // • Image detail VC transition glitch // • Photo rounding +// • Disappearing messages timer +// • Scroll button behind mentions view +// • Search... final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewDataSource, UITableViewDelegate { let thread: TSThread @@ -37,7 +39,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewD override var canBecomeFirstResponder: Bool { true } private var tableViewUnobscuredHeight: CGFloat { - let bottomInset = messagesTableView.adjustedContentInset.bottom + ConversationVC.bottomInset + let bottomInset = messagesTableView.adjustedContentInset.bottom return messagesTableView.bounds.height - bottomInset } @@ -67,7 +69,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewD lazy var snInputView = InputView(delegate: self) - private lazy var scrollButton = ScrollToBottomButton(delegate: self) + lazy var scrollButton = ScrollToBottomButton(delegate: self) lazy var blockedBanner: InfoBanner = { let name: String @@ -359,7 +361,7 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewD } // MARK: Convenience - private func getScrollButtonOpacity() -> CGFloat { + func getScrollButtonOpacity() -> CGFloat { let contentOffsetY = messagesTableView.contentOffset.y let x = (lastPageTop - ConversationVC.bottomInset - contentOffsetY).clamp(0, .greatestFiniteMagnitude) let a = 1 / (ConversationVC.scrollButtonFullVisibilityThreshold - ConversationVC.scrollButtonNoVisibilityThreshold) diff --git a/Session/Conversations/LongTextViewController.swift b/Session/Conversations V2/LongTextViewController.swift similarity index 98% rename from Session/Conversations/LongTextViewController.swift rename to Session/Conversations V2/LongTextViewController.swift index 278b0e85b..ed8e043f8 100644 --- a/Session/Conversations/LongTextViewController.swift +++ b/Session/Conversations V2/LongTextViewController.swift @@ -4,7 +4,6 @@ import Foundation import SignalUtilitiesKit -import SignalUtilitiesKit @objc public protocol LongTextViewDelegate { @@ -118,7 +117,7 @@ public class LongTextViewController: OWSViewController { let messageTextView = OWSTextView() self.messageTextView = messageTextView - messageTextView.font = .systemFont(ofSize: Values.mediumFontSize) + messageTextView.font = .systemFont(ofSize: Values.smallFontSize) messageTextView.backgroundColor = .clear messageTextView.isOpaque = true messageTextView.isEditable = false diff --git a/Session/Conversations/OWSConversationSettingsViewController.h b/Session/Conversations V2/Settings/OWSConversationSettingsViewController.h similarity index 100% rename from Session/Conversations/OWSConversationSettingsViewController.h rename to Session/Conversations V2/Settings/OWSConversationSettingsViewController.h diff --git a/Session/Conversations/OWSConversationSettingsViewController.m b/Session/Conversations V2/Settings/OWSConversationSettingsViewController.m similarity index 100% rename from Session/Conversations/OWSConversationSettingsViewController.m rename to Session/Conversations V2/Settings/OWSConversationSettingsViewController.m diff --git a/Session/Conversations/OWSConversationSettingsViewDelegate.h b/Session/Conversations V2/Settings/OWSConversationSettingsViewDelegate.h similarity index 100% rename from Session/Conversations/OWSConversationSettingsViewDelegate.h rename to Session/Conversations V2/Settings/OWSConversationSettingsViewDelegate.h