icon.setBounds(0,0,128,128);で大きさをセットしてから
setCompoundDrawables で右に貼り付けてください。
以下サンプルです。
Button button = (Button)findViewById(R.id.xxbutton);
button.setBackgroundColor(Color.LTGRAY);
button.setTextColor(Color.BLACK);
Drawable icon;
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
icon = getDrawable(R.drawable.icon);
} else{
icon = getResources().getDrawable(R.drawable.icon);
}
icon.setBounds(0,0,128,128);
button.setCompoundDrawables(null, null, icon, null);
もし、buttonに設定されているDrawableを取得するのであれば
icon = b.getCompoundDrawables()[2];
のようにしてボタン右側設定のものを取得できます。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。