ResourceProcessor

class ResourceProcessor

Scans R files and and compiles resource values in those R classes. This allows us to look up raw resource values (eg 23523452) and convert that to the resource name (eg R.layout.my_view) so that we can properly reference that resource. This is important in library projects where the R value at process time can be different from the final R value in the app.

This is adapted from Butterknife. https://github.com/JakeWharton/butterknife/pull/613

Types

Companion
Link copied to clipboard
object Companion

Functions

getAlternateLayouts
Link copied to clipboard
fun getAlternateLayouts(layout: ResourceValue): List<ResourceValue>
Returns a list of layout resources whose name contains the given layout as a prefix.
getLayoutInAnnotation
Link copied to clipboard
fun getLayoutInAnnotation(element: Element, annotationClass: Class<out Annotation>): ResourceValue
getLayoutsInAnnotation
Link copied to clipboard
fun getLayoutsInAnnotation(element: Element, annotationClass: Class<out Annotation>): List<ResourceValue>
Get detailed information about the layout resources that are parameters to the given annotation.
getResourceInAnnotation
Link copied to clipboard
fun getResourceInAnnotation(element: Element, annotationClass: Class<*>, resourceType: String?, resourceValue: Int): ResourceValue
getResourcesInAnnotation
Link copied to clipboard
fun getResourcesInAnnotation(element: Element, annotationClass: Class<*>, resourceType: String?, resourceValues: List<Int>): List<ResourceValue>
getStringResourceInAnnotation
Link copied to clipboard
fun getStringResourceInAnnotation(element: Element, annotationClass: Class<*>, resourceValue: Int): ResourceValue

Properties

rClassNames
Link copied to clipboard
val rClassNames: List<ClassName>
trees
Link copied to clipboard
val trees: Trees?