ColorDialog
ColorDialog copied to clipboard
Cancel Button is not proper aligned if there is no image assigned
If there is no image provided in ColorDialog, Cancel button is not aligned properly :
ColorDialog dialog = new ColorDialog(this);
dialog.setTitle(getString(R.string.operation));
dialog.setAnimationEnable(true);
dialog.setAnimationIn(getInAnimationTest(this));
dialog.setAnimationOut(getOutAnimationTest(this));
// dialog.setContentImage(getResources().getDrawable(R.mipmap.sample_img)); //REMOVED IMAGE
dialog.setPositiveListener(getString(R.string.delete), new ColorDialog.OnPositiveListener() {
@Override
public void onClick(ColorDialog dialog) {
Toast.makeText(MainActivity.this, dialog.getPositiveText().toString(), Toast.LENGTH_SHORT).show();
}
})
.setNegativeListener(getString(R.string.cancel), new ColorDialog.OnNegativeListener() {
@Override
public void onClick(ColorDialog dialog) {
Toast.makeText(MainActivity.this, dialog.getNegativeText().toString(), Toast.LENGTH_SHORT).show();
dialog.dismiss();
}
}).show();
This issue is solved if layout of positive & negative button is set to "match_parent". See below: I have created a pull request for this