airbnb/epoxy

Use default value from kotlin setter in a model view

Open

#598 创建于 2018年10月30日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)Java (8,412 star) (738 fork)batch import
help wanted

描述

In @ModelView components setting default values is a pain, since the annotation @ModelProp has to take a string reference by name of a constant.

With kotlin's native support of default values, ideally the generated epoxy model could call a no-arg version of the setter to have the default value used.

The annotation processor and generated code would have to be updated for this. Main issues I see are having the annotation processor know if a default value is present (I think there is a kotlin metadata library we can use for that), and since the generated model is in java it needs to be able to access the no arg version of the function, so many jvmoverloads is required, but it would be nice to not need that

贡献者指南