Class: ProgressHUD
- Defined in:
- lib/project/progress_hud/progress_hud.rb
Overview
EXAMPLE USAGE #######
Instance Method Summary collapse
- #hide ⇒ Object (also: #close)
-
#initialize(title = "Loading") ⇒ ProgressHUD
constructor
A new instance of ProgressHUD.
- #onCreateDialog(saved_instance_state) ⇒ Object
- #show(activity = rmq.activity) ⇒ Object
- #title=(new_title) ⇒ Object
Constructor Details
#initialize(title = "Loading") ⇒ ProgressHUD
9 10 11 |
# File 'lib/project/progress_hud/progress_hud.rb', line 9 def initialize(title="Loading") @title = title end |
Instance Method Details
#hide ⇒ Object Also known as: close
33 34 35 |
# File 'lib/project/progress_hud/progress_hud.rb', line 33 def hide self.dismiss end |
#onCreateDialog(saved_instance_state) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/project/progress_hud/progress_hud.rb', line 17 def onCreateDialog(saved_instance_state) builder = Android::App::AlertDialog::Builder.new(activity, Android::App::AlertDialog::THEME_HOLO_LIGHT) progress = Android::Widget::ProgressBar.new(activity) progress.setBackgroundColor(Android::Graphics::Color::TRANSPARENT) builder.setView(progress) .setTitle(@title) @created_dialog = builder.create() end |
#show(activity = rmq.activity) ⇒ Object
13 14 15 |
# File 'lib/project/progress_hud/progress_hud.rb', line 13 def show(activity=rmq.activity) super(activity.fragmentManager, "progress") end |
#title=(new_title) ⇒ Object
29 30 31 |
# File 'lib/project/progress_hud/progress_hud.rb', line 29 def title=(new_title) @created_dialog.title = new_title if @created_dialog end |