Fixes deprecations and crash in demo app.

This commit is contained in:
Mark Rickert
2015-01-21 08:14:39 -05:00
parent de06f3f5c4
commit e872cb4d9c
4 changed files with 5 additions and 9 deletions

View File

@@ -73,7 +73,7 @@ class MainController < UIViewController
# You really should create a new style in the stylesheet, # You really should create a new style in the stylesheet,
# but you can do it inline too, like so # but you can do it inline too, like so
rmq.style do |sv| rmq.style do |sv|
sv.top = rand(rmq.device.height) sv.frame = {top: rand(rmq.device.height)}
sv.scale = 10.0 sv.scale = 10.0
end end
}, },
@@ -81,7 +81,7 @@ class MainController < UIViewController
rmq.animate( duration: 0.2, animations: -> (rmq) { rmq.animate( duration: 0.2, animations: -> (rmq) {
rmq.style do |sv| rmq.style do |sv|
sv.scale = 1.0 sv.scale = 1.0
sv.top = 230 sv.frame = {top: 230}
end end
}) })
}) })

View File

@@ -168,15 +168,13 @@ class MainControllerStylesheet < ApplicationStylesheet
def popup_wrapper(st) def popup_wrapper(st)
st.hidden = true st.hidden = true
st.frame = {w: screen_width - 20, h: 120} st.frame = {w: screen_width - 20, h: 120, centered: :both}
st.centered = :both
st.background_color = color.white st.background_color = color.white
st.z_position = 100 st.z_position = 100
end end
def popup_text_label(st) def popup_text_label(st)
label st label st
st.padded = {l: 10, t: 10, b:10, r: 10}
st.text_alignment = :left st.text_alignment = :left
st.color = color.black st.color = color.black
st.font = font.system(10) st.font = font.system(10)

View File

@@ -68,8 +68,7 @@ __END__
# another way to do it is tag the views you need to restyle in your stylesheet, # another way to do it is tag the views you need to restyle in your stylesheet,
# then only reapply the tagged views, like so: # then only reapply the tagged views, like so:
def logo(st) def logo(st)
st.frame = {t: 10, w: 200, h: 96} st.frame = {t: 10, w: 200, h: 96, centered: :horizontal}
st.centered = :horizontal
st.image = image.resource('logo') st.image = image.resource('logo')
st.tag(:reapply_style) st.tag(:reapply_style)
end end

View File

@@ -27,8 +27,7 @@ __END__
# another way to do it is tag the views you need to restyle in your stylesheet, # another way to do it is tag the views you need to restyle in your stylesheet,
# then only reapply the tagged views, like so: # then only reapply the tagged views, like so:
def logo(st) def logo(st)
st.frame = {t: 10, w: 200, h: 96} st.frame = {t: 10, w: 200, h: 96, centered: :horizontal}
st.centered = :horizontal
st.image = image.resource('logo') st.image = image.resource('logo')
st.tag(:reapply_style) st.tag(:reapply_style)
end end