class MotionHybrid::Spinner

Public Class Methods

new(view) click to toggle source
# File lib/motion-hybrid/views/spinner.rb, line 4
def initialize(view)
  @view = view
end

Public Instance Methods

hide() click to toggle source
# File lib/motion-hybrid/views/spinner.rb, line 12
def hide
  MBProgressHUD.hideHUDForView(@view, animated: false)
end
show() click to toggle source
# File lib/motion-hybrid/views/spinner.rb, line 8
def show
  show_hud
end

Private Instance Methods

show_hud() click to toggle source
# File lib/motion-hybrid/views/spinner.rb, line 18
def show_hud
  hud = MBProgressHUD.showHUDAddedTo(@view, animated: true)
  hud.mode = MBProgressHUDModeCustomView
  hud.customView = spin_animation
  hud.removeFromSuperViewOnHide = true
  hud.opacity = 0
end
spin_animation() click to toggle source
# File lib/motion-hybrid/views/spinner.rb, line 26
def spin_animation
  spin_animation = RTSpinKitView.alloc.initWithStyle(RTSpinKitViewStyleWanderingCubes, color: '#323667'.to_color) # TODO: Style from CSS
  spin_animation.startAnimating
  spin_animation
end