My app uses a library project "core project" with the application core, then little projects "child projects" for the particularities of each supported device, ie. Amazon Fire TV, Kindle tablets, regular google tablets, phones, etc.
Let's say, I have a Custom View class MyCustomView
that inflates programmatically a layout R.layout.layout_customview
. Both are on the core project:
public class MyCustomView {
.
.
inflate (R.layout.layout_customview);
.
.
}
I'd like to create an alternative layout for this custom view in one of the child projects, so I created the layout_customview.xml
and put it into the child project res/layout.
However, the custom view keeps inflating the other one under the core project res/layout (sounds logical after all, as they both reside in the same project).
Is there a way to change this behavior? ie. "override" xml layout files, or do I have to give the alternative layout a different name, extend the class, etc..?