Skip to content

Instantly share code, notes, and snippets.

@rajajawahar
Last active May 22, 2018 05:47
Show Gist options
  • Save rajajawahar/4ed34ccd8fe1d9b76c067aec84833d37 to your computer and use it in GitHub Desktop.
Save rajajawahar/4ed34ccd8fe1d9b76c067aec84833d37 to your computer and use it in GitHub Desktop.
class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
LoginActivityUI().setContentView(this)
}
}
class LoginActivityUI : AnkoComponent<LoginActivity> {
override fun createView(ui: AnkoContext<LoginActivity>) = with(ui) {
verticalLayout {
padding = dip(22)
var userName = editText()
userName.hint = "Enter UserName"
var passWord = editText()
passWord.hint = "Enter Password"
var button = button() {
text = "SignIn"
textColor = android.R.color.white
backgroundColor = R.color.colorPrimary
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment