{"action":"created","issue":{"url":"https://api.github.com/repos/airbnb/epoxy/issues/452","repository_url":"https://api.github.com/repos/airbnb/epoxy","labels_url":"https://api.github.com/repos/airbnb/epoxy/issues/452/labels{/name}","comments_url":"https://api.github.com/repos/airbnb/epoxy/issues/452/comments","events_url":"https://api.github.com/repos/airbnb/epoxy/issues/452/events","html_url":"https://github.com/airbnb/epoxy/issues/452","id":333558973,"node_id":"MDU6SXNzdWUzMzM1NTg5NzM=","number":452,"title":"Creating Models From ViewHolders works in Java. Not in Kotlin","user":{"login":"ColtonIdle","id":31751141,"node_id":"MDQ6VXNlcjMxNzUxMTQx","avatar_url":"https://avatars2.githubusercontent.com/u/31751141?v=4","gravatar_id":"","url":"https://api.github.com/users/ColtonIdle","html_url":"https://github.com/ColtonIdle","followers_url":"https://api.github.com/users/ColtonIdle/followers","following_url":"https://api.github.com/users/ColtonIdle/following{/other_user}","gists_url":"https://api.github.com/users/ColtonIdle/gists{/gist_id}","starred_url":"https://api.github.com/users/ColtonIdle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ColtonIdle/subscriptions","organizations_url":"https://api.github.com/users/ColtonIdle/orgs","repos_url":"https://api.github.com/users/ColtonIdle/repos","events_url":"https://api.github.com/users/ColtonIdle/events{/privacy}","received_events_url":"https://api.github.com/users/ColtonIdle/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-19T07:58:21Z","updated_at":"2018-06-19T21:18:45Z","closed_at":null,"author_association":"NONE","body":"I've been doing the following when creating Models from viewholders in java\r\n\r\n```\r\n@EpoxyModelClass(layout = R.layout.da_thing)\r\npublic abstract class MyModel extends EpoxyModelWithHolder<MyModel.MyHolder> {\r\n    @EpoxyAttribute\r\n    EmailItem emailItem;\r\n\r\n\r\n    @Override\r\n    public void bind(YourViewHolder holder) {\r\n        super.bind(holder);\r\n        holder.bindingTime(emailItem);\r\n    }\r\n\r\n    static class MyHolder extends BaseEpoxyHolder {\r\n\r\n        @BindView(R.id.text) TextView textView;\r\n\r\n        public void bindingTime(EmailItem emailItem) {\r\n            textView(your_info_needed_for_model+\"\");\r\n\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nThis works well, but when I convert to Kotlin (kotlin noob here) I get the following. It seems like the fault is mostly on Butterknife. The question is... since using Kotlin I do not use Butterknife anymore. \r\n\r\nEssentially I got this though.\r\n\r\n```\r\n@EpoxyModelClass(layout = R.layout.da_thing)\r\nabstract class MyModel : EpoxyModelWithHolder<MyModel.MyHolder>() {\r\n    @EpoxyAttribute\r\n    var emailItem: EmailItem = EmailItem()\r\n\r\n\r\n    override fun bind(holder: MyHolder?) {\r\n        super.bind(holder)\r\n        holder!!.bindTo(emailItem)\r\n    }\r\n\r\n    class MyHolder : BaseEpoxyHolder() {\r\n\r\n        @BindView(R.id.text) var textView: TextView? = null\r\n\r\n        fun bindTo(emailItem: EmailItem) {\r\n            textView?.setText(\"asdf\")\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nIt'd be great to get rid of butterknife in this case. Thoughts @elihart ?"},"comment":{"url":"https://api.github.com/repos/airbnb/epoxy/issues/comments/398549508","html_url":"https://github.com/airbnb/epoxy/issues/452#issuecomment-398549508","issue_url":"https://api.github.com/repos/airbnb/epoxy/issues/452","id":398549508,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODU0OTUwOA==","user":{"login":"elihart","id":2739242,"node_id":"MDQ6VXNlcjI3MzkyNDI=","avatar_url":"https://avatars2.githubusercontent.com/u/2739242?v=4","gravatar_id":"","url":"https://api.github.com/users/elihart","html_url":"https://github.com/elihart","followers_url":"https://api.github.com/users/elihart/followers","following_url":"https://api.github.com/users/elihart/following{/other_user}","gists_url":"https://api.github.com/users/elihart/gists{/gist_id}","starred_url":"https://api.github.com/users/elihart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elihart/subscriptions","organizations_url":"https://api.github.com/users/elihart/orgs","repos_url":"https://api.github.com/users/elihart/repos","events_url":"https://api.github.com/users/elihart/events{/privacy}","received_events_url":"https://api.github.com/users/elihart/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T21:18:45Z","updated_at":"2018-06-19T21:18:45Z","author_association":"CONTRIBUTOR","body":"I imagine that should work, but I haven't personally used kotlin's generated extensions. We use kotterknife"}}
{"actor":{"display_login":"elihart"}}