Module: ProMotion::DelegateModule::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#apply_status_barObject



84
85
86
87
88
# File 'lib/ProMotion/delegate/delegate_module.rb', line 84

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

#get_tint_colorObject



106
107
108
# File 'lib/ProMotion/delegate/delegate_module.rb', line 106

def get_tint_color
  @tint_color || nil
end

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



79
80
81
82
# File 'lib/ProMotion/delegate/delegate_module.rb', line 79

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

#status_bar_animation(opt) ⇒ Object



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

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

#tint_color(c) ⇒ Object



98
99
100
# File 'lib/ProMotion/delegate/delegate_module.rb', line 98

def tint_color(c)
  @tint_color = c
end

#tint_color=(c) ⇒ Object



102
103
104
# File 'lib/ProMotion/delegate/delegate_module.rb', line 102

def tint_color=(c)
  @tint_color = c
end