{"action":"created","issue":{"url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/34","repository_url":"https://api.github.com/repos/SalomonBrys/Kodein","labels_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/34/labels{/name}","comments_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/34/comments","events_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/34/events","html_url":"https://github.com/SalomonBrys/Kodein/pull/34","id":170951547,"number":34,"title":"Kodein android components","user":{"login":"eygraber","id":1100381,"avatar_url":"https://avatars.githubusercontent.com/u/1100381?v=3","gravatar_id":"","url":"https://api.github.com/users/eygraber","html_url":"https://github.com/eygraber","followers_url":"https://api.github.com/users/eygraber/followers","following_url":"https://api.github.com/users/eygraber/following{/other_user}","gists_url":"https://api.github.com/users/eygraber/gists{/gist_id}","starred_url":"https://api.github.com/users/eygraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eygraber/subscriptions","organizations_url":"https://api.github.com/users/eygraber/orgs","repos_url":"https://api.github.com/users/eygraber/repos","events_url":"https://api.github.com/users/eygraber/events{/privacy}","received_events_url":"https://api.github.com/users/eygraber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":20,"created_at":"2016-08-12T20:20:46Z","updated_at":"2016-12-08T18:00:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SalomonBrys/Kodein/pulls/34","html_url":"https://github.com/SalomonBrys/Kodein/pull/34","diff_url":"https://github.com/SalomonBrys/Kodein/pull/34.diff","patch_url":"https://github.com/SalomonBrys/Kodein/pull/34.patch"},"body":"@SalomonBrys The last commit is the big one that has some questions\n1. I left out `KodeinAppCompatActivity` because kodein-android only imports support-v4. I didn't want to start changing the whole build process (because the appcompat support library is an AAR as opposed to a JAR). Users can still make their own `KodeinAppCompatActivity` if the absolutely need it (we could put the proper code for it in the docs).\n2. I went with `KodeinInjector` instead of `LazyKodein` because it seemed safer when working with Android. Any thoughts on that?\n3. What do you think of the overall concept?\n\nI haven't written any docs yet; would like to hear what you think first.\n\nHere's a sample of how it could be used:\n\n``` kotlin\nclass MyApplication : Application(), KodeinAware {\n  override val kodein by Kodein.lazy {\n    import(autoAndroidModule(this@MyApplication))\n\n    bind<String>() with instance(\"Hello, Kodein Android!\")\n  }\n}\n\nclass MyActivity : KodeinFragmentActivity() {\n  private val test: Test by injector.with(this as Activity).instance()\n  private val testOther: Test by injector.with(this as Activity).instance()\n  private val alarmManager: AlarmManager by injector.instance()\n\n  override fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n\n    Log.e(\"TEST\", \"$test $testOther\")\n  }\n\n  override fun provideBindings(): Kodein.Module? {\n    return Kodein.Module {\n      bind<Test>() with activitySingleton { Test(instance(), instance(), instance()) }\n    }\n  }\n}\n\nclass Test(injector: KodeinInjected, message: String, activity: Activity) {\n  private val prefs: SharedPreferences by injector.instance()\n\n  init {\n    Log.e(\"TEST\", \"$message - $prefs - $activity\")\n  }\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/comments/265808866","html_url":"https://github.com/SalomonBrys/Kodein/pull/34#issuecomment-265808866","issue_url":"https://api.github.com/repos/SalomonBrys/Kodein/issues/34","id":265808866,"user":{"login":"eygraber","id":1100381,"avatar_url":"https://avatars.githubusercontent.com/u/1100381?v=3","gravatar_id":"","url":"https://api.github.com/users/eygraber","html_url":"https://github.com/eygraber","followers_url":"https://api.github.com/users/eygraber/followers","following_url":"https://api.github.com/users/eygraber/following{/other_user}","gists_url":"https://api.github.com/users/eygraber/gists{/gist_id}","starred_url":"https://api.github.com/users/eygraber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eygraber/subscriptions","organizations_url":"https://api.github.com/users/eygraber/orgs","repos_url":"https://api.github.com/users/eygraber/repos","events_url":"https://api.github.com/users/eygraber/events{/privacy}","received_events_url":"https://api.github.com/users/eygraber/received_events","type":"User","site_admin":false},"created_at":"2016-12-08T18:00:00Z","updated_at":"2016-12-08T18:00:00Z","body":"Made the changes, and all that's left now is to write up the documentation (hope to do that before Monday).\r\n\r\nBesides documentation, the only thing that needs to be updated are the bintray properties to use your information (if you want to go ahead with switching to bintray, which I once again strongly suggest 😉 ). I can help you get the bintray stuff setup on your end if you want."}}
{"actor":{"display_login":"eygraber"}}