mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
Added options to animations.throb
This commit is contained in:
@@ -83,19 +83,21 @@ module RubyMotionQuery
|
||||
end
|
||||
|
||||
# @return [RMQ]
|
||||
def throb
|
||||
def throb(opts = {})
|
||||
opts.merge!({
|
||||
duration: 0.4,
|
||||
animations: -> (cq) {
|
||||
cq.style {|st| st.scale = 1.0}
|
||||
}
|
||||
})
|
||||
|
||||
@rmq.animate(
|
||||
duration: 0.1,
|
||||
animations: -> (q) {
|
||||
q.style {|st| st.scale = 1.1}
|
||||
},
|
||||
completion: -> (did_finish, q) {
|
||||
q.animate(
|
||||
duration: 0.4,
|
||||
animations: -> (cq) {
|
||||
cq.style {|st| st.scale = 1.0}
|
||||
}
|
||||
)
|
||||
q.animate(opts)
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
@@ -44,7 +44,7 @@ module RubyMotionQuery
|
||||
def reapply_styles
|
||||
selected.each do |selected_view|
|
||||
if style_name = selected_view.rmq_data.style_name
|
||||
apply_style_to_view selected_view, style_name
|
||||
apply_style_to_view selected_view, style_name
|
||||
end
|
||||
end
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user