Use a UITableView component for the timeline. (#349)

* Use a collection view for the timeline.
* Switch to a table view.
This commit is contained in:
Doug
2022-12-05 15:39:21 +00:00
committed by GitHub
parent 9415bd3a7a
commit 3c893ba342
27 changed files with 583 additions and 463 deletions
@@ -14,7 +14,7 @@
// limitations under the License.
//
import Foundation
import Combine
import UIKit
enum RoomScreenViewModelAction {
@@ -29,7 +29,7 @@ enum RoomScreenComposerMode: Equatable {
}
enum RoomScreenViewAction {
case loadPreviousPage
case paginateBackwards
case itemAppeared(id: String)
case itemDisappeared(id: String)
case itemTapped(id: String)
@@ -56,12 +56,22 @@ struct RoomScreenViewState: BindableState {
var sendButtonDisabled: Bool {
bindings.composerText.count == 0
}
let scrollToBottomPublisher = PassthroughSubject<Void, Never>()
/// Returns the opacity that the supplied timeline item's cell should be.
func opacity(for item: RoomTimelineViewProvider) -> CGFloat {
guard case let .reply(selectedItemID, _) = composerMode else { return 1.0 }
return selectedItemID == item.id ? 1.0 : 0.5
}
}
struct RoomScreenViewStateBindings {
var composerText: String
var composerFocused: Bool
var scrollToBottomButtonVisible = false
/// Information describing the currently displayed alert.
var alertInfo: AlertInfo<RoomScreenErrorType>?