It seems that another thing is done in the super.layout() method. Seems to be an internal stuff, for text positioning I think.
The technique I have found, even if it is not the best one I guess :
- don't override layout
- override getPreferredHeight() and getPreferredWidth() :
Code:
public int getPreferredHeight() {
if (isStyle(USE_ALL_HEIGHT)) {
return Integer.MAX_VALUE;
}
return super.getPreferredHeight();
}
public int getPreferredWidth() {
if (isStyle(USE_ALL_WIDTH)) {
return Integer.MAX_VALUE;
}
return super.getPreferredWidth();
}
I hope this works in any situations. I know it is not very very clean, if you have a better idea...