Skip to content

Instantly share code, notes, and snippets.

@GantMan
Created September 14, 2014 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GantMan/e17fa04308cffe3436a9 to your computer and use it in GitHub Desktop.
Save GantMan/e17fa04308cffe3436a9 to your computer and use it in GitHub Desktop.
class MainActivity < Android::App::Activity
def onCreate(savedInstanceState)
super
seekBar = Android::Widget::SeekBar.new(self)
seekBar.setMax(200)
seekBar.setProgress(100)
textView = Android::Widget::TextView.new(self)
textView.setText("Initial text")
listener = Android::Widget::SeekBar::OnSeekBarChangeListener.new do
def onProgressChanged(seekBar, progress, fromUser)
super
textView.Text = progress;
end
end
seekBar.setOnSeekBarChangeListener(listener)
linearLayout = Android::Widget::LinearLayout.new(self)
linearLayout.addView(textView)
linearLayout.addView(dropDownSpinner)
linearLayout.setPadding(40,40,0,40)
self.contentView = linearLayout
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment