Move Android compiler plugin tests to android-compiler-plugin module
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
package com.myapp
|
||||
|
||||
import android.app.Activity
|
||||
import android.view.View
|
||||
import android.widget.*
|
||||
|
||||
class R {
|
||||
class id {
|
||||
class object {
|
||||
val item_detail_container = 0
|
||||
val textView1 = 1
|
||||
val password = 2
|
||||
val textView2 = 3
|
||||
val passwordConfirmation = 4
|
||||
val login = 5
|
||||
val passwordField = 6
|
||||
val passwordCaption = 7
|
||||
val loginButton = 8
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyActivity(): Activity() {
|
||||
val textViewWidget = TextView(this)
|
||||
val editTextWidget = EditText(this)
|
||||
val buttonWidget = Button(this)
|
||||
val textViewWidget2 = TextView(this)
|
||||
val editTextWidget2 = EditText(this)
|
||||
val buttonWidget2 = Button(this)
|
||||
|
||||
override fun findViewById(id: Int): View? {
|
||||
return when (id) {
|
||||
R.id.textView1 -> textViewWidget
|
||||
R.id.password -> editTextWidget
|
||||
R.id.login -> buttonWidget
|
||||
R.id.passwordField -> textViewWidget2
|
||||
R.id.passwordCaption -> editTextWidget2
|
||||
R.id.loginButton -> buttonWidget2
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public fun box(): String{
|
||||
return if (textView1.toString() == "TextView" &&
|
||||
password.toString() == "EditText" &&
|
||||
login.toString() == "Button" &&
|
||||
passwordField.toString() == "TextView" &&
|
||||
passwordCaption.toString() == "EditText" &&
|
||||
loginButton.toString() == "Button")
|
||||
"OK" else ""
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return MyActivity().box()
|
||||
}
|
||||
Reference in New Issue
Block a user