Move tap gesture to the article title, use an animation on transition

This commit is contained in:
Jackson Harper 2022-09-02 11:38:19 +08:00
parent 4aca2c1c8f
commit 1c9e73e2c7

View file

@ -141,12 +141,6 @@ public struct MiniPlayer: View {
.frame(width: dim, height: dim)
.cornerRadius(6)
}
.onTapGesture(count: 2) {
if expanded {
expanded = false
NSNotification.pushReaderItem(objectID: item.objectID)
}
}
if !expanded {
Text(item.unwrappedTitle)
@ -176,6 +170,12 @@ public struct MiniPlayer: View {
.foregroundColor(.appGrayTextContrast)
.frame(maxWidth: .infinity, alignment: expanded ? .center : .leading)
.matchedGeometryEffect(id: "ArticleTitle", in: animation)
.onTapGesture {
NSNotification.pushReaderItem(objectID: item.objectID)
withAnimation(.easeIn(duration: 0.1)) {
expanded = false
}
}
HStack {
Spacer()