Use SetBackGrounp() target a View component, it will enlange width to the drawable be set.
So it will influence the Center function.
Such us:
TextView tx = new TextView(this);
tx.setText("test"); //the width will be same as the text length.
tx.setBackGrounp(bitmap); //the width will be enlanged as bitmap's width.