Class: PrimeResideMenu::SidebarContainerScreen
- Inherits:
-
RESideMenu
- Object
- RESideMenu
- PrimeResideMenu::SidebarContainerScreen
- Includes:
- MotionPrime::ScreenBaseMixin
- Defined in:
- lib/prime_reside_menu/sidebar_container_screen.rb
Class Method Summary collapse
Instance Method Summary collapse
- #content_controller ⇒ Object
- #content_controller=(c) ⇒ Object
- #hide_sidebar ⇒ Object
- #menu_controller ⇒ Object
- #menu_controller=(c) ⇒ Object
- #show_sidebar ⇒ Object
- #toggle_sidebar ⇒ Object
Class Method Details
.new(menu, content, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 5 def self.new(, content, = {}) screen = self.alloc.initWithContentViewController(nil, menuViewController: nil) screen.parallaxEnabled = false if !Prime::Config..background_image.nil? screen.backgroundImage = Prime::Config..background_image end full_width = UIScreen.mainScreen.bounds.size.width if scale = [:content_scale_value] screen.contentViewScaleValue = scale end x_offset = [:x_offset] || 45 screen.contentViewInPortraitOffsetCenterX = full_width*(1 + screen.contentViewScaleValue/2) - x_offset if y_offset = [:y_offset] screen.contentViewInPortraitOffsetCenterY = UIScreen.mainScreen.bounds.size.height/2 + y_offset end screen.on_create(.merge(navigation: false)) if screen.respond_to?(:on_create) screen. = unless .nil? screen.content_controller = content unless content.nil? screen end |
Instance Method Details
#content_controller ⇒ Object
61 62 63 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 61 def content_controller self.contentViewController end |
#content_controller=(c) ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 47 def content_controller=(c) controller = prepare_controller(c) if should_reinit_content?(controller) self.setContentViewController controller else content_controller.viewControllers = [controller] end end |
#hide_sidebar ⇒ Object
35 36 37 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 35 def self.hideMenuViewController end |
#menu_controller ⇒ Object
57 58 59 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 57 def self. end |
#menu_controller=(c) ⇒ Object
43 44 45 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 43 def (c) self.setMenuViewController prepare_controller(c) end |
#show_sidebar ⇒ Object
31 32 33 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 31 def self.presentMenuViewController end |
#toggle_sidebar ⇒ Object
39 40 41 |
# File 'lib/prime_reside_menu/sidebar_container_screen.rb', line 39 def self.presentMenuViewController end |