Skip to content

Instantly share code, notes, and snippets.

@Laimiux
Last active September 25, 2019 22:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Laimiux/d857ad8239111da7f5b8c63fe611d695 to your computer and use it in GitHub Desktop.
Save Laimiux/d857ad8239111da7f5b8c63fe611d695 to your computer and use it in GitHub Desktop.
class StopwatchActivity : FragmentActivity() {
private val disposables = CompositeDisposable()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.stopwatch_activity)
val renderView = StopwatchRenderView(findViewById(R.id.activity_content))
val renderModels: Observable<StopwatchRenderModel> =
StopwatchFormula().start(Unit)
disposables.add(renderModels.subscribe(renderView.renderer::render))
}
override fun onDestroy() {
disposables.clear()
super.onDestroy()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment