I've referenced many posts on SO related to this topic, where I needed to create a way to have a library module use references(colors, strings, drawables, etc) from the main app module; ultimately using the answer found here for my solution using custom attributes.
The attrs.xml currently resides in the library module's resources, while the main app's theme has these attributes defined and referencing some main app color resources. And so far, this solution works well.
However, I want to ask if this will hold if I were to make an .AAR file out of my library module and import it into another project as an imported AAR. Would it still properly use the custom attributes in the library module as long as I define them in the app theme of the main app in the new project?
It should work when included in other client app, provided that you defined the colour resource in that new app, where your aar is included later.
As I have been developing some SDK for long time, my approach with such case is to define some default colour resource with same name inside library module and use that. Then, if client app wants different colour for that, they can define the colour resource with the same name having different colour value, in their resources.