infinitered / bluepotion

Like RedPotion, but for Android
MIT License
74 stars 18 forks source link

Add a progressbar to ProgressHUD #110

Closed bmichotte closed 8 years ago

bmichotte commented 8 years ago

This PR adds the possibility to set a max attribute on a new ProgressHUD and then use hud.increment to set the progress

The following video came from this example

find(R::Id::Progress).on(:tap) do |_|
  @hud = ProgressHUD.new('Loading', style: :horizontal, max: 100)
  @hud.show
  app.async do
    (0..100).each do |_|
      @hud.increment
      sleep 0.2
    end
  end.on(:completion) do |_|
    @hud.dismiss
  end
end

You can also use increment(some_value)

BP ProgressHUD

This PR also complete #16