Commit 5e2a77a7 authored by  Joel  Oksanen's avatar Joel Oksanen
Browse files

Added animations

parent 2d911028
...@@ -38,7 +38,11 @@ struct FeatureView: View { ...@@ -38,7 +38,11 @@ struct FeatureView: View {
ForEach(self.arguments, id: \.id) { argument in ForEach(self.arguments, id: \.id) { argument in
FeatureBubble(argument: argument, FeatureBubble(argument: argument,
showingQueryOptionsForArgument: self.$showingQueryOptionsForArgument) showingQueryOptionsForArgument: self.$showingQueryOptionsForArgument)
.onTapGesture { self.showingQueryOptionsForArgument = argument } .onTapGesture {
withAnimation(.easeInOut(duration: 0.3)) {
self.showingQueryOptionsForArgument = argument
}
}
} }
Spacer() Spacer()
.frame(width: 10) .frame(width: 10)
......
...@@ -51,10 +51,10 @@ struct MessageView: View { ...@@ -51,10 +51,10 @@ struct MessageView: View {
.background(MessageBubble(sender: message.sender).foregroundColor(sent ? bubbleColors[message.sender] : FeatureView.bubbleColor)) .background(MessageBubble(sender: message.sender).foregroundColor(sent ? bubbleColors[message.sender] : FeatureView.bubbleColor))
.frame(minWidth: 0, maxWidth: maxWidth, alignment: message.sender == .ADA ? .leading : .trailing) .frame(minWidth: 0, maxWidth: maxWidth, alignment: message.sender == .ADA ? .leading : .trailing)
.onTapGesture { .onTapGesture {
if self.message.sender == .ADA { withAnimation(.easeInOut(duration: 0.3)) {
self.chatManager.showOptionsFor(self.message as! ADAMessage) if self.message.sender == .ADA {
} else if !self.sent { self.chatManager.showOptionsFor(self.message as! ADAMessage)
withAnimation(Animation.easeInOut(duration: 0.3)) { } else if !self.sent {
self.chatManager.sendQuery(query: self.query!) self.chatManager.sendQuery(query: self.query!)
self.sent = true self.sent = true
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment