Last active
October 19, 2015 20:40
-
-
Save bmichotte/54713f70fe3dae83077f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeScreen < PM::CollectionScreen | |
collection_layout UICollectionViewFlowLayout, | |
direction: :vertical, | |
minimum_line_spacing: 0, | |
minimum_interitem_spacing: 0, | |
item_size: [256, 256] | |
cell_classes button_cell: ButtonCell | |
stylesheet HomeScreenStylesheet | |
def collection_data | |
[ | |
[ | |
{ | |
image: 'horaire', | |
title: :class_schedule._, | |
cell_identifier: :button_cell, | |
action: -> { | |
open ScheduleScreen.new | |
} | |
}, | |
{ | |
image: 'jdc', | |
title: :timetable._, | |
cell_identifier: :button_cell, | |
action: -> { | |
open TimetableScreen.new | |
} | |
}, | |
# and so on | |
] | |
] | |
end | |
def will_appear | |
find(UICollectionView).style do |st| | |
st.frame = { l: 0, t: 50, w: device.screen_width, h: device.screen_height - 50 } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment