Skip to content

Instantly share code, notes, and snippets.

@fluxtah
Created April 2, 2020 14:52
Show Gist options
  • Save fluxtah/fe26fb1df77ece7882df88dc09579e1f to your computer and use it in GitHub Desktop.
Save fluxtah/fe26fb1df77ece7882df88dc09579e1f to your computer and use it in GitHub Desktop.
class HelloViewImpl(activity: AppCompatActivity) : HelloView {
private val greetingTextView: TextView = activity.findViewById(R.id.greeting_text)
private val newGreetingButton: Button = activity.findViewById(R.id.new_greeting_button)
override fun updateGreetingText(greetingText: String) {
greetingTextView.text = greetingText
}
override fun onShowNewGreetingButtonPressed(onPressed: () -> Unit) =
newGreetingButton.setOnClickListener { onPressed() }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment