haoxiqiang
04/07/2022, 4:00 AM@Layout(R.layout.album_medium)
class AlbumViewHolder(view: View) : FlowHolder<Album>(view) ...
I have two problems
1.when I used KSAnnotated.annotations, I have got the int value of R.layout.album_medium, Is there any way to get the defined text?
2.I want to get Album class defined by Layout annotation. Could I get it from KSAnnotated? If not, what should I do?yigit
04/07/2022, 4:04 AMhaoxiqiang
04/07/2022, 4:45 AMFlowHolder<Album>
haoxiqiang
04/07/2022, 4:46 AMFlowHolder<Album>
, the album classJiaxiang
04/07/2022, 6:20 PMKSClassDeclaration.superTypes
and then you can get the individual super types, from where you can call KSTypeReference.resolve().declaration
to get the class declaration of these super types.haoxiqiang
04/08/2022, 6:47 AMKSClassDeclaration.superTypes.toList().first()
.resolve().arguments.first().type?.resolve()?.declaration
It works, thanks.