mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
add animation, remove vstack
This commit is contained in:
parent
62cc26c873
commit
aa9d9ad2a1
1 changed files with 24 additions and 21 deletions
|
@ -110,19 +110,18 @@ struct ChatListView<ToolbarContent: View>: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !chatModel.chats.isEmpty && searchVisible {
|
if !chatModel.chats.isEmpty && searchVisible {
|
||||||
VStack {
|
ChatListSearchBar(
|
||||||
ChatListSearchBar(
|
searchMode: $searchMode,
|
||||||
searchMode: $searchMode,
|
searchFocussed: $searchFocussed,
|
||||||
searchFocussed: $searchFocussed,
|
searchText: $searchText,
|
||||||
searchText: $searchText,
|
searchShowingSimplexLink: $searchShowingSimplexLink,
|
||||||
searchShowingSimplexLink: $searchShowingSimplexLink,
|
searchChatFilteredBySimplexLink: $searchChatFilteredBySimplexLink
|
||||||
searchChatFilteredBySimplexLink: $searchChatFilteredBySimplexLink
|
)
|
||||||
)
|
.scaleEffect(x: 1, y: oneHandUI ? -1 : 1, anchor: .center)
|
||||||
.scaleEffect(x: 1, y: oneHandUI ? -1 : 1, anchor: .center)
|
.listRowSeparator(.hidden)
|
||||||
.listRowSeparator(.hidden)
|
.frame(maxWidth: .infinity)
|
||||||
.frame(maxWidth: .infinity)
|
.padding(10)
|
||||||
.padding(10)
|
.transition(.move(edge: .top))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.background(.bar)
|
.background(.bar)
|
||||||
|
@ -139,10 +138,12 @@ struct ChatListView<ToolbarContent: View>: View {
|
||||||
|
|
||||||
if frame.maxY <= screenHeight && frame.maxY > screenHeight - frame.height / 2 {
|
if frame.maxY <= screenHeight && frame.maxY > screenHeight - frame.height / 2 {
|
||||||
if topVisibleRowIndex != index {
|
if topVisibleRowIndex != index {
|
||||||
if let topVisibleRowIndex = topVisibleRowIndex {
|
withAnimation {
|
||||||
searchVisible = topVisibleRowIndex > index || index == 0
|
searchVisible = if let topVisibleRowIndex {
|
||||||
} else {
|
topVisibleRowIndex > index || index == 0
|
||||||
searchVisible = true
|
} else {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
topVisibleRowIndex = index
|
topVisibleRowIndex = index
|
||||||
|
@ -151,10 +152,12 @@ struct ChatListView<ToolbarContent: View>: View {
|
||||||
} else {
|
} else {
|
||||||
if frame.minY >= 0 && frame.minY < frame.height / 2 {
|
if frame.minY >= 0 && frame.minY < frame.height / 2 {
|
||||||
if topVisibleRowIndex != index {
|
if topVisibleRowIndex != index {
|
||||||
if let topVisibleRowIndex = topVisibleRowIndex {
|
withAnimation {
|
||||||
searchVisible = topVisibleRowIndex > index
|
searchVisible = if let topVisibleRowIndex {
|
||||||
} else {
|
topVisibleRowIndex > index
|
||||||
searchVisible = true
|
} else {
|
||||||
|
true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
topVisibleRowIndex = index
|
topVisibleRowIndex = index
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue