Skip to content

Instantly share code, notes, and snippets.

@ha-yi
Created June 12, 2017 19:27
Show Gist options
  • Select an option

  • Save ha-yi/7c037751fd0c2d7e570bcb5c090151e5 to your computer and use it in GitHub Desktop.

Select an option

Save ha-yi/7c037751fd0c2d7e570bcb5c090151e5 to your computer and use it in GitHub Desktop.
inline fun <reified T:BaseContactor<*>, reified Y:BasePresenter<*>>RecyclerView.loadData(contactor:Class<T>, presenter:Class<Y>) {
val pres = presenter.asSubclass(presenter).getConstructor(Context::class.java, this::class.java).newInstance(this.context, this)
contactor.asSubclass(contactor).getConstructor(presenter).newInstance(pres).execute()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment