Skip to content

Instantly share code, notes, and snippets.

@tfcporciuncula
Created March 26, 2019 14:23
Show Gist options
  • Save tfcporciuncula/b21c60f15810074e4dbb9621529f4194 to your computer and use it in GitHub Desktop.
Save tfcporciuncula/b21c60f15810074e4dbb9621529f4194 to your computer and use it in GitHub Desktop.
TextPresenter.kt
class TextPresenter @AssistedInject constructor(
@Assisted private val view: TextView,
@Assisted @Text private val text: String,
private val textDecorator: TextDecorator
) {
@AssistedInject.Factory
interface Factory {
fun create(view: TextView, @Text text: String): TextPresenter
}
fun onCreate() {
view.showText(textDecorator.decorate(text))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment