I making complex layout and I using "include" for my custom component, like this
<?xml version="1.0" encoding="utf-8"?>
... a lot of code
<include layout="@layout/topbar" txt:trName="@string/contacts"/>
Unfortunately, the only thing I can contribute is that I was also unable to set custom attributes on an include tag, and have them pass through to the included layout.
It may well not be possible at this point.