You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a sample project, the @Style is use to Field in Companion object. The @Style Annotation is targeted to field and function @Target(FIELD, FUNCTION)
So I tried that annotation to function like this in SectionView.kt
But I can't run this code, getting compile error Methods annotated with @Style must be static and can't be private or protected. [element=styleFunctionTest() JavacMethodElement in com.changgyu.parissample.SectionView.Companion]
That is so weird, because the function is static and not private or protected.
Also I tried to understand that error and found the processor code line in StyleStaticMethodInfoExtractor.kt
`
override fun elementToModel(element: XMethodElement): StyleStaticMethodInfo? {
// TODO Get Javadoc from field/method and add it to the generated methods
if (!element.isStatic() || element.isPrivate() || element.isProtected()) {
parisProcessor.logError(element) {
"Methods annotated with @Style must be static and can't be private or protected."
}
return null
}
......
`
The text was updated successfully, but these errors were encountered:
In a sample project, the @Style is use to Field in Companion object. The @Style Annotation is targeted to field and function
@Target(FIELD, FUNCTION)
So I tried that annotation to function like this in SectionView.kt
companion object { @Style fun styleFunctionTest() = sectionViewStyle { backgroundRes(android.R.color.transparent) paddingBottomRes(R.dimen.space4) paddingLeftRes(R.dimen.space4) paddingRightRes(R.dimen.space4) paddingTopRes(R.dimen.space4) titleStyle(defaultTitleStyle(Color.BLUE)) contentStyle(DEFAULT_CONTENT_STYLE) thumbnailStyle(IMAGE_VIEW_STYLE) dividerColor(Color.parseColor("#DDDDDD")) dividerHeightDp(1) } }
But I can't run this code, getting compile error
Methods annotated with @Style must be static and can't be private or protected. [element=styleFunctionTest() JavacMethodElement in com.changgyu.parissample.SectionView.Companion]
That is so weird, because the function is static and not private or protected.
Also I tried to understand that error and found the processor code line in StyleStaticMethodInfoExtractor.kt
`
override fun elementToModel(element: XMethodElement): StyleStaticMethodInfo? {
// TODO Get Javadoc from field/method and add it to the generated methods
......
`
The text was updated successfully, but these errors were encountered: