Last active
September 24, 2019 18:43
-
-
Save Laimiux/cc27248df063d73b833c95f4024fd041 to your computer and use it in GitHub Desktop.
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 StopwatchRenderView(root: ViewGroup): RenderView<StopwatchRenderModel> { | |
private val timePassed: TextView = root.findViewById(R.id.time_passed_text_view) | |
private val startStopButton: Button = root.findViewById(R.id.start_stop_button) | |
private val resetButton: Button = root.findViewById(R.id.reset_button) | |
override val renderer: Renderer<StopwatchRenderModel> = Renderer.create { model -> | |
timePassed.text = model.timePassed | |
startStopButton.text = model.startStopButton.text | |
startStopButton.setOnClickListener { | |
model.startStopButton.onSelected() | |
} | |
resetButton.text = model.resetButton.text | |
resetButton.setOnClickListener { | |
model.resetButton.onSelected() | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment