mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2024-12-17 17:20:21 +01:00
placeholders looking good and sync page sizes with android
This commit is contained in:
@@ -62,8 +62,6 @@ struct ChatItemView: View {
|
||||
CIVoiceView(chat: chat, chatItem: ci, recordingFile: ci.file, duration: duration, allowMenu: $allowMenu)
|
||||
} else if ci.content.msgContent == nil {
|
||||
ChatItemContentView(chat: chat, chatItem: chatItem, msgContentView: { Text(ci.text) }) // msgContent is unreachable branch in this case
|
||||
} else if ci.isPlaceholder {
|
||||
EmptyView()
|
||||
} else {
|
||||
framedItemView()
|
||||
}
|
||||
|
||||
@@ -220,7 +220,11 @@ struct ReverseList<Content: View>: UIViewControllerRepresentable {
|
||||
var snapshot = NSDiffableDataSourceSnapshot<Section, ChatItem>()
|
||||
if let gap = gap {
|
||||
var itemsCopy = items
|
||||
let blanks = (0..<gap.size).map { index in ChatItem.placeholder(index + 1) }
|
||||
let blanks = (0..<gap.size).map { index in
|
||||
// Using existing text instead of random rumble or empty text does make long scroll look natural.
|
||||
let sourceItem = items[index % items.count]
|
||||
return ChatItem.placeholder(idx: index + 1, text: sourceItem.text, chatDir: sourceItem.chatDir)
|
||||
}
|
||||
itemsCopy.insert(contentsOf: blanks, at: gap.index)
|
||||
renderedItems = itemsCopy
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user