Sha256: 96be30f94c6aeb714dcff501a6ef32c3e90653f69ca2eb7939bd5ea0dbca46fc

Contents?: true

Size: 822 Bytes

Versions: 3

Compression:

Stored size: 822 Bytes

Contents

module MotionPrime
  module ScreenIndicatorsMixin
    def show_activity_indicator
      if @activity_indicator_view.nil?
        @activity_indicator_view = UIActivityIndicatorView.gray
        @activity_indicator_view.center = CGPointMake(view.center.x, view.center.y - 50)
        view.addSubview @activity_indicator_view
      end
      @activity_indicator_view.startAnimating
    end

    def hide_activity_indicator
      return unless @activity_indicator_view
      @activity_indicator_view.stopAnimating
    end

    def show_notice(message, time = 1.0, type = :notice)
      hud_type = case type.to_s
      when 'alert' then MBAlertViewHUDTypeExclamationMark
      else MBAlertViewHUDTypeCheckmark
      end
      MBHUDView.hudWithBody message,
        type: hud_type, hidesAfter: time, show: true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motion-prime-0.4.0 motion-prime/screens/extensions/_indicators_mixin.rb
motion-prime-0.3.3 motion-prime/screens/extensions/_indicators_mixin.rb
motion-prime-0.3.2 motion-prime/screens/extensions/_indicators_mixin.rb