Module: ProMotion::DelegateModule::ClassMethods

Defined in:
lib/ProMotion/delegate/delegate_module.rb

Instance Method Summary collapse

Instance Method Details

#apply_status_barObject



95
96
97
98
99
# File 'lib/ProMotion/delegate/delegate_module.rb', line 95

def apply_status_bar
  @status_bar_visible ||= true
  @status_bar_opts ||= { animation: :none }
  UIApplication.sharedApplication.setStatusBarHidden(!@status_bar_visible, withAnimation:status_bar_animation(@status_bar_opts[:animation]))
end

#get_tint_colorObject



117
118
119
# File 'lib/ProMotion/delegate/delegate_module.rb', line 117

def get_tint_color
  @tint_color || nil
end

#status_bar(visible = true, opts = {}) ⇒ Object



90
91
92
93
# File 'lib/ProMotion/delegate/delegate_module.rb', line 90

def status_bar(visible = true, opts={})
  @status_bar_visible = visible
  @status_bar_opts = opts
end

#status_bar_animation(opt) ⇒ Object



101
102
103
104
105
106
107
# File 'lib/ProMotion/delegate/delegate_module.rb', line 101

def status_bar_animation(opt)
  {
    fade:   UIStatusBarAnimationFade,
    slide:  UIStatusBarAnimationSlide,
    none:   UIStatusBarAnimationNone
  }[opt] || UIStatusBarAnimationNone
end

#tint_color(c) ⇒ Object



109
110
111
# File 'lib/ProMotion/delegate/delegate_module.rb', line 109

def tint_color(c)
  @tint_color = c
end

#tint_color=(c) ⇒ Object



113
114
115
# File 'lib/ProMotion/delegate/delegate_module.rb', line 113

def tint_color=(c)
  @tint_color = c
end