Skip to content

Instantly share code, notes, and snippets.

@hluhovskyi
Last active September 11, 2017 15:06
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 hluhovskyi/c671368d070133e7af746c01f6962bb1 to your computer and use it in GitHub Desktop.
Save hluhovskyi/c671368d070133e7af746c01f6962bb1 to your computer and use it in GitHub Desktop.
interface ContextProvdier {
fun provideContext(): Context
}
class OwnActivity : AppCompatActivity(), ContextProvider {
fun provideContext() = this
}
class OwnFragment : Fragment(), ContextProvider {
fun provideContext() = context
}
class OwnView : View, ContextProvider {
fun provideContext() = context
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment