Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scaloid.example
- import org.scaloid.common._
- import android.graphics.Color
- import android.bluetooth.BluetoothAdapter
- // import android.bluetooth.BluetoothDevice;
- // import android.bluetooth.BluetoothSocket;
- class HelloScaloid extends SActivity {
- val ba = BluetoothAdapter.getDefaultAdapter
- onCreate {
- contentView = new SVerticalLayout {
- style {
- case b: SButton => b.textColor(Color.RED).onClick(toast("Bang!"))
- case t: STextView => t textSize 10.dip
- case e: SEditText => e.backgroundColor(Color.YELLOW).textColor(Color.BLACK)
- }
- STextView("I am 10 dip tall")
- STextView("Me too")
- STextView("I am 15 dip tall") textSize 15.dip // overriding
- this += new SLinearLayout {
- STextView("Button: ")
- SButton(R.string.red)
- }.wrap
- SEditText("Yellow input field fills the space!").fill
- } padding 20.dip
- }
- }
- // ~/programming/android/hello-scaloid-sbt $ sbt android:run
- // [info] Loading global plugins from /home/cody/.sbt/0.13/plugins
- // [info] Loading project definition from /home/cody/source/hello-scaloid-sbt/project
- // [info] Set current project to hello-scaloid-sbt (in build file:/home/cody/source/hello-scaloid-sbt/)
- // [info] Processing resources
- // [info] Compiling 1 Scala source to /home/cody/source/hello-scaloid-sbt/bin/classes...
- // [warn] UPDATE: A newer android-sdk-plugin is available: 1.3.22, currently running: 1.3.21
- // [warn] UPDATE: A newer android-sdk-plugin is available: 1.3.22, currently running: 1.3.21
- // [error] /home/cody/source/hello-scaloid-sbt/src/scaloid/example/HelloScaloid.scala:52: expected class or object definition
- // [error] ~/programming/android/hello-scaloid-sbt $ sbt android:run
- // [error] ^
- // [error] /home/cody/source/hello-scaloid-sbt/src/scaloid/example/HelloScaloid.scala:62: expected class or object definition
- // [error] [error] ^
- // [error] ^
- // [error] two errors found
- // [error] (compile:compileIncremental) Compilation failed
- // [error] Total time: 5 s, completed Apr 29, 2015 5:32:58 PM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement