How do I avoid this hardcoded math...
10dip
6dip
You don't, sorry. Layout XML files do not support expressions. You either:
@dimen/uno_plus_dos, orUPDATE The data binding library supports some operations in its expressions. I am uncertain if it can handle this specific scenario.