Created
November 10, 2017 21:20
-
-
Save ykro/44ca83ef54df107aa0a3964f8048f600 to your computer and use it in GitHub Desktop.
Android MVC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person(var firstName: String, var lastName: String) //model | |
class MainActivity : AppCompatActivity() { //view + controller | |
private var model: Person = Person("Adrian", "Catalan") | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
btnShowGreet.setOnClickListener { | |
txtGreet.text = | |
"Hello ${model.firstName} ${model.lastName}" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment